@@ -67,7 +67,7 @@ public void LoadTemplates()
6767 if ( _templates . Any ( f => f . UniqueId == template . UniqueId ) )
6868 throw new Exception ( $ "ID { template . UniqueId } was not unique.") ;
6969
70- PruneIdempotentTransforms ( template ) ;
70+ PruneUneditedBones ( template ) ;
7171
7272 _templates . Add ( template ) ;
7373 }
@@ -100,7 +100,7 @@ public Template Create(string name, Dictionary<string, BoneTransform>? bones, bo
100100 } ;
101101
102102 if ( template . Bones . Count > 0 )
103- PruneIdempotentTransforms ( template ) ;
103+ PruneUneditedBones ( template ) ;
104104
105105 _templates . Add ( template ) ;
106106 _logger . Debug ( $ "Added new template { template . UniqueId } .") ;
@@ -220,7 +220,7 @@ public bool ModifyBoneTransform(Template template, string boneName, BoneTransfor
220220 if ( boneTransform == transform )
221221 return false ;
222222
223- if ( transform . IsEdited ( ) )
223+ if ( transform . IsEdited ( true ) ) //true here to allow values of bones with propagations on to cross 0 during editing
224224 {
225225 template . Bones [ boneName ] . UpdateToMatch ( transform ) ;
226226
@@ -240,7 +240,7 @@ public bool ModifyBoneTransform(Template template, string boneName, BoneTransfor
240240 else
241241 {
242242
243- if ( ! transform . IsEdited ( ) )
243+ if ( ! transform . IsEdited ( true ) ) //true here to allow values of bones with propagations on to cross 0 during editing
244244 return false ;
245245
246246 template . Bones [ boneName ] = new BoneTransform ( transform ) ;
@@ -263,7 +263,7 @@ private void DeleteBoneTransform(Template template, string boneName)
263263 _event . Invoke ( TemplateChanged . Type . DeletedBone , template , boneName ) ;
264264 }
265265
266- private static void PruneIdempotentTransforms ( Template template )
266+ private void PruneUneditedBones ( Template template )
267267 {
268268 foreach ( var kvp in template . Bones )
269269 {
@@ -276,6 +276,8 @@ private static void PruneIdempotentTransforms(Template template)
276276
277277 private void SaveTemplate ( Template template )
278278 {
279+ PruneUneditedBones ( template ) ;
280+
279281 template . ModifiedDate = DateTimeOffset . UtcNow ;
280282 _saveService . QueueSave ( template ) ;
281283 }
0 commit comments