Hi there,
With AnimationMode api, what is the proper way to use AddPropertyModification when the property is modified several times in a row from scripts ?
After adding the binding,
If the property is modified only once in the code, then it is restored correctly on exiting preview and prefab value is not considered overriden
Key A:
Restored :
if the property is modified with a different value then it is restored to the wrong value and prefab is considered overriden :
Key A
Key B
Restored
if it is set back to the first modified key value, then it is restored correctly
Key A
Key B
Key C
Restored :
I tried both adding or not adding a new PropertyModification on the second modification by checking
var isPropertyAnimated = AnimationMode.IsPropertyAnimated(target, kinematic.propertyPath); but the result is the same.
I’m quite new to this API so I might be doing something wrong.
Below the way we add the Property binding
var kinematicBinding = EditorCurveBinding.DiscreteCurve(inPath+nameof(Rigidbody) , typeof(Rigidbody), kinematic.name);
var propModification = new PropertyModification
{
target = target,
propertyPath = kinematic.propertyPath,
value = target.isKinematic.ToString()
};
AnimationMode.AddPropertyModification(kinematicBinding, propModification, true);