I am currently developing an exporter for FFDs (Lattice). I currently have support for FFDs animated through shape keys but now I have encountered a lattice whose points are driven by another object, rather than being animated itself, e.g. the lattice points’ positions are being driven by hooks (through the hook modifier). These hooks are defined as empty-objects, one for every point in the lattice that should be animated. And the empty-objects are animated by an Armature. With this setup, how can I get the position of a specific lattice point at a specific frame in python?
So far I have found that I’m able to get the target object of a hook modifier through "lattice.modifiers[n].object". Within the object I have also seen that the local and world matrices update with the animation. However I’m not sure how I would know which empty object affects which lattice point. I suppose the empty object’s position and the lattice point are supposed to be at the exact same position, but is that a guarantee? I have been trying to multiply a hook’s local position with its world matrix, but it doesn’t seem match the position I get when de-parenting it from the armature (which it should right?). I have seen that you are able to use "Assign" to assign the hook modifier to specific vertices in Edit Mode, but I don't know how to get this information.
Any comment that can get me in the right direction is greatly appreciated!
Thanks
When trying to apply modifiers to the lattice I get the error message: "cannot apply modifier for this object type".
Unfortunately bmesh does not seem to work with lattices and I don't know of any other addons that does anything similar.
I would like to make it work as it currently is, but creating vertex groups might be a way. All hook modifiers have a strength of 1. I will look into this further.
I am currently looking further into getting the animated position of an empty.
– NiklasN Jun 13 '18 at 14:16