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);
#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"
}
}
+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;
#include "BKE_global.h"
#include "BKE_main.h"
#include "BKE_anim.h"
+#include "BKE_constraint.h"
#include "BKE_library.h"
do_all_keys();
#ifdef __NLA
do_all_actions();
+ rebuild_all_armature_displists();
#endif
do_all_ikas();
do_all_keys();
#ifdef __NLA
do_all_actions();
+ rebuild_all_armature_displists();
#endif
do_all_ikas();
test_all_displists();
clear_object_constraint_status(base->object);
if (base->object->type==OB_ARMATURE) {
where_is_armature (base->object);
- make_displists_by_armature(base->object);
}
else
bPoseChannel *chan;
bArmature *arm;
Bone *bone;
- Base *base;
arm = get_armature(OBACT);
if (!arm) return;
set_pose_channel (G.obpose->pose, chan);
- for (base = G.scene->base.first; base; base=base->next){
- clear_object_constraint_status(base->object);
- make_displists_by_armature(base->object);
- }
+ rebuild_all_armature_displists();
allqueue(REDRAWVIEW3D, 1);
}
* or else armatures/poses/displists get recalculated all of the
* time
*/
- /* Clear the constraint "done" flags */
- for (base = G.scene->base.first; base; base=base->next){
- clear_object_constraint_status(base->object);
- }
+ clear_all_constraints();
#endif
/* draw set first */
/* abuse! to make sure it doesnt draw the helpstuff */
G.f |= G_SIMULATION;
- /* 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);
- }
+ clear_all_constraints();
do_all_ipos();
BPY_do_all_scripts(SCRIPT_FRAMECHANGED);
do_all_keys();
G.f &= ~G_PICKSEL;
}
- for (base = G.scene->base.first; base; base=base->next){
- clear_object_constraint_status(base->object);
- }
+
+ clear_all_constraints();
+
/* first not selected and duplis */
base= G.scene->base.first;
while(base) {
set_timecursor(CFRA);
- /* 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);
- }
+ clear_all_constraints();
do_all_ipos();
BPY_do_all_scripts(SCRIPT_FRAMECHANGED);
do_all_keys();
if(event==SPACEKEY);
else CFRA= cfraont;
- /* 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);
- }
-
+ clear_all_constraints();
do_all_ipos();
do_all_keys();
do_all_actions();
}
}
-static void pose_flags_reset_done(Object *ob) {
+static int pose_flags_reset_done(Object *ob) {
/* Clear the constraint done status for every pose channe;
* that has been flagged as needing constant updating
*/
bPoseChannel *chan;
+ int numreset = 0;
if (ob->pose) {
for (chan = ob->pose->chanbase.first; chan; chan=chan->next){
if (chan->flag & PCHAN_TRANS_UPDATE) {
chan->flag &= ~PCHAN_DONE;
+ numreset++;
}
}
}
-
+ return numreset;
}
static int is_ob_constraint_target(Object *ob, ListBase *conlist) {
return do_update;
}
+void figure_pose_updating(void)
+{
+ Base *base;
+
+ flag_moving_objects();
+
+ for (base= FIRSTBASE; base; base= base->next) {
+ /* Recalculate the pose if necessary, regardless of
+ * whether the layer is visible or not.
+ */
+ if (pose_do_update_flag(base->object))
+ base->flag |= BA_WHERE_UPDATE;
+ }
+
+}
+
/*** POSE FIGURIN' -- END ***/
Base *base;
copy_baseflags();
- flag_moving_objects();
-
for (base= FIRSTBASE; base; base= base->next) {
base->flag &= ~(BA_PARSEL+BA_WASSEL);
- /* Recalculate the pose if necessary, regardless of
- * whether the layer is visible or not.
- */
- if (pose_do_update_flag(base->object))
- base->flag |= BA_WHERE_UPDATE;
-
if( (base->lay & G.vd->lay) && base->object->id.lib==0) {
Object *ob= base->object;
Object *parsel= is_a_parent_selected(ob);
base->object->partype |= PARSLOW;
}
else if(base->flag & BA_WHERE_UPDATE) {
- /* deal with the armature case */
- pose_flags_reset_done(base->object);
- make_displists_by_armature(base->object);
-
where_is_object(base->object);
if(base->object->type==OB_IKA) {
itterate_ika(base->object);
}
+ base= FIRSTBASE;
+ while(base) {
+ if (pose_flags_reset_done(base->object)) {
+ if (!is_delay_deform())
+ make_displists_by_armature(base->object);
+ }
+
+ base= base->next;
+ }
+
#if 1
if (G.obpose && G.obpose->type == OB_ARMATURE)
clear_pose_constraint_status(G.obpose);
case OB_ARMATURE:
/* figure out which bones need calculating */
figure_bone_nocalc(G.obpose);
+ figure_pose_updating();
make_trans_bones(mode);
break;
}
else if (mode=='s' || mode=='S') opt= 's';
setbaseflags_for_editing(opt);
-
+ figure_pose_updating();
make_trans_objects();
}
allqueue(REDRAWBUTSSHADING, 0);
allqueue(REDRAWBUTSOBJECT, 0);
- /* 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);
- }
-
+ clear_all_constraints();
/* layers/materials, object ipos are calculted in where_is_object (too) */
do_all_ipos();
BPY_do_all_scripts(SCRIPT_FRAMECHANGED);