diff options
author | Ton Roosendaal <ton@blender.org> | 2010-12-23 16:16:56 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2010-12-23 16:16:56 +0300 |
commit | f543fe1500740d1d8adc03d61a3506cf800e80fc (patch) | |
tree | dcfcb8ec316fe48df380bde38ebb3bb89ef5561c /source/blender | |
parent | 1ea491d6152614fff5200d86c8f9081e842f6c01 (diff) |
Bugfix #25341
Child-of constraint issue: on adding, it wasn't checking owner
correctly for Bones, resulting in a constraint working in wrong
space; it looked as if transform was applied double when moving
the object. Only adding via Py API went wrong btw.
Also found a silly check for drawing constraints, which caused
constraint initialization to happen for every object on every
redraw!
Implementation note: con->flag CONSTRAINT_SPACEONCE was only used
for child-of constraints in Bones, so I've patched it on file
reading to always set the flag. Marked with XXX, so it can be
removed one day. Now at least things get corrected well for
imported armatures.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/constraint.c | 1 | ||||
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 6 | ||||
-rw-r--r-- | source/blender/editors/armature/poseobject.c | 2 | ||||
-rw-r--r-- | source/blender/editors/object/object_constraint.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/drawobject.c | 5 |
5 files changed, 12 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index bb0fc23c02c..b0932533ea6 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -861,6 +861,7 @@ static void childof_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *ta } } +/* XXX note, con->flag should be CONSTRAINT_SPACEONCE for bone-childof, patched in readfile.c */ static bConstraintTypeInfo CTI_CHILDOF = { CONSTRAINT_TYPE_CHILDOF, /* type */ sizeof(bChildOfConstraint), /* size */ diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index e86daf0ce4b..b711d704d2d 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -2200,6 +2200,12 @@ static void direct_link_constraints(FileData *fd, ListBase *lb) con->lin_error = 0.f; con->rot_error = 0.f; } + case CONSTRAINT_TYPE_CHILDOF: + { + /* XXX version patch, in older code this flag wasn't always set, and is inherent to type */ + if(con->ownspace == CONSTRAINT_SPACE_POSE) + con->flag |= CONSTRAINT_SPACEONCE; + } break; } } diff --git a/source/blender/editors/armature/poseobject.c b/source/blender/editors/armature/poseobject.c index 2db9b435198..bea7155291b 100644 --- a/source/blender/editors/armature/poseobject.c +++ b/source/blender/editors/armature/poseobject.c @@ -1091,7 +1091,7 @@ void POSE_OT_paste (wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_boolean(ot->srna, "flipped", 0, "Flipped on X-Axis", ""); + RNA_def_boolean(ot->srna, "flipped", 0, "Flipped on X-Axis", "Paste the stored pose flipped on to current pose"); } /* ********************************************** */ diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c index f856ab7649c..5afba182cc0 100644 --- a/source/blender/editors/object/object_constraint.c +++ b/source/blender/editors/object/object_constraint.c @@ -1298,7 +1298,7 @@ static int constraint_add_exec(bContext *C, wmOperator *op, Object *ob, ListBase { /* if this constraint is being added to a posechannel, make sure * the constraint gets evaluated in pose-space */ - if (ob->mode & OB_MODE_POSE) { + if (pchan) { con->ownspace = CONSTRAINT_SPACE_POSE; con->flag |= CONSTRAINT_SPACEONCE; } diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index b6d0efa26c5..1f1acef02db 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -6293,12 +6293,13 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) } /* Drawing the constraint lines */ - list = &ob->constraints; - if (list) { + if (ob->constraints.first) { bConstraint *curcon; bConstraintOb *cob; unsigned char col1[4], col2[4]; + list = &ob->constraints; + UI_GetThemeColor3ubv(TH_GRID, col1); UI_make_axis_color(col1, col2, 'Z'); glColor3ubv(col2); |