This repository has been archived on 2023-10-09. You can view files and clone it, but cannot push or open issues or pull requests.
Files
blender-archive/source/blender/editors/include/UI_resources.h
Lukas Toenne 4638e5f99a Merge of the PyNodes branch (aka "custom nodes") into trunk.
PyNodes opens up the node system in Blender to scripters and adds a number of UI-level improvements.

=== Dynamic node type registration ===
Node types can now be added at runtime, using the RNA registration mechanism from python. This enables addons such as render engines to create a complete user interface with nodes.

Examples of how such nodes can be defined can be found in my personal wiki docs atm [1] and as a script template in release/scripts/templates_py/custom_nodes.py [2].

=== Node group improvements ===
Each node editor now has a tree history of edited node groups, which allows opening and editing nested node groups. The node editor also supports pinning now, so that different spaces can be used to edit different node groups simultaneously. For more ramblings and rationale see (really old) blog post on code.blender.org [3].

The interface of node groups has been overhauled. Sockets of a node group are no longer displayed in columns on either side, but instead special input/output nodes are used to mirror group sockets inside a node tree. This solves the problem of long node lines in groups and allows more adaptable node layout. Internal sockets can be exposed from a group by either connecting to the extension sockets in input/output nodes (shown as empty circle) or by adding sockets from the node property bar in the "Interface" panel. Further details such as the socket name can also be changed there.

[1] http://wiki.blender.org/index.php/User:Phonybone/Python_Nodes
[2] http://projects.blender.org/scm/viewvc.php/trunk/blender/release/scripts/templates_py/custom_nodes.py?view=markup&root=bf-blender
[3] http://code.blender.org/index.php/2012/01/improving-node-group-interface-editing/
2013-03-18 16:34:57 +00:00

311 lines
7.1 KiB
C++

