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>2012-05-06 08:18:13 +0400
committerJoshua Leung <aligorith@gmail.com>2012-05-06 08:18:13 +0400
commit5d02292d3cbdc1eb8657a2e186de7ac38bc226b7 (patch)
tree0d64116b2012d56ec40412c666bd6dceb5b145c8 /source/blender/editors/armature
parent7c58e6a9f2ac2d1022fba5c8df030e5df226583b (diff)
Bugfixes for Motion Path drawing/updating in light of the recent changes:
* Added proper "update" operators in place of the abuse of the calculate operators, so now the display ranges won't get overwritten everytime (with the default values) you go to update the paths. * Display range settings in properties editor now actually work. Before, the "In Range" mode only displayed the entire paths.
Diffstat (limited to 'source/blender/editors/armature')
-rw-r--r--source/blender/editors/armature/armature_intern.h1
-rw-r--r--source/blender/editors/armature/armature_ops.c1
-rw-r--r--source/blender/editors/armature/poseobject.c36
3 files changed, 38 insertions, 0 deletions
diff --git a/source/blender/editors/armature/armature_intern.h b/source/blender/editors/armature/armature_intern.h
index 72d261ec187..11129f34f3e 100644
--- a/source/blender/editors/armature/armature_intern.h
+++ b/source/blender/editors/armature/armature_intern.h
@@ -117,6 +117,7 @@ void POSE_OT_group_select(struct wmOperatorType *ot);
void POSE_OT_group_deselect(struct wmOperatorType *ot);
void POSE_OT_paths_calculate(struct wmOperatorType *ot);
+void POSE_OT_paths_update(struct wmOperatorType *ot);
void POSE_OT_paths_clear(struct wmOperatorType *ot);
void POSE_OT_autoside_names(struct wmOperatorType *ot);
diff --git a/source/blender/editors/armature/armature_ops.c b/source/blender/editors/armature/armature_ops.c
index 9a15a100179..d7814e1eb4c 100644
--- a/source/blender/editors/armature/armature_ops.c
+++ b/source/blender/editors/armature/armature_ops.c
@@ -133,6 +133,7 @@ void ED_operatortypes_armature(void)
WM_operatortype_append(POSE_OT_group_deselect);
WM_operatortype_append(POSE_OT_paths_calculate);
+ WM_operatortype_append(POSE_OT_paths_update);
WM_operatortype_append(POSE_OT_paths_clear);
WM_operatortype_append(POSE_OT_autoside_names);
diff --git a/source/blender/editors/armature/poseobject.c b/source/blender/editors/armature/poseobject.c
index 15d2d32c073..2ed5421e8ba 100644
--- a/source/blender/editors/armature/poseobject.c
+++ b/source/blender/editors/armature/poseobject.c
@@ -197,6 +197,7 @@ void ED_pose_recalculate_paths(Scene *scene, Object *ob)
BLI_freelistN(&targets);
}
+
/* show popup to determine settings */
static int pose_calculate_paths_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{
@@ -291,6 +292,41 @@ void POSE_OT_paths_calculate(wmOperatorType *ot)
/* --------- */
+static int pose_update_paths_exec(bContext *C, wmOperator *UNUSED(op))
+{
+ Object *ob = BKE_object_pose_armature_get(CTX_data_active_object(C));
+ Scene *scene = CTX_data_scene(C);
+
+ if (ELEM(NULL, ob, scene))
+ return OPERATOR_CANCELLED;
+
+ /* calculate the bones that now have motionpaths... */
+ // TODO: only make for the selected bones?
+ ED_pose_recalculate_paths(scene, ob);
+
+ /* notifiers for updates */
+ WM_event_add_notifier(C, NC_OBJECT | ND_POSE, ob);
+
+ return OPERATOR_FINISHED;
+}
+
+void POSE_OT_paths_update(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name = "Update Bone Paths";
+ ot->idname = "POSE_OT_paths_update";
+ ot->description = "Recalculate paths for bones that already have them";
+
+ /* api callbakcs */
+ ot->exec = pose_update_paths_exec;
+ ot->poll = ED_operator_posemode; /* TODO: this should probably check for active bone and/or existing paths */
+
+ /* flags */
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+}
+
+/* --------- */
+
/* for the object with pose/action: clear path curves for selected bones only */
static void ED_pose_clear_paths(Object *ob)
{