diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-09-16 05:15:30 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-09-16 05:15:30 +0400 |
commit | 51f1e822900fbae5b239ddfcfd488eccbbbcc31b (patch) | |
tree | f997d60918f40fbaf4f7bf7353de6555c122d9c6 /source/blender/editors/interface/interface_utils.c | |
parent | be613fd9ddf02aca2d619b6aaa615fff5a02661b (diff) |
Object mode Selection options brought back for view3d.select
- 'center', while Ctrl is held select objects from their center location
- 'enumerate', while Alt is held, give a list of objects under the mouse
- Object selection menu now uses icons with names
- operator object.select_name(name, extend=False)
- keybindings so combinations of Ctrl/Alt/Shift can be used (like in 2.4x)
- logic text input field was using deprecated ID_SCRIPT rather then ID_TXT
details
- added comments to DNA_ID.h ID types
- removed unused ID types Sector and Life
- added uiIconFromID() to get an icon from the object.
- using name for selection is weak but currently there isnt a really good way to do this.
Diffstat (limited to 'source/blender/editors/interface/interface_utils.c')
-rw-r--r-- | source/blender/editors/interface/interface_utils.c | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface_utils.c b/source/blender/editors/interface/interface_utils.c index 63f81c9e46c..539c71cc497 100644 --- a/source/blender/editors/interface/interface_utils.c +++ b/source/blender/editors/interface/interface_utils.c @@ -33,6 +33,7 @@ #include "DNA_color_types.h" #include "DNA_listBase.h" #include "DNA_material_types.h" +#include "DNA_lamp_types.h"" #include "DNA_object_types.h" #include "DNA_screen_types.h" #include "DNA_texture_types.h" @@ -509,6 +510,64 @@ int uiDefIDPoinButs(uiBlock *block, Main *bmain, ID *parid, ID *id, int id_code, return x; } +/* currently only object-data types */ +int uiIconFromID(ID *id) +{ + if (id==NULL) + return 0; + + switch(GS(id->name)) { + case ID_OB: + { + Object *ob= (Object *)id; + + switch(ob->type) { + case OB_EMPTY: + return ICON_EMPTY_DATA; + case OB_CURVE: + return ICON_CURVE_DATA; + case OB_SURF: + return ICON_SURFACE_DATA; + case OB_FONT: + return ICON_FONT_DATA; + } + + return uiIconFromID(ob->data); + } + case ID_ME: + return ICON_MESH_DATA; + case ID_AR: + return ICON_ARMATURE_DATA; + case ID_MB: + return ICON_META_DATA; + case ID_CA: + return ICON_CAMERA_DATA; + case ID_LT: + return ICON_LATTICE_DATA; + case ID_CU: + return ICON_CURVE_DATA; + case ID_LA: + { + Lamp *la= (Lamp *)id; + switch(la->type) { + case LA_LOCAL: + return ICON_LAMP_POINT; + case LA_SUN: + return ICON_LAMP_SUN; + case LA_SPOT: + return ICON_LAMP_SPOT; + case LA_HEMI: + return ICON_LAMP_HEMI; + case LA_AREA: + return ICON_LAMP_AREA; + } + return ICON_LAMP_DATA; + } + } + + return 0; +} + /* ****************************** default button callbacks ******************* */ /* ************ LEGACY WARNING, only to get things work with 2.48 code! ****** */ |