Notifications
Clear all
[Closed] Edit Poly Vertex animation by script
Mar 27, 2013 2:38 am
Hello,
I try to realise a baking script to save bones animation of a mesh in an Edit Poly Modifier.
The script creates a copy of the bones animated object and animate the copy by following the vertex position of the bones animated object frame by frame.
My script works well with Editable Poly and the Polyop tool.
But i need to do the same thing with the Edit Poly modifier.
So Create an object and animate it in his Editable Poly Base object. Select it.
So my Edit Poly Mod script do this
vCopyObj = Copy $
convertToMesh vCopyObj
convertTo vCopyObj PolyMeshObject
addmodifier vCopyObj (Edit_Poly())
vCopyObj.modifiers["Edit Poly"].animationMode = 1 -- set Edit Poly to animate (0 : Model / 1 : Animate)
vObjNumVert = polyOp.getNumVerts $
animate on
For i = 1 to 10 do -- the start and end frame
(
sliderTime = i - 1 -- move the slider of the timeline to the current frame
For v=1 to vObjNumVert do -- Loop in vertex index
(
vCopyObj.modifiers[1].setVert #{v} (polyOp.getVert $ v) -- I get the vertex position in a reference object by using polyop and set it to the target vertex.
)--end for
)--end for
animate off
sliderTime = 0
When i execute the script above the Copied object didn't get keys like if it doesn't move.
I try to use PolyOp with the Edit Poly modifier but the script animate the baseobject. I want to avoid that.
So do you have a way to animate and set an Edit Poly's vertex position in a script ?
Thank for your help.
3 Replies
Mar 27, 2013 2:38 am
It seems to me that the Point cache modifier is what you are looking for.
Mar 27, 2013 2:38 am
Hello feranti,
I try the point cache and it work very well. I never use it before.
It’s more easy to use than the Edit Poly. The fact you can store the animation in an external file
is just very useful.
So i need to change my script interface and add some ways to choose the name and address of the xml file. It’s not a big challenge.
Thank you a lot for your reply.
(Un pti coucou de Belgique )