[Closed] ffd animateVertex, animateAll
Hi,
I want to bake some keys into my ffd modifier.
However the ffd modifier is not animated. I have some animated points and want to transfer those keys onto the ffd control points.
I’m trying to figure it out with animateVertex and animateAll. But I’m not sure how to do that. I mean both functions are kind of poor and for me all they do is they just enable the animation for the control points, nothing else.
But how do I ascually copy the keys from one object to ffd control points?
I tried appendKey but dont know how to axcess the keys properly.
source_key = $'CtrlPoint_036'.pos.x_position.controller.keys[2]
-- #Bezier Float key(2 @ 0f)
target_keys = masterCtrl[36].controller.keys[1]
-- #Bezier Point3 key(1 @ -1f)
appendKey target_keys source_key
-- Error occurred in anonymous codeblock; filename: U: emp\plataj\3dsMaxScripts\Untitled_0_recover.ms; position: 1066; line: 50
-- Type error: appendKey requires MAXKeyArray, got: #Bezier Point3 key(1 @ -1f)
Okey I made some progress. I assigned the a Point3 Script controller to the testing point. I used this:
dependsOn $'CtrlPoint_036'
[$'CtrlPoint_036'.transform.position.x, $'CtrlPoint_036'.transform.position.y, $'CtrlPoint_036'.transform.position.z]
The script controller is working however the translation is wrong. Maybe I need to do some matrix translation, from global to local?
yes. you have to transform world ctrl point position into modifier’s space (modifiers context transform for the local coordinates)