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/object/object_edit.c
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/object/object_edit.c')
-rw-r--r--source/blender/editors/object/object_edit.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c
index dfc99f09a96..96099d51dc9 100644
--- a/source/blender/editors/object/object_edit.c
+++ b/source/blender/editors/object/object_edit.c
@@ -1125,6 +1125,7 @@ void ED_objects_recalculate_paths(bContext *C, Scene *scene)
BLI_freelistN(&targets);
}
+
/* show popup to determine settings */
static int object_calculate_paths_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{
@@ -1200,6 +1201,39 @@ void OBJECT_OT_paths_calculate(wmOperatorType *ot)
/* --------- */
+static int object_update_paths_exec(bContext *C, wmOperator *UNUSED(op))
+{
+ Scene *scene = CTX_data_scene(C);
+
+ if (scene == NULL)
+ return OPERATOR_CANCELLED;
+
+ /* calculate the paths for objects that have them (and are tagged to get refreshed) */
+ ED_objects_recalculate_paths(C, scene);
+
+ /* notifiers for updates */
+ WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, NULL);
+
+ return OPERATOR_FINISHED;
+}
+
+void OBJECT_OT_paths_update(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name = "Update Object Paths";
+ ot->idname = "OBJECT_OT_paths_update";
+ ot->description = "Recalculate paths for selected objects";
+
+ /* api callbakcs */
+ ot->exec = object_update_paths_exec;
+ ot->poll = ED_operator_object_active_editable; /* TODO: this should probably check for existing paths */
+
+ /* flags */
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+}
+
+/* --------- */
+
/* Clear motion paths for selected objects only */
void ED_objects_clear_paths(bContext *C)
{