/*
* ***** BEGIN GPL/BL DUAL 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,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
/** \file UI_resources.h
* \ingroup editorui
*/
#ifndef __UI_RESOURCES_H__
#define __UI_RESOURCES_H__
/* elubie: TODO: move the typedef for icons to UI_interface_icons.h */
/* and add/replace include of UI_resources.h by UI_interface_icons.h */
#define DEF_ICON(name) ICON_##name,
#define DEF_VICO(name) VICO_##name,
typedef enum {
/* ui */
#include "UI_icons.h"
BIFICONID_LAST
} BIFIconID;
#define BIFICONID_FIRST (ICON_NONE)
#undef DEF_ICON
#undef DEF_VICO
enum {
TH_REDALERT,
TH_THEMEUI,
// common colors among spaces
TH_BACK,
TH_TEXT,
TH_TEXT_HI,
TH_TITLE,
TH_HEADER,
TH_HEADERDESEL,
TH_HEADER_TEXT,
TH_HEADER_TEXT_HI,
/* panels */
TH_PANEL_HEADER,
TH_PANEL_BACK,
TH_PANEL_SHOW_HEADER,
TH_PANEL_SHOW_BACK,
TH_BUTBACK,
TH_BUTBACK_TEXT,
TH_BUTBACK_TEXT_HI,
TH_SHADE1,
TH_SHADE2,
TH_HILITE,
TH_GRID,
TH_WIRE,
TH_SELECT,
TH_ACTIVE,
TH_GROUP,
TH_GROUP_ACTIVE,
TH_TRANSFORM,
TH_VERTEX,
TH_VERTEX_SELECT,
TH_VERTEX_UNREFERENCED,
TH_VERTEX_SIZE,
TH_OUTLINE_WIDTH,
TH_EDGE,
TH_EDGE_SELECT,
TH_EDGE_SEAM,
TH_EDGE_FACESEL,
TH_FACE,
TH_FACE_SELECT,
TH_NORMAL,
TH_VNORMAL,
TH_FACE_DOT,
TH_FACEDOT_SIZE,
TH_CFRAME,
TH_NURB_ULINE,
TH_NURB_VLINE,
TH_NURB_SEL_ULINE,
TH_NURB_SEL_VLINE,
/* this eight colors should be in one block */
TH_HANDLE_FREE,
TH_HANDLE_AUTO,
TH_HANDLE_VECT,
TH_HANDLE_ALIGN,
TH_H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SOLID,
TH_DIS_MARKER,
TH_PATH_BEFORE,
TH_PATH_AFTER,
TH_CAMERA_PATH,
TH_LOCK_MARKER,
TH_STITCH_PREVIEW_FACE,
TH_STITCH_PREVIEW_EDGE,
TH_STITCH_PREVIEW_VERT,
TH_STITCH_PREVIEW_STITCHABLE,
TH_STITCH_PREVIEW_UNSTITCHABLE,
TH_STITCH_PREVIEW_ACTIVE,
TH_MATCH, /* highlight color for search matches */
TH_SELECT_HIGHLIGHT, /* highlight color for selected outliner item */
TH_SKIN_ROOT,
TH_ANIM_ACTIVE, /* active action */
TH_ANIM_INACTIVE, /* no active action */
TH_NLA_TWEAK, /* 'tweaking' track in NLA */
TH_NLA_TWEAK_DUPLI, /* error/warning flag for other strips referencing dupli strip */
TH_NLA_TRANSITION,
TH_NLA_TRANSITION_SEL,
TH_NLA_META,
TH_NLA_META_SEL,
TH_NLA_SOUND,
TH_NLA_SOUND_SEL,
TH_AXIS_X, /* X/Y/Z Axis */
TH_AXIS_Y,
TH_AXIS_Z,
TH_LOW_GRAD,
TH_HIGH_GRAD,
TH_SHOW_BACK_GRAD
};
/* XXX WARNING: previous is saved in file, so do not change order! */
/* specific defines per space should have higher define values */
struct bTheme;
struct PointerRNA;
// THE CODERS API FOR THEMES:
// sets the color
void UI_ThemeColor(int colorid);
// sets the color plus alpha
void UI_ThemeColor4(int colorid);
// sets color plus offset for shade
void UI_ThemeColorShade(int colorid, int offset);
// sets color plus offset for alpha
void UI_ThemeColorShadeAlpha(int colorid, int coloffset, int alphaoffset);
// sets color, which is blend between two theme colors
void UI_ThemeColorBlend(int colorid1, int colorid2, float fac);
// same, with shade offset
void UI_ThemeColorBlendShade(int colorid1, int colorid2, float fac, int offset);
void UI_ThemeColorBlendShadeAlpha(int colorid1, int colorid2, float fac, int offset, int alphaoffset);
// returns one value, not scaled
float UI_GetThemeValuef(int colorid);
int UI_GetThemeValue(int colorid);
// get three color values, scaled to 0.0-1.0 range
void UI_GetThemeColor3fv(int colorid, float col[3]);
// get the color, range 0.0-1.0, complete with shading offset
void UI_GetThemeColorShade3fv(int colorid, int offset, float col[3]);
void UI_GetThemeColorShade3ubv(int colorid, int offset, unsigned char col[3]);
// get four color values, scaled to 0.0-1.0 range
void UI_GetThemeColor4fv(int colorid, float col[4]);
// get the 3 or 4 byte values
void UI_GetThemeColor3ubv(int colorid, unsigned char col[3]);
void UI_GetThemeColor4ubv(int colorid, unsigned char col[4]);
// get a theme color from specified space type
void UI_GetThemeColorType4ubv(int colorid, int spacetype, char col[4]);
// blends and shades between two color pointers
void UI_ColorPtrBlendShade3ubv(const unsigned char cp1[3], const unsigned char cp2[3], float fac, int offset);
// shade a 3 byte color (same as UI_GetColorPtrBlendShade3ubv with 0.0 factor)
void UI_GetColorPtrShade3ubv(const unsigned char cp1[3], unsigned char col[3], int offset);
// get a 3 byte color, blended and shaded between two other char color pointers
void UI_GetColorPtrBlendShade3ubv(const unsigned char cp1[3], const unsigned char cp2[3], unsigned char col[3], float fac, int offset);
// clear the openGL ClearColor using the input colorid
void UI_ThemeClearColor(int colorid);
// internal (blender) usage only, for init and set active
void UI_SetTheme(int spacetype, int regionid);
// get current theme
struct bTheme *UI_GetTheme(void);
// return shadow width outside menus and popups */
int UI_ThemeMenuShadowWidth(void);
/* only for buttons in theme editor! */
const unsigned char *UI_ThemeGetColorPtr(struct bTheme *btheme, int spacetype, int colorid);
void UI_make_axis_color(const unsigned char *src_col, unsigned char *dst_col, const char axis);
#endif /* UI_ICONS_H */