diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-02-18 19:05:01 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-02-18 19:05:01 +0300 |
commit | f4b3d2dc9c4da8e6ef86ae426ed225e74dd0b52e (patch) | |
tree | 83ca8937138b5943fbe576a678b45df720a627c8 /source/blender/editors/object/object_constraint.c | |
parent | b896a007ea2475e0b81985d996c75e1204d70137 (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/editors/object/object_constraint.c')
-rw-r--r-- | source/blender/editors/object/object_constraint.c | 11 |
1 files changed, 6 insertions, 5 deletions
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); |