diff options
author | Joshua Leung <aligorith@gmail.com> | 2009-07-11 07:23:45 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2009-07-11 07:23:45 +0400 |
commit | 576a642ff9b5ca5094f5bb84ada3c5639ae01a92 (patch) | |
tree | 950a5f5ce861a8fa04fb2727e0e65a464ccbab9c /source/blender/editors/transform/transform_orientations.c | |
parent | 1105ee701ed20d6301a174fc4285de00f8e0f95e (diff) | |
parent | b80b581bc03b6df28bd3a10118d85b78d5ca011b (diff) |
NLA SoC: Merge from 2.5 soc-2009-aligorith
21470 to 21512
Next up, NLA-branch to 2.5 :)
Diffstat (limited to 'source/blender/editors/transform/transform_orientations.c')
-rw-r--r-- | source/blender/editors/transform/transform_orientations.c | 38 |
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) { |