2011-02-23 10:52:22 +00:00
|
|
|
/*
|
2009-02-04 11:52:16 +00:00
|
|
|
* ***** BEGIN GPL LICENSE BLOCK *****
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
2010-02-12 13:34:04 +00:00
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2009-02-04 11:52:16 +00:00
|
|
|
*
|
|
|
|
* The Original Code is Copyright (C) 2009 Blender Foundation.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s): Blender Foundation
|
|
|
|
*
|
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
|
|
|
*/
|
|
|
|
|
2011-02-27 20:29:51 +00:00
|
|
|
/** \file blender/editors/interface/interface_utils.c
|
|
|
|
* \ingroup edinterface
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2009-09-16 19:36:17 +00:00
|
|
|
#include <stdio.h>
|
2009-02-04 11:52:16 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
2010-12-15 05:42:23 +00:00
|
|
|
#include <assert.h>
|
2009-02-04 11:52:16 +00:00
|
|
|
|
2.5
Smaller jobs, all in one commit!
- Moved object_do_update out of view3d drawing, into
the event system (currently after notifiers).
Depsgraph calls for setting update flags will have to
keep track of each Screen's needs, so a UI showing only
a Sequencer doesn't do objects.
- Added button in "Properties region" in 3D window to set
or disable 4-split, including the 3 options it has.
(lock, box, clip)
- Restored legacy code for UI, to make things work like
bone rename, autocomplete.
- Node editor now shows Curves widgets again
- Bugfix: composite job increased Viewer user id count
- Bugfix: Node editor, not "Enable nodes" still called
a Job, which didn't do anything
- Various code cleaning, unused vars and prototypes.
2009-02-11 16:54:55 +00:00
|
|
|
#include "DNA_object_types.h"
|
2009-06-10 11:43:21 +00:00
|
|
|
|
2011-01-07 18:36:47 +00:00
|
|
|
#include "BLI_utildefines.h"
|
2011-09-26 16:53:04 +00:00
|
|
|
#include "BLI_string.h"
|
2011-01-07 18:36:47 +00:00
|
|
|
|
2011-09-20 07:39:25 +00:00
|
|
|
#include "BLF_translation.h"
|
2011-06-15 11:41:15 +00:00
|
|
|
|
2009-02-04 11:52:16 +00:00
|
|
|
#include "BKE_context.h"
|
2011-01-07 19:18:31 +00:00
|
|
|
|
2009-02-04 11:52:16 +00:00
|
|
|
|
|
|
|
#include "RNA_access.h"
|
|
|
|
|
|
|
|
#include "UI_interface.h"
|
|
|
|
#include "UI_resources.h"
|
|
|
|
|
2009-10-27 02:54:25 +00:00
|
|
|
|
2009-02-04 11:52:16 +00:00
|
|
|
/*************************** RNA Utilities ******************************/
|
|
|
|
|
2010-12-03 17:05:21 +00:00
|
|
|
uiBut *uiDefAutoButR(uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, int index, const char *name, int icon, int x1, int y1, int x2, int y2)
|
2009-02-04 11:52:16 +00:00
|
|
|
{
|
|
|
|
uiBut *but=NULL;
|
2009-11-18 14:00:23 +00:00
|
|
|
|
2009-04-19 13:37:59 +00:00
|
|
|
switch(RNA_property_type(prop)) {
|
2011-08-06 16:00:00 +00:00
|
|
|
case PROP_BOOLEAN:
|
|
|
|
{
|
|
|
|
int arraylen= RNA_property_array_length(ptr, prop);
|
2009-02-04 11:52:16 +00:00
|
|
|
|
|
|
|
if(arraylen && index == -1)
|
|
|
|
return NULL;
|
2009-10-28 10:16:49 +00:00
|
|
|
|
2011-01-06 01:29:13 +00:00
|
|
|
if(icon && name && name[0] == '\0')
|
2011-08-06 16:00:00 +00:00
|
|
|
but= uiDefIconButR_prop(block, ICONTOG, 0, icon, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
|
2009-03-13 13:38:41 +00:00
|
|
|
else if(icon)
|
2011-08-06 16:00:00 +00:00
|
|
|
but= uiDefIconTextButR_prop(block, ICONTOG, 0, icon, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
|
2009-03-13 13:38:41 +00:00
|
|
|
else
|
2011-08-06 16:00:00 +00:00
|
|
|
but= uiDefButR_prop(block, OPTION, 0, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
|
2009-02-04 11:52:16 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case PROP_INT:
|
|
|
|
case PROP_FLOAT:
|
2011-08-06 16:00:00 +00:00
|
|
|
{
|
|
|
|
int arraylen= RNA_property_array_length(ptr, prop);
|
|
|
|
|
2009-02-04 11:52:16 +00:00
|
|
|
if(arraylen && index == -1) {
|
Changes to Color Management
After testing and feedback, I've decided to slightly modify the way color
management works internally. While the previous method worked well for
rendering, was a smaller transition and had some advantages over this
new method, it was a bit more ambiguous, and was making things difficult
for other areas such as compositing.
This implementation now considers all color data (with only a couple of
exceptions such as brush colors) to be stored in linear RGB color space,
rather than sRGB as previously. This brings it in line with Nuke, which also
operates this way, quite successfully. Color swatches, pickers, color ramp
display are now gamma corrected to display gamma so you can see what
you're doing, but the numbers themselves are considered linear. This
makes understanding blending modes more clear (a 0.5 value on overlay
will not change the result now) as well as making color swatches act more
predictably in the compositor, however bringing over color values from
applications like photoshop or gimp, that operate in a gamma space,
will give identical results.
This commit will convert over existing files saved by earlier 2.5 versions to
work generally the same, though there may be some slight differences with
things like textures. Now that we're set on changing other areas of shading,
this won't be too disruptive overall.
I've made a diagram explaining the pipeline here:
http://mke3.net/blender/devel/2.5/25_linear_workflow_pipeline.png
and some docs here:
http://www.blender.org/development/release-logs/blender-250/color-management/
2009-12-02 07:56:34 +00:00
|
|
|
if(ELEM(RNA_property_subtype(prop), PROP_COLOR, PROP_COLOR_GAMMA))
|
2011-08-06 16:00:00 +00:00
|
|
|
but= uiDefButR_prop(block, COL, 0, name, x1, y1, x2, y2, ptr, prop, 0, 0, 0, -1, -1, NULL);
|
2009-02-04 11:52:16 +00:00
|
|
|
}
|
2009-09-21 21:19:58 +00:00
|
|
|
else if(RNA_property_subtype(prop) == PROP_PERCENTAGE || RNA_property_subtype(prop) == PROP_FACTOR)
|
2011-08-06 16:00:00 +00:00
|
|
|
but= uiDefButR_prop(block, NUMSLI, 0, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
|
2009-02-04 11:52:16 +00:00
|
|
|
else
|
2011-08-06 16:00:00 +00:00
|
|
|
but= uiDefButR_prop(block, NUM, 0, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
|
2009-02-04 11:52:16 +00:00
|
|
|
break;
|
2011-08-06 16:00:00 +00:00
|
|
|
}
|
2009-02-04 11:52:16 +00:00
|
|
|
case PROP_ENUM:
|
2011-01-24 02:56:23 +00:00
|
|
|
if(icon && name && name[0] == '\0')
|
2011-08-06 16:00:00 +00:00
|
|
|
but= uiDefIconButR_prop(block, MENU, 0, icon, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
|
2009-09-10 14:20:21 +00:00
|
|
|
else if(icon)
|
2011-08-06 16:00:00 +00:00
|
|
|
but= uiDefIconTextButR_prop(block, MENU, 0, icon, NULL, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
|
2009-09-10 14:20:21 +00:00
|
|
|
else
|
2011-08-06 16:00:00 +00:00
|
|
|
but= uiDefButR_prop(block, MENU, 0, NULL, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
|
2009-02-04 11:52:16 +00:00
|
|
|
break;
|
|
|
|
case PROP_STRING:
|
2011-01-24 02:56:23 +00:00
|
|
|
if(icon && name && name[0] == '\0')
|
2011-08-06 16:00:00 +00:00
|
|
|
but= uiDefIconButR_prop(block, TEX, 0, icon, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
|
2009-06-27 01:15:31 +00:00
|
|
|
else if(icon)
|
2011-08-06 16:00:00 +00:00
|
|
|
but= uiDefIconTextButR_prop(block, TEX, 0, icon, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
|
2009-06-27 01:15:31 +00:00
|
|
|
else
|
2011-08-06 16:00:00 +00:00
|
|
|
but= uiDefButR_prop(block, TEX, 0, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
|
2009-02-04 11:52:16 +00:00
|
|
|
break;
|
|
|
|
case PROP_POINTER: {
|
|
|
|
PointerRNA pptr;
|
|
|
|
|
|
|
|
pptr= RNA_property_pointer_get(ptr, prop);
|
2009-03-13 13:38:41 +00:00
|
|
|
if(!pptr.type)
|
2009-06-07 13:09:18 +00:00
|
|
|
pptr.type= RNA_property_pointer_type(ptr, prop);
|
2009-06-03 23:16:51 +00:00
|
|
|
icon= RNA_struct_ui_icon(pptr.type);
|
2009-06-24 14:16:56 +00:00
|
|
|
if(icon == ICON_DOT)
|
|
|
|
icon= 0;
|
2009-03-13 13:38:41 +00:00
|
|
|
|
2011-08-06 16:00:00 +00:00
|
|
|
but= uiDefIconTextButR_prop(block, IDPOIN, 0, icon, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
|
2009-02-04 11:52:16 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case PROP_COLLECTION: {
|
|
|
|
char text[256];
|
2011-10-20 20:38:26 +00:00
|
|
|
BLI_snprintf(text, sizeof(text), IFACE_("%d items"), RNA_property_collection_length(ptr, prop));
|
2009-02-04 11:52:16 +00:00
|
|
|
but= uiDefBut(block, LABEL, 0, text, x1, y1, x2, y2, NULL, 0, 0, 0, 0, NULL);
|
|
|
|
uiButSetFlag(but, UI_BUT_DISABLED);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
but= NULL;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return but;
|
|
|
|
}
|
|
|
|
|
2011-11-21 23:56:32 +00:00
|
|
|
int uiDefAutoButsRNA(uiLayout *layout, PointerRNA *ptr, int (*check_prop)(PointerRNA *, PropertyRNA *), const char label_align)
|
2009-02-04 11:52:16 +00:00
|
|
|
{
|
2009-06-24 21:27:10 +00:00
|
|
|
uiLayout *split, *col;
|
Key Configuration
Keymaps are now saveable and configurable from the user preferences, note
that editing one item in a keymap means the whole keymap is now defined by
the user and will not be updated by Blender, an option for syncing might be
added later. The outliner interface is still there, but I will probably
remove it.
There's actually 3 levels now:
* Default builtin key configuration.
* Key configuration loaded from .py file, for configs like Blender 2.4x
or other 3D applications.
* Keymaps edited by the user and saved in .B.blend. These can be saved
to .py files as well to make creating distributable configurations
easier.
Also, user preferences sections were reorganized a bit, now there is:
Interface, Editing, Input, Files and System.
Implementation notes:
* wmKeyConfig was added which represents a key configuration containing
keymaps.
* wmKeymapItem was renamed to wmKeyMapItem for consistency with wmKeyMap.
* Modal maps are not wrapped yet.
* User preferences DNA file reading did not support newdataadr() yet,
added this now for reading keymaps.
* Key configuration related settings are now RNA wrapped.
* is_property_set and is_property_hidden python methods were added.
2009-10-08 18:40:03 +00:00
|
|
|
int flag;
|
2010-12-15 05:42:23 +00:00
|
|
|
const char *name;
|
|
|
|
int tot= 0;
|
|
|
|
|
|
|
|
assert(ELEM3(label_align, '\0', 'H', 'V'));
|
2009-02-04 11:52:16 +00:00
|
|
|
|
2009-06-24 21:27:10 +00:00
|
|
|
RNA_STRUCT_BEGIN(ptr, prop) {
|
Key Configuration
Keymaps are now saveable and configurable from the user preferences, note
that editing one item in a keymap means the whole keymap is now defined by
the user and will not be updated by Blender, an option for syncing might be
added later. The outliner interface is still there, but I will probably
remove it.
There's actually 3 levels now:
* Default builtin key configuration.
* Key configuration loaded from .py file, for configs like Blender 2.4x
or other 3D applications.
* Keymaps edited by the user and saved in .B.blend. These can be saved
to .py files as well to make creating distributable configurations
easier.
Also, user preferences sections were reorganized a bit, now there is:
Interface, Editing, Input, Files and System.
Implementation notes:
* wmKeyConfig was added which represents a key configuration containing
keymaps.
* wmKeymapItem was renamed to wmKeyMapItem for consistency with wmKeyMap.
* Modal maps are not wrapped yet.
* User preferences DNA file reading did not support newdataadr() yet,
added this now for reading keymaps.
* Key configuration related settings are now RNA wrapped.
* is_property_set and is_property_hidden python methods were added.
2009-10-08 18:40:03 +00:00
|
|
|
flag= RNA_property_flag(prop);
|
2011-11-21 23:56:32 +00:00
|
|
|
if(flag & PROP_HIDDEN || (check_prop && check_prop(ptr, prop)==FALSE))
|
2009-02-04 11:52:16 +00:00
|
|
|
continue;
|
|
|
|
|
2010-12-15 05:42:23 +00:00
|
|
|
if(label_align != '\0') {
|
2011-04-02 16:45:17 +00:00
|
|
|
PropertyType type = RNA_property_type(prop);
|
2011-08-14 10:28:18 +00:00
|
|
|
int is_boolean = (type == PROP_BOOLEAN && !RNA_property_array_check(prop));
|
2011-04-02 16:45:17 +00:00
|
|
|
|
2010-12-15 05:42:23 +00:00
|
|
|
name= RNA_property_ui_name(prop);
|
UI: Layout Engine
* Buttons are now created first, and after that the layout is computed.
This means the layout engine now works at button level, and makes it
easier to write templates. Otherwise you had to store all info and
create the buttons later.
* Added interface_templates.c as a separate file to put templates in.
These can contain regular buttons, and can be put in a Free layout,
which means you can specify manual coordinates, but still get nested
correct inside other layouts.
* API was changed to allow better nesting. Previously items were added
in the last added layout specifier, i.e. one level up in the layout
hierarchy. This doesn't work well in always, so now when creating things
like rows or columns it always returns a layout which you have to add
the items in. All py scripts were updated to follow this.
* Computing the layout now goes in two passes, first estimating the
required width/height of all nested layouts, and then in the second
pass using the results of that to decide on the actual locations.
* Enum and array buttons now follow the direction of the layout, i.e.
they are vertical or horizontal depending if they are in a column or row.
* Color properties now get a color picker, and only get the additional
RGB sliders with Expand=True.
* File/directory string properties now get a button next to them for
opening the file browse, though this is not implemented yet.
* Layout items can now be aligned, set align=True when creating a column,
row, etc.
* Buttons now get a minimum width of one icon (avoids squashing icon
buttons).
* Moved some more space variables into Style.
2009-05-15 11:19:59 +00:00
|
|
|
|
2010-12-15 05:42:23 +00:00
|
|
|
if(label_align=='V') {
|
|
|
|
col= uiLayoutColumn(layout, 1);
|
2011-04-02 16:45:17 +00:00
|
|
|
|
|
|
|
if(!is_boolean)
|
|
|
|
uiItemL(col, name, ICON_NONE);
|
2010-12-15 05:42:23 +00:00
|
|
|
}
|
|
|
|
else if(label_align=='H') {
|
|
|
|
split = uiLayoutSplit(layout, 0.5f, 0);
|
2009-02-04 11:52:16 +00:00
|
|
|
|
2011-04-02 16:45:17 +00:00
|
|
|
col= uiLayoutColumn(split, 0);
|
|
|
|
uiItemL(col, (is_boolean)? "": name, ICON_NONE);
|
2010-12-15 05:42:23 +00:00
|
|
|
col= uiLayoutColumn(split, 0);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
col= NULL;
|
|
|
|
}
|
|
|
|
|
2010-12-19 07:05:29 +00:00
|
|
|
/* may meed to add more cases here.
|
|
|
|
* don't override enum flag names */
|
2011-04-02 16:45:17 +00:00
|
|
|
|
|
|
|
/* name is shown above, empty name for button below */
|
|
|
|
name= (flag & PROP_ENUM_FLAG || is_boolean)? NULL: "";
|
2010-12-15 05:42:23 +00:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
col= layout;
|
|
|
|
name= NULL; /* no smart label alignment, show default name with button */
|
2009-06-24 21:27:10 +00:00
|
|
|
}
|
2009-02-04 11:52:16 +00:00
|
|
|
|
2011-02-27 18:03:19 +00:00
|
|
|
uiItemFullR(col, ptr, prop, -1, 0, 0, name, ICON_NONE);
|
2010-12-15 05:42:23 +00:00
|
|
|
tot++;
|
2.5
Summary of ain features:
- Themes and Styles are now editable.
- CTRL+U "Save user defaults" now goes to new .B25.blend, so you
can use 2.4x and 2.5x next to each other. If B25 doesn't exist, it
reads the regular .B.blend
- Press Tkey in 3d window for (unfinished) toolbar WIP. It now only
shows the last operator, if appropriate.
Nkey properties moved to the other side.
A lot of work was done on removing old themes for good and properly
getting it work with the 2.5 region system. Here's some notes;
- Buttons now all have a complete set of colors, based on button classifications
(See outliner -> user prefs -> Interface
- Theme colors have been extended with basic colors for region types.
Currently colors are defined for Window, Header, List/Channels and
for Button/Tool views.
The screen manager handles this btw, so a TH_BACK will always pick the
right backdrop color.
- Menu backdrops are in in Button theme colors. Floating Panels will be in
the per-space type Themes.
- Styles were added in RNA too, but only for the font settings now.
Only Panel font, widget font and widget-label work now. The 'group label'
will be for templates mostly.
Style settings will be expanded with spacing defaults, label conventions,
etc.
- Label text colors are stored in per-space Theme too, to make sure they fit.
Same goes for Panel title color.
Note that 'shadow' for fonts can conflict with text colors; shadow color is
currently stored in Style... shadow code needs a bit of work still.
2009-04-27 13:44:11 +00:00
|
|
|
}
|
2009-06-24 21:27:10 +00:00
|
|
|
RNA_STRUCT_END;
|
2010-12-15 05:42:23 +00:00
|
|
|
|
|
|
|
return tot;
|
2.5
Summary of ain features:
- Themes and Styles are now editable.
- CTRL+U "Save user defaults" now goes to new .B25.blend, so you
can use 2.4x and 2.5x next to each other. If B25 doesn't exist, it
reads the regular .B.blend
- Press Tkey in 3d window for (unfinished) toolbar WIP. It now only
shows the last operator, if appropriate.
Nkey properties moved to the other side.
A lot of work was done on removing old themes for good and properly
getting it work with the 2.5 region system. Here's some notes;
- Buttons now all have a complete set of colors, based on button classifications
(See outliner -> user prefs -> Interface
- Theme colors have been extended with basic colors for region types.
Currently colors are defined for Window, Header, List/Channels and
for Button/Tool views.
The screen manager handles this btw, so a TH_BACK will always pick the
right backdrop color.
- Menu backdrops are in in Button theme colors. Floating Panels will be in
the per-space type Themes.
- Styles were added in RNA too, but only for the font settings now.
Only Panel font, widget font and widget-label work now. The 'group label'
will be for templates mostly.
Style settings will be expanded with spacing defaults, label conventions,
etc.
- Label text colors are stored in per-space Theme too, to make sure they fit.
Same goes for Panel title color.
Note that 'shadow' for fonts can conflict with text colors; shadow color is
currently stored in Style... shadow code needs a bit of work still.
2009-04-27 13:44:11 +00:00
|
|
|
}
|
|
|
|
|
2.5: ID datablock button back, previously known as std_libbuttons. The
way this worked in 2.4x wasn't really clean, with events going all over
the place and using dubious variables such as G.but->lockpoin or
G.sima->menunr. It works as follows now, for example:
xco= uiDefIDPoinButs(block, CTX_data_main(C), NULL, (ID**)&sima->image, ID_IM, &sima->pin, xco, yco,
sima_idpoin_handle, UI_ID_BROWSE|UI_ID_RENAME|UI_ID_ADD_NEW|UI_ID_OPEN|UI_ID_DELETE|UI_ID_ALONE|UI_ID_PIN);
The last two parameters are a callback function, and a list of events
or functionalities that are supported. The callback function will then
get the ID pointer + event to handle.
2009-02-06 16:40:14 +00:00
|
|
|
/***************************** ID Utilities *******************************/
|
|
|
|
|
2009-09-16 01:15:30 +00:00
|
|
|
int uiIconFromID(ID *id)
|
|
|
|
{
|
2009-09-16 19:36:17 +00:00
|
|
|
Object *ob;
|
|
|
|
PointerRNA ptr;
|
|
|
|
short idcode;
|
2009-06-03 00:14:12 +00:00
|
|
|
|
2009-09-16 19:36:17 +00:00
|
|
|
if(id==NULL)
|
2011-02-27 18:03:19 +00:00
|
|
|
return ICON_NONE;
|
2009-06-03 00:14:12 +00:00
|
|
|
|
2009-09-16 19:36:17 +00:00
|
|
|
idcode= GS(id->name);
|
2009-07-23 20:50:24 +00:00
|
|
|
|
2009-09-16 19:36:17 +00:00
|
|
|
/* exception for objects */
|
|
|
|
if(idcode == ID_OB) {
|
|
|
|
ob= (Object*)id;
|
2009-06-03 00:14:12 +00:00
|
|
|
|
2009-09-16 19:36:17 +00:00
|
|
|
if(ob->type == OB_EMPTY)
|
|
|
|
return ICON_EMPTY_DATA;
|
|
|
|
else
|
|
|
|
return uiIconFromID(ob->data);
|
2009-06-03 00:14:12 +00:00
|
|
|
}
|
|
|
|
|
2009-09-16 19:36:17 +00:00
|
|
|
/* otherwise get it through RNA, creating the pointer
|
|
|
|
will set the right type, also with subclassing */
|
|
|
|
RNA_id_pointer_create(id, &ptr);
|
2009-06-03 00:14:12 +00:00
|
|
|
|
2011-02-27 18:03:19 +00:00
|
|
|
return (ptr.type)? RNA_struct_ui_icon(ptr.type) : ICON_NONE;
|
2009-06-03 00:14:12 +00:00
|
|
|
}
|