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:
Diffstat (limited to 'source/blender/editors/transform/transform_orientations.c')
-rw-r--r--source/blender/editors/transform/transform_orientations.c38
1 files changed, 29 insertions, 9 deletions
diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c
index 1e065de94e1..f3b373f0e48 100644
--- a/source/blender/editors/transform/transform_orientations.c
+++ b/source/blender/editors/transform/transform_orientations.c
@@ -59,6 +59,8 @@
#include "UI_interface.h"
+#include "RNA_define.h"
+
#include "transform.h"
/* *********************** TransSpace ************************** */
@@ -354,19 +356,37 @@ void BIF_selectTransformOrientationValue(bContext *C, int orientation) {
v3d->twmode = orientation;
}
-void BIF_menuTransformOrientation(bContext *C, uiLayout *layout, void *arg)
+EnumPropertyItem *BIF_enumTransformOrientation(bContext *C)
{
ListBase *transform_spaces = &CTX_data_scene(C)->transform_spaces;
- TransformOrientation *ts;
- int i= V3D_MANIP_CUSTOM;
+ TransformOrientation *ts = transform_spaces->first;
+ EnumPropertyItem global = {V3D_MANIP_GLOBAL, "GLOBAL", 0, "Global", ""};
+ EnumPropertyItem normal = {V3D_MANIP_NORMAL, "NORMAL", 0, "Normal", ""};
+ EnumPropertyItem local = {V3D_MANIP_LOCAL, "LOCAL", 0, "Local", ""};
+ EnumPropertyItem view = {V3D_MANIP_VIEW, "VIEW", 0, "View", ""};
+ EnumPropertyItem sepr = {0, "", 0, NULL, NULL};
+ EnumPropertyItem tmp = {0, "", 0, "", ""};
+ EnumPropertyItem *item= NULL;
+ int i = V3D_MANIP_CUSTOM, totitem= 0;
+
+ RNA_enum_item_add(&item, &totitem, &global);
+ RNA_enum_item_add(&item, &totitem, &normal);
+ RNA_enum_item_add(&item, &totitem, &local);
+ RNA_enum_item_add(&item, &totitem, &view);
+
+ if(ts)
+ RNA_enum_item_add(&item, &totitem, &sepr);
+
+ for(; ts; ts = ts->next) {
+ tmp.identifier = "CUSTOM";
+ tmp.name= ts->name;
+ tmp.value = i++;
+ RNA_enum_item_add(&item, &totitem, &tmp);
+ }
- uiItemEnumO(layout, NULL, 0, "TFM_OT_select_orientation", "orientation", V3D_MANIP_GLOBAL);
- uiItemEnumO(layout, NULL, 0, "TFM_OT_select_orientation", "orientation", V3D_MANIP_LOCAL);
- uiItemEnumO(layout, NULL, 0, "TFM_OT_select_orientation", "orientation", V3D_MANIP_NORMAL);
- uiItemEnumO(layout, NULL, 0, "TFM_OT_select_orientation", "orientation", V3D_MANIP_VIEW);
+ RNA_enum_item_end(&item, &totitem);
- for(ts = transform_spaces->first; ts; ts = ts->next)
- uiItemIntO(layout, ts->name, 0, "TFM_OT_select_orientation", "custom_index", i++);
+ return item;
}
char * BIF_menustringTransformOrientation(const bContext *C, char *title) {