GetFullTransform appears to work perfectly for normal layer hierarchies. It also works great when the document is supplied as the last argument, factoring in the camera's effects on the layer.
Unfortunately it looks like I'm missing the effects of bones. The script reference says GetFullTransform includes the effects of parent layers. I assume this means bone layers too.
Outside of the complex combination of scripts and animation I'm doing, I set up a simple comparison to test how bones interact with the layer transform. The only difference was adding a trivial bone animation as a parent to the layer. Case 1: without the bones: I get the expected transform. Case 2: with the bones I get the same transform as before, rather than the bone modified one that I'm looking for. Non-bones animation works fine; given a frame I get the transform I expect with animated effects of all parents.
My first explanation was that the bones are not getting updated. I tried calls to SetCurFrame and UpdateCurFrame before calling GetFullTransform but it didn't change the result. I explored the bones related classes and nothing looks appropriate. I'm not sure if the bones do need to be updated or if there is some other way to get them to factor into the layers' transforms. I've got to be missing something simple. All help is greatly appreciated!!
GetFullTransform() interaction with bones
Moderators: Víctor Paredes, Belgarath, slowtiger
This is off the top of my head, but if you have a layer that is attached to a bone, and use the LayerParentBone() function to find bone it's attached to, perhaps you could use the fMovedMatrix variable to get that specific bones transformation matrix. Add that matrix to the full transform matrix, and that might get you where you need to be.
Like I said, that's my first thought, and where I'd start. Seems sensible, but who knows. It does seem that a variation on GetFullTransform that included the bone transformations would be handy. I also don't know if the bone transformation matrix is only rotations and translations or includes scaling.
Hope that's at least a useful starting point. I haven't had a chance to do any Moho work at all for a while, so I'm just throwing it out there.
Like I said, that's my first thought, and where I'd start. Seems sensible, but who knows. It does seem that a variation on GetFullTransform that included the bone transformations would be handy. I also don't know if the bone transformation matrix is only rotations and translations or includes scaling.
Hope that's at least a useful starting point. I haven't had a chance to do any Moho work at all for a while, so I'm just throwing it out there.
- Lost Marble
- Site Admin
- Posts: 2356
- Joined: Tue Aug 03, 2004 6:02 pm
- Location: Scotts Valley, California, USA
- Contact:
The effect of a parent bone layer should be included in GetFullTransform(). Are you sure that the child layer has been bound to a bone, as opposed to some (or all) of the points in the child layer being bound to the bone?
If the layer itself is not bound to a bone (or flexi-bound to all bones), then bone movement is not (and should not be) part of GetFullTransform().
If the layer itself is not bound to a bone (or flexi-bound to all bones), then bone movement is not (and should not be) part of GetFullTransform().