diff options
author | Chris Want <cwant@ualberta.ca> | 2004-01-27 09:08:37 +0300 |
---|---|---|
committer | Chris Want <cwant@ualberta.ca> | 2004-01-27 09:08:37 +0300 |
commit | e8aaea0b63c19c3defbf9fe48612a387ab05de9f (patch) | |
tree | f91729f1edf5383e5194e95aeb8c7774307f45bd /source/blender/blenkernel | |
parent | c225bf124045ee0575eac60d1ff3f01730141127 (diff) |
Armature related fixes and cleanups:
* Armatures that had constraint targets inside other armatures
weren't transform()-ing correctly
* Issues with lattice deformed objects that are parents of bones
when rendering an animation. Seems to be mostly OK now with the
exception of the first rendered frame -- weird bugs like this have
plagued blender for ages, which leads me to believe that
RE_rotateBlenderScene() is a piece of garbage that nobody understands
(especially me).
* made a few helper functions to clean up some repeated code related
to clearing constraint status and rebuilding displists.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_constraint.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/constraint.c | 22 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/scene.c | 2 |
3 files changed, 26 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_constraint.h b/source/blender/blenkernel/BKE_constraint.h index 6570f547e48..273b9d2a0a5 100644 --- a/source/blender/blenkernel/BKE_constraint.h +++ b/source/blender/blenkernel/BKE_constraint.h @@ -51,6 +51,8 @@ struct bConstraintChannel *clone_constraint_channels (struct ListBase *dst, stru void relink_constraints (struct ListBase *list); void free_constraint_data (struct bConstraint *con); void clear_object_constraint_status (struct Object *ob); +void clear_all_constraints(void); +void rebuild_all_armature_displists(void); void do_constraint_channels (struct ListBase *conbase, struct ListBase *chanbase, float ctime); short get_constraint_target (struct bConstraint *con, short ownertype, void *ownerdata, float mat[][4], float size[3], float time); struct bConstraintChannel *find_constraint_channel (ListBase *list, const char *name); diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index a37980b041d..053034d9620 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -45,6 +45,7 @@ #include "DNA_object_types.h" #include "DNA_action_types.h" #include "DNA_curve_types.h" +#include "DNA_scene_types.h" #include "BKE_utildefines.h" #include "BKE_action.h" @@ -407,6 +408,27 @@ void clear_object_constraint_status (Object *ob) } } +void clear_all_constraints(void) +{ + Base *base; + + /* Clear the constraint "done" flags -- this must be done + * before displists are calculated for objects that are + * deformed by armatures */ + for (base = G.scene->base.first; base; base=base->next){ + clear_object_constraint_status(base->object); + } +} + +void rebuild_all_armature_displists(void) { + Base *base; + + for (base = G.scene->base.first; base; base=base->next){ + clear_object_constraint_status(base->object); + make_displists_by_armature(base->object); + } +} + short get_constraint_target (bConstraint *con, short ownertype, void* ownerdata, float mat[][4], float size[3], float ctime) { short valid=0; diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 7f47042be76..3dd9ad2180c 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -75,6 +75,7 @@ #include "BKE_global.h" #include "BKE_main.h" #include "BKE_anim.h" +#include "BKE_constraint.h" #include "BKE_library.h" @@ -407,6 +408,7 @@ void set_scene_bg(Scene *sce) do_all_keys(); #ifdef __NLA do_all_actions(); + rebuild_all_armature_displists(); #endif do_all_ikas(); |