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:
authorBastien Montagne <montagne29@wanadoo.fr>2013-05-12 19:52:05 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2013-05-12 19:52:05 +0400
commitbbd533d4acc9ddd9942a338a59888fcbb1a73aa4 (patch)
treef759976c68225c1a4ba9738bd80fc72ca82d1733 /source/blender/editors/transform/transform_ops.c
parent128a1c185619e5e5722f963a8eb304beeead9af4 (diff)
Fix for [#35238] Blender does not save custom orientations from "view"
Actually more a feature request... Now create orientations operator has an additional option, use_view, when this one is enabled it will use current view instead of active object to create the new space. Also made some cleanup (made some funcs static).
Diffstat (limited to 'source/blender/editors/transform/transform_ops.c')
-rw-r--r--source/blender/editors/transform/transform_ops.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c
index 4f46e969c3c..e2668416cfc 100644
--- a/source/blender/editors/transform/transform_ops.c
+++ b/source/blender/editors/transform/transform_ops.c
@@ -252,7 +252,8 @@ static int create_orientation_exec(bContext *C, wmOperator *op)
char name[MAX_NAME];
int use = RNA_boolean_get(op->ptr, "use");
int overwrite = RNA_boolean_get(op->ptr, "overwrite");
-
+ int use_view = RNA_boolean_get(op->ptr, "use_view");
+
RNA_string_get(op->ptr, "name", name);
if (use && !CTX_wm_view3d(C)) {
@@ -260,7 +261,7 @@ static int create_orientation_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
- BIF_createTransformOrientation(C, op->reports, name, use, overwrite);
+ BIF_createTransformOrientation(C, op->reports, name, use_view, use, overwrite);
WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, CTX_wm_view3d(C));
WM_event_add_notifier(C, NC_SCENE | NA_EDITED, CTX_data_scene(C));
@@ -268,11 +269,6 @@ static int create_orientation_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
-static int create_orientation_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
-{
- return create_orientation_exec(C, op);
-}
-
static void TRANSFORM_OT_create_orientation(struct wmOperatorType *ot)
{
/* identifiers */
@@ -282,14 +278,15 @@ static void TRANSFORM_OT_create_orientation(struct wmOperatorType *ot)
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* api callbacks */
- ot->invoke = create_orientation_invoke;
ot->exec = create_orientation_exec;
ot->poll = ED_operator_areaactive;
- ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
- RNA_def_string(ot->srna, "name", "", MAX_NAME, "Name", "Text to insert at the cursor position");
- RNA_def_boolean(ot->srna, "use", 0, "Use after creation", "Select orientation after its creation");
- RNA_def_boolean(ot->srna, "overwrite", 0, "Overwrite previous", "Overwrite previously created orientation with same name");
+ RNA_def_string(ot->srna, "name", "", MAX_NAME, "Name", "Name of the new custom orientation");
+ RNA_def_boolean(ot->srna, "use_view", FALSE, "Use View",
+ "Use the current view instead of the active object to create the new orientation");
+ RNA_def_boolean(ot->srna, "use", FALSE, "Use after creation", "Select orientation after its creation");
+ RNA_def_boolean(ot->srna, "overwrite", FALSE, "Overwrite previous",
+ "Overwrite previously created orientation with same name");
}
static void transformops_exit(bContext *C, wmOperator *op)