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:
authorJoshua Leung <aligorith@gmail.com>2009-09-20 15:21:44 +0400
committerJoshua Leung <aligorith@gmail.com>2009-09-20 15:21:44 +0400
commitad25fc829e736be4bbf2e2a125347eda294fdac9 (patch)
tree40f148482c2248c613f1302dcf00201a4795ce94 /source/blender/editors/object/object_constraint.c
parent2c871f722d3cbc80c9f076d7c23137e19633ba3a (diff)
2.5 - More animation/rigging bugfixes
* #19419: PoseLib rename/remove tools could crash when an invalid (However, now care is needed when touching that index field, since the warnings can keep piling up) * Added Browse Poses for PoseLib to the toolbar * Removing constraints from bones now properly updates. A DAG rebuild is now forced, and the constraint flags are cleared. * Attempting to improve the situation with Copy Rotation constraint and rotation orders other than xyz. Unforunately, it looks like a different method is required...
Diffstat (limited to 'source/blender/editors/object/object_constraint.c')
-rw-r--r--source/blender/editors/object/object_constraint.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c
index 9b073ed5878..eee6659c6b2 100644
--- a/source/blender/editors/object/object_constraint.c
+++ b/source/blender/editors/object/object_constraint.c
@@ -823,17 +823,22 @@ void CONSTRAINT_OT_move_up (wmOperatorType *ot)
static int pose_constraints_clear_exec(bContext *C, wmOperator *op)
{
Object *ob= CTX_data_active_object(C);
+ Scene *scene= CTX_data_scene(C);
/* free constraints for all selected bones */
CTX_DATA_BEGIN(C, bPoseChannel*, pchan, selected_pchans)
{
free_constraints(&pchan->constraints);
+ pchan->constflag &= ~(PCHAN_HAS_IK|PCHAN_HAS_CONST);
}
CTX_DATA_END;
+ /* force depsgraph to get recalculated since relationships removed */
+ DAG_scene_sort(scene); /* sort order of objects */
+
/* do updates */
- DAG_id_flush_update(&ob->id, OB_RECALC_OB);
- WM_event_add_notifier(C, NC_OBJECT|ND_POSE|ND_CONSTRAINT|NA_REMOVED, ob);
+ DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
+ WM_event_add_notifier(C, NC_OBJECT|ND_CONSTRAINT, ob);
return OPERATOR_FINISHED;
}
@@ -854,14 +859,18 @@ void POSE_OT_constraints_clear(wmOperatorType *ot)
static int object_constraints_clear_exec(bContext *C, wmOperator *op)
{
Object *ob= CTX_data_active_object(C);
+ Scene *scene= CTX_data_scene(C);
/* do freeing */
// TODO: we should free constraints for all selected objects instead (to be more consistent with bones)
free_constraints(&ob->constraints);
+ /* force depsgraph to get recalculated since relationships removed */
+ DAG_scene_sort(scene); /* sort order of objects */
+
/* do updates */
DAG_id_flush_update(&ob->id, OB_RECALC_OB);
- WM_event_add_notifier(C, NC_OBJECT|ND_CONSTRAINT|NA_REMOVED, ob);
+ WM_event_add_notifier(C, NC_OBJECT|ND_CONSTRAINT, ob);
return OPERATOR_FINISHED;
}