diff options
author | Joshua Leung <aligorith@gmail.com> | 2007-10-22 06:43:07 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2007-10-22 06:43:07 +0400 |
commit | f721ce13fb529f4fde4668c989c786e4c7d7d708 (patch) | |
tree | 35f60ad960f65c20c53b126f2192a7f1f49523a9 /source/blender/blenkernel/intern/action.c | |
parent | 6422a740c25d33c7e7dcc008d215ae983be00a30 (diff) |
== Action Constraint ==
Now the Action Constraint can be applied to Objects as well as Bones!
Diffstat (limited to 'source/blender/blenkernel/intern/action.c')
-rw-r--r-- | source/blender/blenkernel/intern/action.c | 42 |
1 files changed, 40 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c index 22e621a27e2..b04e0240873 100644 --- a/source/blender/blenkernel/intern/action.c +++ b/source/blender/blenkernel/intern/action.c @@ -1061,6 +1061,46 @@ static Object *get_parent_path(Object *ob) /* ************** do the action ************ */ +/* For the calculation of the effects of an action at the given frame on an object + * This is currently only used for the action constraint + */ +void what_does_obaction (Object *ob, bAction *act, float cframe) +{ + ListBase tchanbase= {NULL, NULL}; + + clear_workob(); + Mat4CpyMat4(workob.obmat, ob->obmat); + Mat4CpyMat4(workob.parentinv, ob->parentinv); + Mat4CpyMat4(workob.constinv, ob->constinv); + workob.parent= ob->parent; + workob.track= ob->track; + + workob.trackflag= ob->trackflag; + workob.upflag= ob->upflag; + + workob.partype= ob->partype; + workob.par1= ob->par1; + workob.par2= ob->par2; + workob.par3= ob->par3; + + workob.constraints.first = ob->constraints.first; + workob.constraints.last = ob->constraints.last; + + strcpy(workob.parsubstr, ob->parsubstr); + + /* extract_ipochannels_from_action needs id's! */ + workob.action= act; + + extract_ipochannels_from_action(&tchanbase, &ob->id, act, "Object", bsystem_time(&workob, cframe, 0.0)); + + if (tchanbase.first) { + execute_ipochannels(&tchanbase); + BLI_freelistN(&tchanbase); + } +} + +/* ----- nla, etc. --------- */ + static void do_nla(Object *ob, int blocktype) { bPose *tpose= NULL; @@ -1331,5 +1371,3 @@ void do_all_object_actions(Object *ob) do_nla(ob, ID_OB); } } - - |