[Bf-committers] Q about poses/channels + A from Ton + follow-up Q
ton at blender.org
Fri Nov 18 11:19:42 CET 2005
> Okay - here's my follow-up question. The pose I'm obtaining is
> extracted from an arbitrary action (act) at an arbitrary frame in that
> action (x), that do not necessarily correspond to the current action,
> the current frame, or even the currently selected object.
This is unclear to me, it would help if you can indicate how that
functionality fits in the current system we have. Actions for Poses now
only get applied with do_all_pose_actions(Object *). This call makes
sure the existing context gets evaluated correctly, it does active
actions only or the entire NLA.
With Toni I've looked at a nice Python API call to do "arbitrary"
actions. He now has a call like this (forgot the real naming);
Object.Pose.extract_from_action(Action, framenr, blendfactor)
Which - in c code - does the following;
- makes a copy of object->pose
- extracts from the indicated Action the pose on time 'framenr'
- calls blend_poses to blend this new pose with the current pose
- frees the copy
So; this might be exactly the call you're looking for? Maybe you prefer
to do this in python after all?
> I've just looked through the DAG code, and I think Ton is referring to
> submitting the object in question to DAG_pose_sort in depsgraph.c.
I don't think so. After you've changed a Pose, you have to tell the
scenegraph that this object's data was changed, and to flush it to all
DAG_object_flush_update(Scene *, Object *, OB_RECALC_DATA);
The rest will go automatically on redraws on render.
The pose_sort call is only needed when internal dependencies were
changed (constraints, IK).
I've really tried to be as complete as possible in the docs I wrote
about the new Armature/Pose/Action system and about depsgraph (in 2.40
release log). If there's anything unclear in these docs, I like to
know... because these docs were exactly to help developers to get into
coding, and I think it has the answers to your questions in it too! :)
> So here's the real question now: what conditions do I need to meet to
> make DAG_pose_sort work on the right info? I'm assuming I will have to
> set the object's active pose to the one I extracted, then call
> DAG_pose_sort, then copy out pose_mat (the matrix I need to check) for
> later reference. Of course, since I don't want this evaluation to be
> reflected in the armature on screen, I need to copy the pose
> information that's in the object before I set it to my extracted pose,
> so I can reset it after I'm done. Is it as simple as that, or is there
> some other kind of voodoo that needs to be involved?
> Roland Hess - harkyman
> Bf-committers mailing list
> Bf-committers at projects.blender.org
Ton Roosendaal Blender Foundation ton at blender.org
More information about the Bf-committers