Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-02-18 19:05:01 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-02-18 19:05:01 +0300
commitf4b3d2dc9c4da8e6ef86ae426ed225e74dd0b52e (patch)
tree83ca8937138b5943fbe576a678b45df720a627c8 /source/blender
parentb896a007ea2475e0b81985d996c75e1204d70137 (diff)
constraints were being checked twice (once from rna property update function and once from the constraint panel callback)
comment the update call in the panel function. also avoid one bone lookup which was taking a fair bit of CPU when profiling.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/editors/interface/interface_templates.c14
-rw-r--r--source/blender/editors/object/object_constraint.c11
2 files changed, 11 insertions, 14 deletions
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 6de11e9486e..4c818f9d0ac 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -886,7 +886,6 @@ uiLayout *uiTemplateModifier(uiLayout *layout, bContext *C, PointerRNA *ptr, int
#define REDRAWACTION 4
#define B_CONSTRAINT_TEST 5
#define B_CONSTRAINT_CHANGETARGET 6
-#define B_CONSTRAINT_INF 7
#define REMAKEIPO 8
#define B_DIFF 9
@@ -901,11 +900,6 @@ void do_constraint_panels(bContext *C, void *arg, int event)
// XXX allqueue(REDRAWBUTSOBJECT, 0);
// XXX allqueue(REDRAWBUTSEDIT, 0);
break; // no handling
- case B_CONSTRAINT_INF:
- /* influence; do not execute actions for 1 dag_flush */
- if (ob->pose)
- ob->pose->flag |= (POSE_LOCKED|POSE_DO_UNLOCK);
- break;
case B_CONSTRAINT_CHANGETARGET:
if (ob->pose) ob->pose->flag |= POSE_RECALC; // checks & sorts pose channels
DAG_scene_sort(scene);
@@ -914,9 +908,11 @@ void do_constraint_panels(bContext *C, void *arg, int event)
break;
}
- object_test_constraints(ob);
-
- if(ob->pose) update_pose_constraint_flags(ob->pose);
+ // note: RNA updates now call this, commenting else it gets called twice.
+ // if there are problems because of this, then rna needs changed update functions.
+ //
+ // object_test_constraints(ob);
+ // if(ob->pose) update_pose_constraint_flags(ob->pose);
if(ob->type==OB_ARMATURE) DAG_id_flush_update(&ob->id, OB_RECALC_DATA|OB_RECALC_OB);
else DAG_id_flush_update(&ob->id, OB_RECALC_OB);
diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c
index d2451f042ad..a64e21d26ae 100644
--- a/source/blender/editors/object/object_constraint.c
+++ b/source/blender/editors/object/object_constraint.c
@@ -250,9 +250,10 @@ static void set_constraint_nth_target (bConstraint *con, Object *target, char su
/* ------------- Constraint Sanity Testing ------------------- */
/* checks validity of object pointers, and NULLs,
- * if Bone doesnt exist it sets the CONSTRAINT_DISABLE flag
+ * if Bone doesnt exist it sets the CONSTRAINT_DISABLE flag.
+ * 'data' saves a bone name lookup.
*/
-static void test_constraints (Object *owner, const char substring[])
+static void test_constraints (Object *owner, const char substring[], void *data)
{
bConstraint *curcon;
ListBase *conlist= NULL;
@@ -284,7 +285,7 @@ static void test_constraints (Object *owner, const char substring[])
Bone *bone;
bPoseChannel *chan;
- bone = get_named_bone( ((bArmature *)owner->data), substring );
+ bone = data ? data : get_named_bone( ((bArmature *)owner->data), substring );
chan = get_pose_channel(owner->pose, substring);
if (bone && chan) {
conlist = &chan->constraints;
@@ -436,14 +437,14 @@ static void test_bonelist_constraints (Object *owner, ListBase *list)
Bone *bone;
for (bone = list->first; bone; bone = bone->next) {
- test_constraints(owner, bone->name);
+ test_constraints(owner, bone->name, (void *)bone);
test_bonelist_constraints(owner, &bone->childbase);
}
}
void object_test_constraints (Object *owner)
{
- test_constraints(owner, "");
+ test_constraints(owner, "", NULL);
if (owner->type==OB_ARMATURE) {
bArmature *arm= get_armature(owner);