2008-11-27 00:23:22 +00:00
/**
* $ Id $
*
* * * * * * 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 .
2008-11-27 00:23:22 +00:00
*
2010-03-12 18:47:35 +00:00
* Contributor ( s ) : Blender Foundation ( 2008 ) , Nathan Letwory , Robin Allen , Bob Holcomb
2008-11-27 00:23:22 +00:00
*
* * * * * * END GPL LICENSE BLOCK * * * * *
*/
# include <stdlib.h>
2009-03-24 17:40:58 +00:00
# include <string.h>
2008-11-27 00:23:22 +00:00
# include "RNA_define.h"
# include "rna_internal.h"
2009-10-07 22:05:30 +00:00
# include "DNA_material_types.h"
2008-11-27 00:23:22 +00:00
# include "DNA_node_types.h"
2009-05-31 16:45:30 +00:00
# include "DNA_scene_types.h"
2009-06-03 00:40:38 +00:00
# include "DNA_texture_types.h"
2009-06-04 13:55:02 +00:00
2009-11-11 09:11:21 +00:00
# include "BKE_animsys.h"
2009-10-07 22:05:30 +00:00
# include "BKE_main.h"
2008-12-26 01:37:05 +00:00
# include "BKE_node.h"
2009-06-04 13:55:02 +00:00
# include "BKE_image.h"
2009-11-10 04:01:44 +00:00
# include "BKE_texture.h"
2008-11-27 00:23:22 +00:00
2010-01-20 04:19:55 +00:00
# include "BLI_math.h"
2011-01-07 18:36:47 +00:00
# include "BLI_utildefines.h"
2010-01-20 04:19:55 +00:00
2009-11-11 09:11:21 +00:00
# include "WM_types.h"
2009-11-10 04:01:44 +00:00
2010-01-15 07:04:00 +00:00
# include "MEM_guardedalloc.h"
2011-02-08 12:54:32 +00:00
EnumPropertyItem node_blend_type_items [ ] = {
{ 0 , " MIX " , 0 , " Mix " , " " } ,
{ 1 , " ADD " , 0 , " Add " , " " } ,
{ 3 , " SUBTRACT " , 0 , " Subtract " , " " } ,
{ 2 , " MULTIPLY " , 0 , " Multiply " , " " } ,
{ 4 , " SCREEN " , 0 , " Screen " , " " } ,
{ 9 , " OVERLAY " , 0 , " Overlay " , " " } ,
{ 5 , " DIVIDE " , 0 , " Divide " , " " } ,
{ 6 , " DIFFERENCE " , 0 , " Difference " , " " } ,
{ 7 , " DARKEN " , 0 , " Darken " , " " } ,
{ 8 , " LIGHTEN " , 0 , " Lighten " , " " } ,
{ 10 , " DODGE " , 0 , " Dodge " , " " } ,
{ 11 , " BURN " , 0 , " Burn " , " " } ,
{ 15 , " COLOR " , 0 , " Color " , " " } ,
{ 14 , " VALUE " , 0 , " Value " , " " } ,
{ 13 , " SATURATION " , 0 , " Saturation " , " " } ,
{ 12 , " HUE " , 0 , " Hue " , " " } ,
{ 16 , " SOFT_LIGHT " , 0 , " Soft Light " , " " } ,
{ 17 , " LINEAR_LIGHT " , 0 , " Linear Light " , " " } ,
{ 0 , NULL , 0 , NULL , NULL } } ;
EnumPropertyItem node_math_items [ ] = {
{ 0 , " ADD " , 0 , " Add " , " " } ,
{ 1 , " SUBTRACT " , 0 , " Subtract " , " " } ,
{ 2 , " MULTIPLY " , 0 , " Multiply " , " " } ,
{ 3 , " DIVIDE " , 0 , " Divide " , " " } ,
{ 4 , " SINE " , 0 , " Sine " , " " } ,
{ 5 , " COSINE " , 0 , " Cosine " , " " } ,
{ 6 , " TANGENT " , 0 , " Tangent " , " " } ,
{ 7 , " ARCSINE " , 0 , " Arcsine " , " " } ,
{ 8 , " ARCCOSINE " , 0 , " Arccosine " , " " } ,
{ 9 , " ARCTANGENT " , 0 , " Arctangent " , " " } ,
{ 10 , " POWER " , 0 , " Power " , " " } ,
{ 11 , " LOGARITHM " , 0 , " Logarithm " , " " } ,
{ 12 , " MINIMUM " , 0 , " Minimum " , " " } ,
{ 13 , " MAXIMUM " , 0 , " Maximum " , " " } ,
{ 14 , " ROUND " , 0 , " Round " , " " } ,
{ 15 , " LESS_THAN " , 0 , " Less Than " , " " } ,
{ 16 , " GREATER_THAN " , 0 , " Greater Than " , " " } ,
{ 0 , NULL , 0 , NULL , NULL } } ;
EnumPropertyItem node_vec_math_items [ ] = {
{ 0 , " ADD " , 0 , " Add " , " " } ,
{ 1 , " SUBTRACT " , 0 , " Subtract " , " " } ,
{ 2 , " AVERAGE " , 0 , " Average " , " " } ,
{ 3 , " DOT_PRODUCT " , 0 , " Dot Product " , " " } ,
{ 4 , " CROSS_PRODUCT " , 0 , " Cross Product " , " " } ,
{ 5 , " NORMALIZE " , 0 , " Normalize " , " " } ,
{ 0 , NULL , 0 , NULL , NULL } } ;
EnumPropertyItem node_filter_items [ ] = {
{ 0 , " SOFTEN " , 0 , " Soften " , " " } ,
{ 1 , " SHARPEN " , 0 , " Sharpen " , " " } ,
{ 2 , " LAPLACE " , 0 , " Laplace " , " " } ,
{ 3 , " SOBEL " , 0 , " Sobel " , " " } ,
{ 4 , " PREWITT " , 0 , " Prewitt " , " " } ,
{ 5 , " KIRSCH " , 0 , " Kirsch " , " " } ,
{ 6 , " SHADOW " , 0 , " Shadow " , " " } ,
{ 0 , NULL , 0 , NULL , NULL } } ;
2008-11-27 00:23:22 +00:00
# ifdef RNA_RUNTIME
2010-12-02 01:18:59 +00:00
# include "BLI_linklist.h"
2009-09-16 18:59:13 +00:00
# include "ED_node.h"
2009-11-10 04:01:44 +00:00
# include "RE_pipeline.h"
2010-12-02 01:18:59 +00:00
# include "DNA_scene_types.h"
# include "WM_api.h"
2009-09-14 16:52:06 +00:00
static StructRNA * rna_Node_refine ( struct PointerRNA * ptr )
2008-12-26 01:37:05 +00:00
{
2009-05-31 16:45:30 +00:00
bNode * node = ( bNode * ) ptr - > data ;
2009-03-22 14:46:45 +00:00
switch ( node - > type ) {
2009-03-24 17:40:58 +00:00
# define DefNode(Category, ID, DefFunc, EnumName, StructName, UIName, UIDesc) \
case ID : return & RNA_ # # Category # # StructName ;
# include "rna_nodetree_types.h"
# undef DefNode
2010-01-13 06:35:12 +00:00
case NODE_GROUP :
return & RNA_NodeGroup ;
2009-03-22 14:46:45 +00:00
default :
return & RNA_Node ;
}
2008-12-26 01:37:05 +00:00
}
2009-11-11 02:15:09 +00:00
static StructRNA * rna_NodeSocketType_refine ( struct PointerRNA * ptr )
{
bNodeSocket * ns = ( bNodeSocket * ) ptr - > data ;
switch ( ns - > type ) {
case SOCK_VALUE :
return & RNA_ValueNodeSocket ;
case SOCK_VECTOR :
return & RNA_VectorNodeSocket ;
case SOCK_RGBA :
return & RNA_RGBANodeSocket ;
default :
return & RNA_UnknownType ;
}
}
2010-12-02 01:18:59 +00:00
static StructRNA * rna_NodeTree_refine ( struct PointerRNA * ptr )
{
bNodeTree * ntree = ( bNodeTree * ) ptr - > data ;
switch ( ntree - > type ) {
case NTREE_SHADER :
return & RNA_ShaderNodeTree ;
case NTREE_COMPOSIT :
return & RNA_CompositorNodeTree ;
case NTREE_TEXTURE :
return & RNA_TextureNodeTree ;
default :
return & RNA_UnknownType ;
}
}
2009-09-05 04:04:51 +00:00
static char * rna_Node_path ( PointerRNA * ptr )
{
bNode * node = ( bNode * ) ptr - > data ;
2009-11-11 09:11:21 +00:00
return BLI_sprintfN ( " nodes[ \" %s \" ] " , node - > name ) ;
2009-09-05 04:04:51 +00:00
}
2009-11-11 02:15:09 +00:00
static char * rna_NodeSocket_path ( PointerRNA * ptr )
{
bNodeTree * ntree = ( bNodeTree * ) ptr - > id . data ;
bNodeSocket * sock = ( bNodeSocket * ) ptr - > data ;
bNode * node ;
2009-11-11 09:11:21 +00:00
int socketindex ;
2009-11-11 02:15:09 +00:00
2009-11-11 09:11:21 +00:00
if ( ! nodeFindNode ( ntree , sock , & node , NULL ) ) return NULL ;
2009-11-11 02:15:09 +00:00
socketindex = BLI_findindex ( & node - > inputs , sock ) ;
if ( socketindex ! = - 1 )
2009-11-11 09:11:21 +00:00
return BLI_sprintfN ( " nodes[ \" %s \" ].inputs[%d] " , node - > name , socketindex ) ;
2009-11-11 02:15:09 +00:00
socketindex = BLI_findindex ( & node - > outputs , sock ) ;
if ( socketindex ! = - 1 )
2009-11-11 09:11:21 +00:00
return BLI_sprintfN ( " nodes[ \" %s \" ].outputs[%d] " , node - > name , socketindex ) ;
2009-11-11 02:15:09 +00:00
2009-11-11 09:11:21 +00:00
return NULL ;
2009-11-11 02:15:09 +00:00
}
2009-10-27 13:46:02 +00:00
/* Button Set Funcs for Matte Nodes */
static void rna_Matte_t1_set ( PointerRNA * ptr , float value )
{
bNode * node = ( bNode * ) ptr - > data ;
NodeChroma * chroma = node - > storage ;
chroma - > t1 = value ;
if ( value < chroma - > t2 )
chroma - > t2 = value ;
}
static void rna_Matte_t2_set ( PointerRNA * ptr , float value )
{
bNode * node = ( bNode * ) ptr - > data ;
NodeChroma * chroma = node - > storage ;
if ( value > chroma - > t1 )
value = chroma - > t1 ;
chroma - > t2 = value ;
}
2010-08-17 09:59:55 +00:00
static void rna_Image_start_frame_set ( PointerRNA * ptr , int value )
{
bNode * node = ( bNode * ) ptr - > data ;
NodeImageFile * image = node - > storage ;
CLAMP ( value , MINFRAME , image - > efra ) ;
image - > sfra = value ;
}
static void rna_Image_end_frame_set ( PointerRNA * ptr , int value )
{
bNode * node = ( bNode * ) ptr - > data ;
NodeImageFile * image = node - > storage ;
CLAMP ( value , image - > sfra , MAXFRAME ) ;
image - > efra = value ;
}
2010-12-02 01:18:59 +00:00
static void rna_Node_scene_set ( PointerRNA * ptr , PointerRNA value )
{
bNode * node = ( bNode * ) ptr - > data ;
if ( node - > id ) {
id_us_min ( node - > id ) ;
node - > id = NULL ;
}
node - > id = value . data ;
id_us_plus ( node - > id ) ;
}
2009-12-08 17:23:48 +00:00
static void node_update ( Main * bmain , Scene * scene , bNodeTree * ntree , bNode * node )
2009-09-16 18:59:13 +00:00
{
2010-10-15 04:27:09 +00:00
ED_node_generic_update ( bmain , ntree , node ) ;
2009-09-16 18:59:13 +00:00
}
2009-12-08 17:23:48 +00:00
static void rna_Node_update ( Main * bmain , Scene * scene , PointerRNA * ptr )
2009-11-11 02:15:09 +00:00
{
bNodeTree * ntree = ( bNodeTree * ) ptr - > id . data ;
bNode * node = ( bNode * ) ptr - > data ;
2009-12-08 17:23:48 +00:00
node_update ( bmain , scene , ntree , node ) ;
2009-11-11 02:15:09 +00:00
}
2010-01-13 06:35:12 +00:00
static void rna_NodeGroup_update ( Main * bmain , Scene * scene , PointerRNA * ptr )
{
bNodeTree * ntree = ( bNodeTree * ) ptr - > id . data ;
bNode * node = ( bNode * ) ptr - > data ;
nodeVerifyGroup ( ( bNodeTree * ) node - > id ) ;
node_update ( bmain , scene , ntree , node ) ;
}
2010-10-15 10:25:43 +00:00
static void rna_Node_name_set ( PointerRNA * ptr , const char * value )
2009-11-11 09:11:21 +00:00
{
bNodeTree * ntree = ( bNodeTree * ) ptr - > id . data ;
bNode * node = ( bNode * ) ptr - > data ;
2010-04-04 14:33:41 +00:00
char oldname [ sizeof ( node - > name ) ] ;
2009-11-11 09:11:21 +00:00
/* make a copy of the old name first */
2010-04-04 14:33:41 +00:00
BLI_strncpy ( oldname , node - > name , sizeof ( node - > name ) ) ;
2010-10-15 10:25:43 +00:00
/* set new name */
BLI_strncpy ( node - > name , value , sizeof ( node - > name ) ) ;
2009-11-11 09:11:21 +00:00
nodeUniqueName ( ntree , node ) ;
/* fix all the animation data which may link to this */
BKE_all_animdata_fix_paths_rename ( " nodes " , oldname , node - > name ) ;
}
/* this should be done at display time! if no custom names are set */
#if 0
2009-12-08 17:23:48 +00:00
static void rna_Node_update_username ( Main * bmain , Scene * scene , PointerRNA * ptr )
2009-09-16 18:59:13 +00:00
{
bNode * node = ( bNode * ) ptr - > data ;
const char * name ;
2009-11-11 09:11:21 +00:00
/*
if ( ! node - > username [ 0 ] ) {
if ( node - > id ) {
BLI_strncpy ( node - > username , node - > id - > name + 2 , NODE_MAXSTR ) ;
}
else {
switch ( node - > typeinfo - > type ) {
case SH_NODE_MIX_RGB :
case CMP_NODE_MIX_RGB :
case TEX_NODE_MIX_RGB :
if ( RNA_enum_name ( node_blend_type_items , node - > custom1 , & name ) )
BLI_strncpy ( node - > username , name , NODE_MAXSTR ) ;
break ;
case CMP_NODE_FILTER :
if ( RNA_enum_name ( node_filter_items , node - > custom1 , & name ) )
BLI_strncpy ( node - > username , name , NODE_MAXSTR ) ;
break ;
case CMP_NODE_FLIP :
if ( RNA_enum_name ( node_flip_items , node - > custom1 , & name ) )
BLI_strncpy ( node - > username , name , NODE_MAXSTR ) ;
break ;
case SH_NODE_MATH :
case CMP_NODE_MATH :
case TEX_NODE_MATH :
if ( RNA_enum_name ( node_math_items , node - > custom1 , & name ) )
BLI_strncpy ( node - > username , name , NODE_MAXSTR ) ;
break ;
case SH_NODE_VECT_MATH :
if ( RNA_enum_name ( node_vec_math_items , node - > custom1 , & name ) )
BLI_strncpy ( node - > username , name , NODE_MAXSTR ) ;
break ;
}
*/
2009-09-16 18:59:13 +00:00
}
}
2009-12-08 17:23:48 +00:00
rna_Node_update ( bmain , scene , ptr ) ;
2009-09-16 18:59:13 +00:00
}
2009-11-11 09:11:21 +00:00
# endif
2009-09-16 18:59:13 +00:00
2009-12-08 17:23:48 +00:00
static void rna_NodeSocket_update ( Main * bmain , Scene * scene , PointerRNA * ptr )
2009-11-11 02:15:09 +00:00
{
bNodeTree * ntree = ( bNodeTree * ) ptr - > id . data ;
bNodeSocket * sock = ( bNodeSocket * ) ptr - > data ;
bNode * node ;
if ( nodeFindNode ( ntree , sock , & node , NULL ) )
2009-12-08 17:23:48 +00:00
node_update ( bmain , scene , ntree , node ) ;
2009-11-11 02:15:09 +00:00
}
static void rna_NodeSocket_defvalue_range ( PointerRNA * ptr , float * min , float * max )
{
bNodeSocket * sock = ( bNodeSocket * ) ptr - > data ;
* min = sock - > ns . min ;
* max = sock - > ns . max ;
}
2009-12-08 17:23:48 +00:00
static void rna_Node_mapping_update ( Main * bmain , Scene * scene , PointerRNA * ptr )
2009-11-10 04:01:44 +00:00
{
bNode * node = ( bNode * ) ptr - > data ;
init_mapping ( ( TexMapping * ) node - > storage ) ;
2009-12-08 17:23:48 +00:00
rna_Node_update ( bmain , scene , ptr ) ;
2009-11-10 04:01:44 +00:00
}
2009-12-08 17:23:48 +00:00
static void rna_Node_image_layer_update ( Main * bmain , Scene * scene , PointerRNA * ptr )
2009-11-10 04:01:44 +00:00
{
bNode * node = ( bNode * ) ptr - > data ;
Image * ima = ( Image * ) node - > id ;
ImageUser * iuser = node - > storage ;
BKE_image_multilayer_index ( ima - > rr , iuser ) ;
2010-12-16 13:43:20 +00:00
BKE_image_signal ( ima , iuser , IMA_SIGNAL_SRC_CHANGE ) ;
2009-11-10 04:01:44 +00:00
2009-12-08 17:23:48 +00:00
rna_Node_update ( bmain , scene , ptr ) ;
2009-11-10 04:01:44 +00:00
}
static EnumPropertyItem * renderresult_layers_add_enum ( RenderLayer * rl )
{
EnumPropertyItem * item = NULL ;
EnumPropertyItem tmp = { 0 , " " , 0 , " " , " " } ;
int i = 0 , totitem = 0 ;
2009-11-11 09:11:21 +00:00
while ( rl ) {
2009-11-10 04:01:44 +00:00
tmp . identifier = rl - > name ;
tmp . name = rl - > name ;
tmp . value = i + + ;
RNA_enum_item_add ( & item , & totitem , & tmp ) ;
2009-11-11 09:11:21 +00:00
rl = rl - > next ;
2009-11-10 04:01:44 +00:00
}
RNA_enum_item_end ( & item , & totitem ) ;
return item ;
}
static EnumPropertyItem * rna_Node_image_layer_itemf ( bContext * C , PointerRNA * ptr , int * free )
{
bNode * node = ( bNode * ) ptr - > data ;
Image * ima = ( Image * ) node - > id ;
EnumPropertyItem * item = NULL ;
RenderLayer * rl ;
if ( ! ima | | ! ( ima - > rr ) ) return NULL ;
rl = ima - > rr - > layers . first ;
item = renderresult_layers_add_enum ( rl ) ;
* free = 1 ;
return item ;
}
static EnumPropertyItem * rna_Node_scene_layer_itemf ( bContext * C , PointerRNA * ptr , int * free )
{
bNode * node = ( bNode * ) ptr - > data ;
Scene * sce = ( Scene * ) node - > id ;
EnumPropertyItem * item = NULL ;
RenderLayer * rl ;
if ( ! sce ) return NULL ;
rl = sce - > r . layers . first ;
item = renderresult_layers_add_enum ( rl ) ;
* free = 1 ;
return item ;
}
static EnumPropertyItem * rna_Node_channel_itemf ( bContext * C , PointerRNA * ptr , int * free )
{
bNode * node = ( bNode * ) ptr - > data ;
EnumPropertyItem * item = NULL ;
EnumPropertyItem tmp = { 0 , " " , 0 , " " , " " } ;
int totitem = 0 ;
switch ( node - > custom1 ) {
case CMP_NODE_CHANNEL_MATTE_CS_RGB :
tmp . identifier = " R " ; tmp . name = " R " ; tmp . value = 1 ;
RNA_enum_item_add ( & item , & totitem , & tmp ) ;
tmp . identifier = " G " ; tmp . name = " G " ; tmp . value = 2 ;
RNA_enum_item_add ( & item , & totitem , & tmp ) ;
tmp . identifier = " B " ; tmp . name = " B " ; tmp . value = 3 ;
RNA_enum_item_add ( & item , & totitem , & tmp ) ;
break ;
case CMP_NODE_CHANNEL_MATTE_CS_HSV :
tmp . identifier = " H " ; tmp . name = " H " ; tmp . value = 1 ;
RNA_enum_item_add ( & item , & totitem , & tmp ) ;
tmp . identifier = " S " ; tmp . name = " S " ; tmp . value = 2 ;
RNA_enum_item_add ( & item , & totitem , & tmp ) ;
tmp . identifier = " V " ; tmp . name = " V " ; tmp . value = 3 ;
RNA_enum_item_add ( & item , & totitem , & tmp ) ;
break ;
case CMP_NODE_CHANNEL_MATTE_CS_YUV :
tmp . identifier = " Y " ; tmp . name = " Y " ; tmp . value = 1 ;
RNA_enum_item_add ( & item , & totitem , & tmp ) ;
tmp . identifier = " G " ; tmp . name = " U " ; tmp . value = 2 ;
RNA_enum_item_add ( & item , & totitem , & tmp ) ;
tmp . identifier = " V " ; tmp . name = " V " ; tmp . value = 3 ;
RNA_enum_item_add ( & item , & totitem , & tmp ) ;
break ;
case CMP_NODE_CHANNEL_MATTE_CS_YCC :
tmp . identifier = " Y " ; tmp . name = " Y " ; tmp . value = 1 ;
RNA_enum_item_add ( & item , & totitem , & tmp ) ;
tmp . identifier = " CB " ; tmp . name = " Cr " ; tmp . value = 2 ;
RNA_enum_item_add ( & item , & totitem , & tmp ) ;
tmp . identifier = " CR " ; tmp . name = " Cb " ; tmp . value = 3 ;
RNA_enum_item_add ( & item , & totitem , & tmp ) ;
break ;
default :
break ;
}
RNA_enum_item_end ( & item , & totitem ) ;
* free = 1 ;
return item ;
}
2010-12-02 01:18:59 +00:00
static bNode * rna_NodeTree_node_new ( bNodeTree * ntree , bContext * C , ReportList * reports , int type , bNodeTree * group )
{
2010-12-03 03:44:39 +00:00
bNode * node ;
if ( type = = NODE_GROUP & & group = = NULL ) {
BKE_reportf ( reports , RPT_ERROR , " node type \' GROUP \' missing group argument " ) ;
return NULL ;
}
node = nodeAddNodeType ( ntree , type , group , NULL ) ;
2010-12-02 01:18:59 +00:00
if ( node = = NULL ) {
BKE_reportf ( reports , RPT_ERROR , " Unable to create node " ) ;
}
else {
nodeVerifyGroup ( ntree ) ; /* update group node socket links*/
NodeTagChanged ( ntree , node ) ;
2010-12-05 18:59:23 +00:00
WM_main_add_notifier ( NC_NODE | NA_EDITED , ntree ) ;
2010-12-03 03:44:39 +00:00
if ( group )
id_us_plus ( & group - > id ) ;
2010-12-02 01:18:59 +00:00
}
return node ;
}
static bNode * rna_NodeTree_node_composite_new ( bNodeTree * ntree , bContext * C , ReportList * reports , int type , bNodeTree * group )
{
/* raises error on failier */
bNode * node = rna_NodeTree_node_new ( ntree , C , reports , type , group ) ;
if ( node ) {
if ( ELEM4 ( node - > type , CMP_NODE_COMPOSITE , CMP_NODE_DEFOCUS , CMP_NODE_OUTPUT_FILE , CMP_NODE_R_LAYERS ) ) {
/* annoying, find the node tree we are in, scene can be NULL */
Scene * scene ;
for ( scene = CTX_data_main ( C ) - > scene . first ; scene ; scene = scene - > id . next ) {
if ( scene - > nodetree = = ntree ) {
break ;
}
}
node - > id = ( ID * ) scene ;
id_us_plus ( node - > id ) ;
}
ntreeCompositForceHidden ( ntree , CTX_data_scene ( C ) ) ;
ntreeSolveOrder ( ntree ) ;
}
return node ;
}
static bNode * rna_NodeTree_node_texture_new ( bNodeTree * ntree , bContext * C , ReportList * reports , int type , bNodeTree * group )
{
/* raises error on failier */
bNode * node = rna_NodeTree_node_new ( ntree , C , reports , type , group ) ;
if ( node ) {
ntreeTexCheckCyclics ( ntree ) ;
}
return node ;
}
2010-12-05 18:59:23 +00:00
static void rna_NodeTree_node_remove ( bNodeTree * ntree , ReportList * reports , bNode * node )
2010-12-02 01:18:59 +00:00
{
if ( BLI_findindex ( & ntree - > nodes , node ) = = - 1 ) {
BKE_reportf ( reports , RPT_ERROR , " Unable to locate node '%s' in nodetree " , node - > name ) ;
}
else {
if ( node - > id )
id_us_min ( node - > id ) ;
nodeFreeNode ( ntree , node ) ;
nodeVerifyGroup ( ntree ) ; /* update group node socket links*/
2010-12-05 18:59:23 +00:00
WM_main_add_notifier ( NC_NODE | NA_EDITED , ntree ) ;
2010-12-02 01:18:59 +00:00
}
}
2010-12-05 18:59:23 +00:00
static bNodeLink * rna_NodeTree_link_new ( bNodeTree * ntree , ReportList * reports , bNodeSocket * in , bNodeSocket * out )
2010-12-02 01:18:59 +00:00
{
bNodeLink * ret ;
bNode * fromnode , * tonode ;
if ( ! nodeFindNode ( ntree , in , & fromnode , NULL ) ) {
BKE_reportf ( reports , RPT_ERROR , " Unable to locate input socket's node in nodetree " ) ;
return NULL ;
}
if ( ! nodeFindNode ( ntree , out , & tonode , NULL ) ) {
BKE_reportf ( reports , RPT_ERROR , " Unable to locate output socket's node in nodetree " ) ;
return NULL ;
}
/* unlink node input socket */
nodeRemSocketLinks ( ntree , out ) ;
ret = nodeAddLink ( ntree , fromnode , in , tonode , out ) ;
2011-01-17 15:16:08 +00:00
if ( ret ) {
NodeTagChanged ( ntree , tonode ) ;
2010-12-02 01:18:59 +00:00
2011-01-17 15:16:08 +00:00
nodeVerifyGroup ( ntree ) ; /* update group node socket links*/
2010-12-02 01:18:59 +00:00
2011-01-17 15:16:08 +00:00
ntreeSolveOrder ( ntree ) ;
2010-12-02 01:18:59 +00:00
2011-01-17 15:16:08 +00:00
WM_main_add_notifier ( NC_NODE | NA_EDITED , ntree ) ;
}
2010-12-02 01:18:59 +00:00
return ret ;
}
2010-12-05 18:59:23 +00:00
static void rna_NodeTree_link_remove ( bNodeTree * ntree , ReportList * reports , bNodeLink * link )
2010-12-02 01:18:59 +00:00
{
if ( BLI_findindex ( & ntree - > links , link ) = = - 1 ) {
BKE_reportf ( reports , RPT_ERROR , " Unable to locate link in nodetree " ) ;
}
else {
nodeRemLink ( ntree , link ) ;
ntreeSolveOrder ( ntree ) ;
nodeVerifyGroup ( ntree ) ; /* update group node socket links*/
2010-12-05 18:59:23 +00:00
WM_main_add_notifier ( NC_NODE | NA_EDITED , ntree ) ;
2010-12-02 01:18:59 +00:00
}
}
2009-11-10 04:01:44 +00:00
2008-11-27 00:23:22 +00:00
# else
2009-11-11 09:11:21 +00:00
static EnumPropertyItem prop_image_layer_items [ ] = {
{ 0 , " PLACEHOLDER " , 0 , " Placeholder " , " " } ,
{ 0 , NULL , 0 , NULL , NULL } } ;
static EnumPropertyItem prop_scene_layer_items [ ] = {
{ 0 , " PLACEHOLDER " , 0 , " Placeholder " , " " } ,
{ 0 , NULL , 0 , NULL , NULL } } ;
static EnumPropertyItem prop_tri_channel_items [ ] = {
{ 1 , " R " , 0 , " R " , " " } ,
{ 2 , " G " , 0 , " G " , " " } ,
{ 3 , " B " , 0 , " B " , " " } ,
{ 0 , NULL , 0 , NULL , NULL } } ;
static EnumPropertyItem node_flip_items [ ] = {
{ 0 , " X " , 0 , " Flip X " , " " } ,
{ 1 , " Y " , 0 , " Flip Y " , " " } ,
{ 2 , " XY " , 0 , " Flip X & Y " , " " } ,
{ 0 , NULL , 0 , NULL , NULL } } ;
2010-12-13 21:17:00 +00:00
static EnumPropertyItem node_ycc_items [ ] = {
{ 0 , " ITUBT601 " , 0 , " ITU 601 " , " " } ,
{ 1 , " ITUBT709 " , 0 , " ITU 709 " , " " } ,
{ 2 , " JFIF " , 0 , " Jpeg " , " " } ,
{ 0 , NULL , 0 , NULL , NULL } } ;
2009-11-11 09:11:21 +00:00
2009-03-24 17:40:58 +00:00
# define MaxNodes 1000
enum
2009-03-22 14:46:45 +00:00
{
2010-01-13 06:35:12 +00:00
Category_GroupNode ,
2009-03-24 17:40:58 +00:00
Category_ShaderNode ,
Category_CompositorNode ,
Category_TextureNode
} ;
typedef struct NodeInfo
{
int defined ;
int category ;
const char * enum_name ;
const char * struct_name ;
const char * base_name ;
2009-06-16 00:52:21 +00:00
int icon ;
2009-03-24 17:40:58 +00:00
const char * ui_name ;
const char * ui_desc ;
} NodeInfo ;
static NodeInfo nodes [ MaxNodes ] ;
2009-03-22 14:46:45 +00:00
2009-11-11 02:15:09 +00:00
static void reg_node ( int ID , int category , const char * enum_name , const char * struct_name ,
const char * base_name , const char * ui_name , const char * ui_desc )
{
2009-03-24 17:40:58 +00:00
NodeInfo * ni = nodes + ID ;
ni - > defined = 1 ;
ni - > category = category ;
ni - > enum_name = enum_name ;
ni - > struct_name = struct_name ;
ni - > base_name = base_name ;
ni - > ui_name = ui_name ;
ni - > ui_desc = ui_desc ;
}
static void init ( void )
{
memset ( nodes , 0 , sizeof nodes ) ;
# define DefNode(Category, ID, DefFunc, EnumName, StructName, UIName, UIDesc) \
2010-10-03 01:44:00 +00:00
reg_node ( ID , Category_ # # Category , EnumName , STRINGIFY_ARG ( Category # # StructName ) , # Category , UIName , UIDesc ) ;
2009-03-24 17:40:58 +00:00
# include "rna_nodetree_types.h"
# undef DefNode
2010-01-13 06:35:12 +00:00
reg_node ( NODE_GROUP , Category_GroupNode , " GROUP " , " NodeGroup " , " Node " , " Group " , " " ) ;
2009-03-24 17:40:58 +00:00
}
static StructRNA * def_node ( BlenderRNA * brna , int node_id )
{
StructRNA * srna ;
NodeInfo * node = nodes + node_id ;
2009-05-31 16:45:30 +00:00
srna = RNA_def_struct ( brna , node - > struct_name , node - > base_name ) ;
2009-03-24 17:40:58 +00:00
RNA_def_struct_ui_text ( srna , node - > ui_name , node - > ui_desc ) ;
2009-03-22 14:46:45 +00:00
RNA_def_struct_sdna ( srna , " bNode " ) ;
2009-03-24 17:40:58 +00:00
return srna ;
}
2010-01-15 07:04:00 +00:00
void alloc_node_type_items ( EnumPropertyItem * items , int category )
2009-03-24 17:40:58 +00:00
{
int i ;
2010-01-13 08:12:57 +00:00
int count = 3 ;
2010-01-15 07:04:00 +00:00
EnumPropertyItem * item = items ;
2009-03-24 17:40:58 +00:00
for ( i = 0 ; i < MaxNodes ; i + + )
if ( nodes [ i ] . defined & & nodes [ i ] . category = = category )
count + + ;
2010-01-15 07:04:00 +00:00
/*item = items = MEM_callocN(count * sizeof(EnumPropertyItem), "alloc_node_type_items");*/
2009-03-24 17:40:58 +00:00
for ( i = 0 ; i < MaxNodes ; i + + ) {
NodeInfo * node = nodes + i ;
if ( node - > defined & & node - > category = = category ) {
item - > value = i ;
item - > identifier = node - > enum_name ;
2009-06-16 00:52:21 +00:00
item - > icon = node - > icon ;
2009-03-24 17:40:58 +00:00
item - > name = node - > ui_name ;
item - > description = node - > ui_desc ;
item + + ;
}
}
item - > value = NODE_DYNAMIC ;
item - > identifier = " SCRIPT " ;
2010-01-13 08:39:32 +00:00
item - > icon = 0 ;
2009-03-24 17:40:58 +00:00
item - > name = " Script " ;
item - > description = " " ;
item + + ;
2010-01-13 06:35:12 +00:00
item - > value = NODE_GROUP ;
item - > identifier = " GROUP " ;
2010-01-13 08:39:32 +00:00
item - > icon = 0 ;
2010-01-13 06:35:12 +00:00
item - > name = " Group " ;
item - > description = " " ;
item + + ;
2010-01-13 08:12:57 +00:00
/* NOTE!, increase 'count' when adding items here */
2009-03-24 17:40:58 +00:00
memset ( item , 0 , sizeof ( EnumPropertyItem ) ) ;
2009-03-22 14:46:45 +00:00
}
2009-03-24 17:40:58 +00:00
/* -- Common nodes ---------------------------------------------------------- */
2010-01-13 06:35:12 +00:00
static void def_group ( StructRNA * srna )
{
PropertyRNA * prop ;
2010-09-16 19:00:15 +00:00
prop = RNA_def_property ( srna , " node_tree " , PROP_POINTER , PROP_NONE ) ;
2010-01-13 06:35:12 +00:00
RNA_def_property_pointer_sdna ( prop , NULL , " id " ) ;
RNA_def_property_struct_type ( prop , " NodeTree " ) ;
RNA_def_property_flag ( prop , PROP_EDITABLE ) ;
RNA_def_property_ui_text ( prop , " Node Tree " , " " ) ;
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_NodeGroup_update " ) ;
}
2009-06-04 14:11:39 +00:00
static void def_math ( StructRNA * srna )
2009-03-22 14:49:13 +00:00
{
PropertyRNA * prop ;
2009-03-24 17:40:58 +00:00
2009-05-31 16:45:30 +00:00
prop = RNA_def_property ( srna , " operation " , PROP_ENUM , PROP_NONE ) ;
2009-03-24 17:40:58 +00:00
RNA_def_property_enum_sdna ( prop , NULL , " custom1 " ) ;
2009-09-16 18:59:13 +00:00
RNA_def_property_enum_items ( prop , node_math_items ) ;
2009-03-24 17:40:58 +00:00
RNA_def_property_ui_text ( prop , " Operation " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-03-24 17:40:58 +00:00
}
2009-03-22 14:49:13 +00:00
2009-06-04 14:11:39 +00:00
static void def_vector_math ( StructRNA * srna )
2009-03-24 17:40:58 +00:00
{
PropertyRNA * prop ;
2009-05-31 16:45:30 +00:00
prop = RNA_def_property ( srna , " operation " , PROP_ENUM , PROP_NONE ) ;
2009-03-24 17:40:58 +00:00
RNA_def_property_enum_sdna ( prop , NULL , " custom1 " ) ;
2009-09-16 18:59:13 +00:00
RNA_def_property_enum_items ( prop , node_vec_math_items ) ;
2009-03-24 17:40:58 +00:00
RNA_def_property_ui_text ( prop , " Operation " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-03-24 17:40:58 +00:00
}
2009-06-04 14:11:39 +00:00
static void def_rgb_curve ( StructRNA * srna )
2009-03-24 17:40:58 +00:00
{
PropertyRNA * prop ;
2009-05-31 16:45:30 +00:00
prop = RNA_def_property ( srna , " mapping " , PROP_POINTER , PROP_NONE ) ;
2009-03-24 17:40:58 +00:00
RNA_def_property_pointer_sdna ( prop , NULL , " storage " ) ;
RNA_def_property_struct_type ( prop , " CurveMapping " ) ;
RNA_def_property_ui_text ( prop , " Mapping " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-03-24 17:40:58 +00:00
}
2009-06-04 14:11:39 +00:00
static void def_vector_curve ( StructRNA * srna )
2009-03-24 17:40:58 +00:00
{
PropertyRNA * prop ;
2009-05-31 16:45:30 +00:00
prop = RNA_def_property ( srna , " mapping " , PROP_POINTER , PROP_NONE ) ;
2009-03-24 17:40:58 +00:00
RNA_def_property_pointer_sdna ( prop , NULL , " storage " ) ;
RNA_def_property_struct_type ( prop , " CurveMapping " ) ;
RNA_def_property_ui_text ( prop , " Mapping " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-03-24 17:40:58 +00:00
}
2009-06-04 14:11:39 +00:00
static void def_time ( StructRNA * srna )
2009-05-31 16:45:30 +00:00
{
PropertyRNA * prop ;
prop = RNA_def_property ( srna , " curve " , PROP_POINTER , PROP_NONE ) ;
RNA_def_property_pointer_sdna ( prop , NULL , " storage " ) ;
RNA_def_property_struct_type ( prop , " CurveMapping " ) ;
RNA_def_property_ui_text ( prop , " Curve " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-05-31 16:45:30 +00:00
2010-08-21 04:51:00 +00:00
prop = RNA_def_property ( srna , " frame_start " , PROP_INT , PROP_NONE ) ;
2009-05-31 16:45:30 +00:00
RNA_def_property_int_sdna ( prop , NULL , " custom1 " ) ;
RNA_def_property_ui_text ( prop , " Start Frame " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-05-31 16:45:30 +00:00
2010-08-21 04:51:00 +00:00
prop = RNA_def_property ( srna , " frame_end " , PROP_INT , PROP_NONE ) ;
2009-05-31 16:45:30 +00:00
RNA_def_property_int_sdna ( prop , NULL , " custom2 " ) ;
RNA_def_property_ui_text ( prop , " End Frame " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-05-31 16:45:30 +00:00
}
2009-11-10 04:01:44 +00:00
static void def_colorramp ( StructRNA * srna )
2009-03-24 17:40:58 +00:00
{
2009-09-16 18:59:13 +00:00
PropertyRNA * prop ;
2009-03-24 17:40:58 +00:00
2009-09-16 18:59:13 +00:00
prop = RNA_def_property ( srna , " color_ramp " , PROP_POINTER , PROP_NONE ) ;
2009-03-24 17:40:58 +00:00
RNA_def_property_pointer_sdna ( prop , NULL , " storage " ) ;
2009-09-16 18:59:13 +00:00
RNA_def_property_struct_type ( prop , " ColorRamp " ) ;
RNA_def_property_ui_text ( prop , " Color Ramp " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-03-24 17:40:58 +00:00
}
2009-06-04 14:11:39 +00:00
static void def_mix_rgb ( StructRNA * srna )
2009-03-24 17:40:58 +00:00
{
PropertyRNA * prop ;
2009-05-31 16:45:30 +00:00
prop = RNA_def_property ( srna , " blend_type " , PROP_ENUM , PROP_NONE ) ;
2009-03-24 17:40:58 +00:00
RNA_def_property_enum_sdna ( prop , NULL , " custom1 " ) ;
2009-09-16 18:59:13 +00:00
RNA_def_property_enum_items ( prop , node_blend_type_items ) ;
2009-03-24 17:40:58 +00:00
RNA_def_property_ui_text ( prop , " Blend Type " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-03-24 17:40:58 +00:00
2010-08-21 04:51:00 +00:00
prop = RNA_def_property ( srna , " use_alpha " , PROP_BOOLEAN , PROP_NONE ) ;
2009-03-24 17:40:58 +00:00
RNA_def_property_boolean_sdna ( prop , NULL , " custom2 " , 1 ) ;
2009-09-16 18:59:13 +00:00
RNA_def_property_ui_text ( prop , " Alpha " , " Include alpha of second input in this operation " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-03-24 17:40:58 +00:00
}
2009-06-04 14:11:39 +00:00
static void def_texture ( StructRNA * srna )
2009-05-31 16:45:30 +00:00
{
PropertyRNA * prop ;
prop = RNA_def_property ( srna , " texture " , PROP_POINTER , PROP_NONE ) ;
RNA_def_property_pointer_sdna ( prop , NULL , " id " ) ;
RNA_def_property_struct_type ( prop , " Texture " ) ;
RNA_def_property_flag ( prop , PROP_EDITABLE ) ;
RNA_def_property_ui_text ( prop , " Texture " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-05-31 16:45:30 +00:00
prop = RNA_def_property ( srna , " node_output " , PROP_INT , PROP_NONE ) ;
RNA_def_property_int_sdna ( prop , NULL , " custom1 " ) ;
RNA_def_property_ui_text ( prop , " Node Output " , " For node-based textures, which output node to use " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-05-31 16:45:30 +00:00
}
2009-03-24 17:40:58 +00:00
/* -- Shader Nodes ---------------------------------------------------------- */
2009-06-04 14:11:39 +00:00
static void def_sh_material ( StructRNA * srna )
2009-03-24 17:40:58 +00:00
{
PropertyRNA * prop ;
2009-05-31 16:45:30 +00:00
prop = RNA_def_property ( srna , " material " , PROP_POINTER , PROP_NONE ) ;
2009-03-22 14:49:13 +00:00
RNA_def_property_pointer_sdna ( prop , NULL , " id " ) ;
RNA_def_property_struct_type ( prop , " Material " ) ;
2009-05-28 23:23:47 +00:00
RNA_def_property_flag ( prop , PROP_EDITABLE ) ;
2009-03-22 14:49:13 +00:00
RNA_def_property_ui_text ( prop , " Material " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-03-22 14:49:13 +00:00
2010-08-21 04:51:00 +00:00
prop = RNA_def_property ( srna , " use_diffuse " , PROP_BOOLEAN , PROP_NONE ) ;
2009-03-22 14:49:13 +00:00
RNA_def_property_boolean_sdna ( prop , NULL , " custom1 " , SH_NODE_MAT_DIFF ) ;
RNA_def_property_ui_text ( prop , " Diffuse " , " Material Node outputs Diffuse " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-03-22 14:49:13 +00:00
2010-08-21 04:51:00 +00:00
prop = RNA_def_property ( srna , " use_specular " , PROP_BOOLEAN , PROP_NONE ) ;
2009-03-24 17:40:58 +00:00
RNA_def_property_boolean_sdna ( prop , NULL , " custom1 " , SH_NODE_MAT_SPEC ) ;
RNA_def_property_ui_text ( prop , " Specular " , " Material Node outputs Specular " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-03-24 17:40:58 +00:00
2009-05-31 16:45:30 +00:00
prop = RNA_def_property ( srna , " invert_normal " , PROP_BOOLEAN , PROP_NONE ) ;
2009-03-24 17:40:58 +00:00
RNA_def_property_boolean_sdna ( prop , NULL , " custom1 " , SH_NODE_MAT_NEG ) ;
RNA_def_property_ui_text ( prop , " Invert Normal " , " Material Node uses inverted normal " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-03-22 14:49:13 +00:00
}
2009-06-04 14:11:39 +00:00
static void def_sh_mapping ( StructRNA * srna )
2009-03-24 17:40:58 +00:00
{
PropertyRNA * prop ;
2009-11-10 04:01:44 +00:00
RNA_def_struct_sdna_from ( srna , " TexMapping " , " storage " ) ;
prop = RNA_def_property ( srna , " location " , PROP_FLOAT , PROP_TRANSLATION ) ;
RNA_def_property_float_sdna ( prop , NULL , " loc " ) ;
RNA_def_property_ui_text ( prop , " Location " , " Location offset for the input coordinate " ) ;
RNA_def_property_ui_range ( prop , - 10.f , 10.f , 0.1f , 2 ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_mapping_update " ) ;
2009-11-10 04:01:44 +00:00
prop = RNA_def_property ( srna , " rotation " , PROP_FLOAT , PROP_EULER ) ;
RNA_def_property_float_sdna ( prop , NULL , " rot " ) ;
RNA_def_property_ui_text ( prop , " Rotation " , " Rotation offset for the input coordinate " ) ;
RNA_def_property_ui_range ( prop , - 360.f , 360.f , 1.f , 2 ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_mapping_update " ) ;
2009-11-10 04:01:44 +00:00
prop = RNA_def_property ( srna , " scale " , PROP_FLOAT , PROP_XYZ ) ;
RNA_def_property_float_sdna ( prop , NULL , " size " ) ;
RNA_def_property_ui_text ( prop , " Scale " , " Scale adjustment for the input coordinate " ) ;
RNA_def_property_ui_range ( prop , - 10.f , 10.f , 0.1f , 2 ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_mapping_update " ) ;
2009-11-10 04:01:44 +00:00
2010-08-20 06:09:58 +00:00
prop = RNA_def_property ( srna , " use_min " , PROP_BOOLEAN , PROP_NONE ) ;
2009-11-10 04:01:44 +00:00
RNA_def_property_boolean_sdna ( prop , NULL , " flag " , TEXMAP_CLIP_MIN ) ;
RNA_def_property_ui_text ( prop , " Clamp Minimum " , " Clamp the output coordinate to a minimum value " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-11-10 04:01:44 +00:00
2010-08-20 06:09:58 +00:00
prop = RNA_def_property ( srna , " min " , PROP_FLOAT , PROP_XYZ ) ;
2009-11-10 04:01:44 +00:00
RNA_def_property_float_sdna ( prop , NULL , " min " ) ;
RNA_def_property_ui_text ( prop , " Minimum " , " Minimum value to clamp coordinate to " ) ;
RNA_def_property_ui_range ( prop , - 10.f , 10.f , 0.1f , 2 ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-11-10 04:01:44 +00:00
2010-08-20 06:09:58 +00:00
prop = RNA_def_property ( srna , " use_max " , PROP_BOOLEAN , PROP_NONE ) ;
2009-11-10 04:01:44 +00:00
RNA_def_property_boolean_sdna ( prop , NULL , " flag " , TEXMAP_CLIP_MAX ) ;
RNA_def_property_ui_text ( prop , " Clamp Maximum " , " Clamp the output coordinate to a maximum value " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-11-10 04:01:44 +00:00
2010-08-20 06:09:58 +00:00
prop = RNA_def_property ( srna , " max " , PROP_FLOAT , PROP_XYZ ) ;
2009-11-10 04:01:44 +00:00
RNA_def_property_float_sdna ( prop , NULL , " max " ) ;
RNA_def_property_ui_text ( prop , " Maximum " , " Maximum value to clamp coordinate to " ) ;
RNA_def_property_ui_range ( prop , - 10.f , 10.f , 0.1f , 2 ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-03-24 17:40:58 +00:00
}
2009-06-04 14:11:39 +00:00
static void def_sh_geometry ( StructRNA * srna )
2009-03-24 17:40:58 +00:00
{
PropertyRNA * prop ;
2009-06-03 00:40:38 +00:00
RNA_def_struct_sdna_from ( srna , " NodeGeometry " , " storage " ) ;
2009-03-24 17:40:58 +00:00
2009-06-03 00:40:38 +00:00
prop = RNA_def_property ( srna , " uv_layer " , PROP_STRING , PROP_NONE ) ;
RNA_def_property_string_sdna ( prop , NULL , " uvname " ) ;
RNA_def_property_ui_text ( prop , " UV Layer " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-03 00:40:38 +00:00
prop = RNA_def_property ( srna , " color_layer " , PROP_STRING , PROP_NONE ) ;
RNA_def_property_string_sdna ( prop , NULL , " colname " ) ;
RNA_def_property_ui_text ( prop , " Vertex Color Layer " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-03-24 17:40:58 +00:00
}
2009-05-31 16:45:30 +00:00
2009-06-03 00:40:38 +00:00
/* -- Compositor Nodes ------------------------------------------------------ */
2009-05-31 16:45:30 +00:00
2009-06-04 14:11:39 +00:00
static void def_cmp_alpha_over ( StructRNA * srna )
2009-06-03 00:40:38 +00:00
{
PropertyRNA * prop ;
2009-09-19 19:57:30 +00:00
// XXX: Tooltip
2010-08-20 06:09:58 +00:00
prop = RNA_def_property ( srna , " use_premultiply " , PROP_BOOLEAN , PROP_NONE ) ;
2009-06-03 00:40:38 +00:00
RNA_def_property_boolean_sdna ( prop , NULL , " custom1 " , 1 ) ;
2009-09-19 19:57:30 +00:00
RNA_def_property_ui_text ( prop , " Convert Premul " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-03 00:40:38 +00:00
2009-06-04 13:55:02 +00:00
RNA_def_struct_sdna_from ( srna , " NodeTwoFloats " , " storage " ) ;
prop = RNA_def_property ( srna , " premul " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " x " ) ;
2009-09-10 01:14:21 +00:00
RNA_def_property_range ( prop , 0.0f , 1.0f ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_ui_text ( prop , " Premul " , " Mix Factor " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-03 00:40:38 +00:00
}
2009-09-19 19:57:30 +00:00
static void def_cmp_hue_saturation ( StructRNA * srna )
{
PropertyRNA * prop ;
RNA_def_struct_sdna_from ( srna , " NodeHueSat " , " storage " ) ;
2010-08-21 04:51:00 +00:00
prop = RNA_def_property ( srna , " color_hue " , PROP_FLOAT , PROP_NONE ) ;
2009-09-19 19:57:30 +00:00
RNA_def_property_float_sdna ( prop , NULL , " hue " ) ;
RNA_def_property_range ( prop , 0.0f , 1.0f ) ;
RNA_def_property_ui_text ( prop , " Hue " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-09-19 19:57:30 +00:00
2010-08-21 04:51:00 +00:00
prop = RNA_def_property ( srna , " color_saturation " , PROP_FLOAT , PROP_NONE ) ;
2009-09-19 19:57:30 +00:00
RNA_def_property_float_sdna ( prop , NULL , " sat " ) ;
RNA_def_property_range ( prop , 0.0f , 2.0f ) ;
RNA_def_property_ui_text ( prop , " Saturation " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-09-19 19:57:30 +00:00
2010-08-21 04:51:00 +00:00
prop = RNA_def_property ( srna , " color_value " , PROP_FLOAT , PROP_NONE ) ;
2009-09-19 19:57:30 +00:00
RNA_def_property_float_sdna ( prop , NULL , " val " ) ;
RNA_def_property_range ( prop , 0.0f , 2.0f ) ;
RNA_def_property_ui_text ( prop , " Value " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-09-19 19:57:30 +00:00
}
2009-06-04 14:11:39 +00:00
static void def_cmp_blur ( StructRNA * srna )
2009-05-31 16:45:30 +00:00
{
PropertyRNA * prop ;
2009-06-04 13:55:02 +00:00
static EnumPropertyItem filter_type_items [ ] = {
2009-06-16 00:52:21 +00:00
{ R_FILTER_BOX , " FLAT " , 0 , " Flat " , " " } ,
{ R_FILTER_TENT , " TENT " , 0 , " Tent " , " " } ,
{ R_FILTER_QUAD , " QUAD " , 0 , " Quadratic " , " " } ,
{ R_FILTER_CUBIC , " CUBIC " , 0 , " Cubic " , " " } ,
{ R_FILTER_GAUSS , " GAUSS " , 0 , " Gaussian " , " " } ,
{ R_FILTER_FAST_GAUSS , " FAST_GAUSS " , 0 , " Fast Gaussian " , " " } ,
{ R_FILTER_CATROM , " CATROM " , 0 , " Catrom " , " " } ,
{ R_FILTER_MITCH , " MITCH " , 0 , " Mitch " , " " } ,
2009-11-01 10:45:42 +00:00
{ 0 , NULL , 0 , NULL , NULL } } ;
2009-06-03 00:40:38 +00:00
2011-02-10 18:54:49 +00:00
static EnumPropertyItem size_type_items [ ] = {
{ CMP_NODE_BLUR_SIZE_PIXEL , " PIXEL " , 0 , " Pixel " , " " } ,
{ CMP_NODE_BLUR_SIZE_WIDTH , " WIDTH " , 0 , " Width " , " " } ,
{ CMP_NODE_BLUR_SIZE_HEIGHT , " HEIGHT " , 0 , " Height " , " " } ,
{ CMP_NODE_BLUR_SIZE_BOTH , " BOTH " , 0 , " Both " , " " } ,
{ 0 , NULL , 0 , NULL , NULL } } ;
2009-06-03 00:40:38 +00:00
RNA_def_struct_sdna_from ( srna , " NodeBlurData " , " storage " ) ;
2009-05-31 16:45:30 +00:00
2010-08-20 06:09:58 +00:00
prop = RNA_def_property ( srna , " size_x " , PROP_INT , PROP_NONE ) ;
2009-05-31 16:45:30 +00:00
RNA_def_property_int_sdna ( prop , NULL , " sizex " ) ;
2010-09-22 08:51:18 +00:00
RNA_def_property_range ( prop , 0 , 2048 ) ;
2009-05-31 16:45:30 +00:00
RNA_def_property_ui_text ( prop , " Size X " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-05-31 16:45:30 +00:00
2010-08-20 06:09:58 +00:00
prop = RNA_def_property ( srna , " size_y " , PROP_INT , PROP_NONE ) ;
2009-05-31 16:45:30 +00:00
RNA_def_property_int_sdna ( prop , NULL , " sizey " ) ;
2010-09-22 08:51:18 +00:00
RNA_def_property_range ( prop , 0 , 2048 ) ;
2009-05-31 16:45:30 +00:00
RNA_def_property_ui_text ( prop , " Size Y " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-09-10 01:14:21 +00:00
2011-02-10 18:54:49 +00:00
prop = RNA_def_property ( srna , " size_type " , PROP_ENUM , PROP_NONE ) ;
RNA_def_property_enum_sdna ( prop , NULL , " size_type " ) ;
RNA_def_property_enum_items ( prop , size_type_items ) ;
RNA_def_property_ui_text ( prop , " Size Type " , " Mode of filter size calculation " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-05-31 16:45:30 +00:00
prop = RNA_def_property ( srna , " factor " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " fac " ) ;
2009-09-10 01:14:21 +00:00
RNA_def_property_range ( prop , 0.0f , 2.0f ) ;
2009-05-31 16:45:30 +00:00
RNA_def_property_ui_text ( prop , " Factor " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-05-31 16:45:30 +00:00
2011-02-10 18:54:49 +00:00
prop = RNA_def_property ( srna , " factor_x " , PROP_FLOAT , PROP_PERCENTAGE ) ;
2009-05-31 16:45:30 +00:00
RNA_def_property_float_sdna ( prop , NULL , " percentx " ) ;
2011-02-10 18:54:49 +00:00
RNA_def_property_range ( prop , 0.0f , 100.0f ) ;
2009-05-31 16:45:30 +00:00
RNA_def_property_ui_text ( prop , " Relative Size X " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-05-31 16:45:30 +00:00
2011-02-10 18:54:49 +00:00
prop = RNA_def_property ( srna , " factor_y " , PROP_FLOAT , PROP_PERCENTAGE ) ;
2009-05-31 16:45:30 +00:00
RNA_def_property_float_sdna ( prop , NULL , " percenty " ) ;
2011-02-10 18:54:49 +00:00
RNA_def_property_range ( prop , 0.0f , 100.0f ) ;
2009-05-31 16:45:30 +00:00
RNA_def_property_ui_text ( prop , " Relative Size Y " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-05-31 16:45:30 +00:00
prop = RNA_def_property ( srna , " filter_type " , PROP_ENUM , PROP_NONE ) ;
RNA_def_property_enum_sdna ( prop , NULL , " filtertype " ) ;
RNA_def_property_enum_items ( prop , filter_type_items ) ;
RNA_def_property_ui_text ( prop , " Filter Type " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-05-31 16:45:30 +00:00
2010-08-21 04:51:00 +00:00
prop = RNA_def_property ( srna , " use_bokeh " , PROP_BOOLEAN , PROP_NONE ) ;
2009-05-31 16:45:30 +00:00
RNA_def_property_boolean_sdna ( prop , NULL , " bokeh " , 1 ) ;
2010-07-07 18:39:08 +00:00
RNA_def_property_ui_text ( prop , " Bokeh " , " Uses circular filter (slower) " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-05-31 16:45:30 +00:00
2010-08-21 04:51:00 +00:00
prop = RNA_def_property ( srna , " use_gamma_correction " , PROP_BOOLEAN , PROP_NONE ) ;
2009-05-31 16:45:30 +00:00
RNA_def_property_boolean_sdna ( prop , NULL , " gamma " , 1 ) ;
2010-07-07 18:39:08 +00:00
RNA_def_property_ui_text ( prop , " Gamma " , " Applies filter on gamma corrected values " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-05-31 16:45:30 +00:00
}
2009-06-04 14:11:39 +00:00
static void def_cmp_filter ( StructRNA * srna )
2009-06-03 00:40:38 +00:00
{
PropertyRNA * prop ;
2009-05-31 16:45:30 +00:00
2009-07-21 00:55:20 +00:00
prop = RNA_def_property ( srna , " filter_type " , PROP_ENUM , PROP_NONE ) ;
2009-06-03 00:40:38 +00:00
RNA_def_property_enum_sdna ( prop , NULL , " custom1 " ) ;
2009-09-16 18:59:13 +00:00
RNA_def_property_enum_items ( prop , node_filter_items ) ;
2009-07-21 00:55:20 +00:00
RNA_def_property_ui_text ( prop , " Filter Type " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-03 00:40:38 +00:00
}
2009-03-24 17:40:58 +00:00
2009-06-04 14:11:39 +00:00
static void def_cmp_map_value ( StructRNA * srna )
2009-05-31 16:45:30 +00:00
{
PropertyRNA * prop ;
2009-06-03 00:40:38 +00:00
RNA_def_struct_sdna_from ( srna , " TexMapping " , " storage " ) ;
prop = RNA_def_property ( srna , " offset " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " loc " ) ;
2009-09-19 19:57:30 +00:00
RNA_def_property_array ( prop , 1 ) ;
2009-09-10 01:14:21 +00:00
RNA_def_property_range ( prop , - 1000.0f , 1000.0f ) ;
2009-06-03 00:40:38 +00:00
RNA_def_property_ui_text ( prop , " Offset " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-03 00:40:38 +00:00
prop = RNA_def_property ( srna , " size " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " size " ) ;
2009-09-19 19:57:30 +00:00
RNA_def_property_array ( prop , 1 ) ;
2009-09-10 01:14:21 +00:00
RNA_def_property_range ( prop , - 1000.0f , 1000.0f ) ;
2009-06-03 00:40:38 +00:00
RNA_def_property_ui_text ( prop , " Size " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-03 00:40:38 +00:00
prop = RNA_def_property ( srna , " use_min " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " flag " , TEXMAP_CLIP_MIN ) ;
RNA_def_property_ui_text ( prop , " Use Minimum " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-03 00:40:38 +00:00
prop = RNA_def_property ( srna , " use_max " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " flag " , TEXMAP_CLIP_MAX ) ;
RNA_def_property_ui_text ( prop , " Use Maximum " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-03 00:40:38 +00:00
prop = RNA_def_property ( srna , " min " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " min " ) ;
2009-09-19 19:57:30 +00:00
RNA_def_property_array ( prop , 1 ) ;
2009-09-10 01:14:21 +00:00
RNA_def_property_range ( prop , - 1000.0f , 1000.0f ) ;
2009-06-03 00:40:38 +00:00
RNA_def_property_ui_text ( prop , " Minimum " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-03 00:40:38 +00:00
prop = RNA_def_property ( srna , " max " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " max " ) ;
2009-09-19 19:57:30 +00:00
RNA_def_property_array ( prop , 1 ) ;
2009-09-10 01:14:21 +00:00
RNA_def_property_range ( prop , - 1000.0f , 1000.0f ) ;
2009-06-03 00:40:38 +00:00
RNA_def_property_ui_text ( prop , " Maximum " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-03 00:40:38 +00:00
}
2009-06-04 14:11:39 +00:00
static void def_cmp_vector_blur ( StructRNA * srna )
2009-06-03 00:40:38 +00:00
{
PropertyRNA * prop ;
RNA_def_struct_sdna_from ( srna , " NodeBlurData " , " storage " ) ;
prop = RNA_def_property ( srna , " samples " , PROP_INT , PROP_NONE ) ;
RNA_def_property_int_sdna ( prop , NULL , " samples " ) ;
2010-08-17 09:41:56 +00:00
RNA_def_property_range ( prop , 1 , 256 ) ;
2009-06-03 00:40:38 +00:00
RNA_def_property_ui_text ( prop , " Samples " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-03 00:40:38 +00:00
2010-08-20 06:09:58 +00:00
prop = RNA_def_property ( srna , " speed_min " , PROP_INT , PROP_NONE ) ;
2009-06-03 00:40:38 +00:00
RNA_def_property_int_sdna ( prop , NULL , " minspeed " ) ;
2010-08-17 09:41:56 +00:00
RNA_def_property_range ( prop , 0 , 1024 ) ;
2009-06-03 00:40:38 +00:00
RNA_def_property_ui_text ( prop , " Min Speed " , " Minimum speed for a pixel to be blurred; used to separate background from foreground " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-03 00:40:38 +00:00
2010-08-20 06:09:58 +00:00
prop = RNA_def_property ( srna , " speed_max " , PROP_INT , PROP_NONE ) ;
2009-06-03 00:40:38 +00:00
RNA_def_property_int_sdna ( prop , NULL , " maxspeed " ) ;
2010-08-17 09:41:56 +00:00
RNA_def_property_range ( prop , 0 , 1024 ) ;
2009-09-16 18:59:13 +00:00
RNA_def_property_ui_text ( prop , " Max Speed " , " Maximum speed, or zero for none " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-03 00:40:38 +00:00
prop = RNA_def_property ( srna , " factor " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " fac " ) ;
2010-08-17 09:41:56 +00:00
RNA_def_property_range ( prop , 0.0f , 2.0f ) ;
2009-06-03 00:40:38 +00:00
RNA_def_property_ui_text ( prop , " Blur Factor " , " Scaling factor for motion vectors; actually 'shutter speed' in frames " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-03 00:40:38 +00:00
2010-08-21 04:51:00 +00:00
prop = RNA_def_property ( srna , " use_curved " , PROP_BOOLEAN , PROP_NONE ) ;
2009-06-03 00:40:38 +00:00
RNA_def_property_boolean_sdna ( prop , NULL , " curved " , 1 ) ;
RNA_def_property_ui_text ( prop , " Curved " , " Interpolate between frames in a bezier curve, rather than linearly " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-03 00:40:38 +00:00
}
2009-05-31 16:45:30 +00:00
2009-09-20 13:34:54 +00:00
static void def_cmp_levels ( StructRNA * srna )
{
PropertyRNA * prop ;
2009-11-10 04:01:44 +00:00
static EnumPropertyItem channel_items [ ] = {
{ 1 , " COMBINED_RGB " , 0 , " C " , " Combined RGB " } ,
2009-09-20 13:34:54 +00:00
{ 2 , " RED " , 0 , " R " , " Red Channel " } ,
{ 3 , " GREEN " , 0 , " G " , " Green Channel " } ,
{ 4 , " BLUE " , 0 , " B " , " Blue Channel " } ,
{ 5 , " LUMINANCE " , 0 , " L " , " Luminance Channel " } ,
2009-11-01 10:45:42 +00:00
{ 0 , NULL , 0 , NULL , NULL } } ;
2009-09-20 13:34:54 +00:00
2009-11-10 04:01:44 +00:00
prop = RNA_def_property ( srna , " channel " , PROP_ENUM , PROP_NONE ) ;
2009-09-20 13:34:54 +00:00
RNA_def_property_enum_sdna ( prop , NULL , " custom1 " ) ;
2009-11-10 04:01:44 +00:00
RNA_def_property_enum_items ( prop , channel_items ) ;
RNA_def_property_ui_text ( prop , " Channel " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-09-20 13:34:54 +00:00
}
2009-06-04 14:11:39 +00:00
static void def_cmp_image ( StructRNA * srna )
2009-06-03 00:40:38 +00:00
{
PropertyRNA * prop ;
2009-11-10 04:01:44 +00:00
/*
static EnumPropertyItem type_items [ ] = {
2009-06-16 00:52:21 +00:00
{ IMA_SRC_FILE , " IMAGE " , 0 , " Image " , " " } ,
2009-06-04 13:55:02 +00:00
{ IMA_SRC_MOVIE , " MOVIE " , " Movie " , " " } ,
{ IMA_SRC_SEQUENCE , " SEQUENCE " , " Sequence " , " " } ,
{ IMA_SRC_GENERATED , " GENERATED " , " Generated " , " " } ,
2009-11-10 04:01:44 +00:00
{ 0 , NULL , 0 , NULL , NULL } } ;
*/
2009-06-04 13:55:02 +00:00
prop = RNA_def_property ( srna , " image " , PROP_POINTER , PROP_NONE ) ;
RNA_def_property_pointer_sdna ( prop , NULL , " id " ) ;
RNA_def_property_struct_type ( prop , " Image " ) ;
RNA_def_property_flag ( prop , PROP_EDITABLE ) ;
RNA_def_property_ui_text ( prop , " Image " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-04 13:55:02 +00:00
2009-06-03 00:40:38 +00:00
RNA_def_struct_sdna_from ( srna , " ImageUser " , " storage " ) ;
2009-06-04 13:55:02 +00:00
2010-08-21 04:51:00 +00:00
prop = RNA_def_property ( srna , " frame_duration " , PROP_INT , PROP_NONE ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_int_sdna ( prop , NULL , " frames " ) ;
2010-08-25 02:00:55 +00:00
RNA_def_property_range ( prop , 0 , MAXFRAMEF ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_ui_text ( prop , " Frames " , " Number of images used in animation " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-04 13:55:02 +00:00
2010-08-21 04:51:00 +00:00
prop = RNA_def_property ( srna , " frame_start " , PROP_INT , PROP_NONE ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_int_sdna ( prop , NULL , " sfra " ) ;
2010-09-15 03:45:33 +00:00
RNA_def_property_range ( prop , MINAFRAMEF , MAXFRAMEF ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_ui_text ( prop , " Start Frame " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-04 13:55:02 +00:00
2010-08-21 04:51:00 +00:00
prop = RNA_def_property ( srna , " frame_offset " , PROP_INT , PROP_NONE ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_int_sdna ( prop , NULL , " offset " ) ;
2009-10-11 07:29:53 +00:00
RNA_def_property_range ( prop , MINAFRAMEF , MAXFRAMEF ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_ui_text ( prop , " Offset " , " Offsets the number of the frame to use in the animation " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-04 13:55:02 +00:00
2010-08-21 04:51:00 +00:00
prop = RNA_def_property ( srna , " use_cyclic " , PROP_BOOLEAN , PROP_NONE ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_boolean_sdna ( prop , NULL , " cycl " , 1 ) ;
RNA_def_property_ui_text ( prop , " Cyclic " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-04 13:55:02 +00:00
2010-08-20 06:09:58 +00:00
prop = RNA_def_property ( srna , " use_auto_refresh " , PROP_BOOLEAN , PROP_NONE ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_boolean_sdna ( prop , NULL , " flag " , IMA_ANIM_ALWAYS ) ;
RNA_def_property_ui_text ( prop , " Auto-Refresh " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-04 13:55:02 +00:00
2009-11-10 04:01:44 +00:00
prop = RNA_def_property ( srna , " layer " , PROP_ENUM , PROP_NONE ) ;
RNA_def_property_enum_sdna ( prop , NULL , " layer " ) ;
RNA_def_property_enum_items ( prop , prop_image_layer_items ) ;
RNA_def_property_enum_funcs ( prop , NULL , NULL , " rna_Node_image_layer_itemf " ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_ui_text ( prop , " Layer " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_image_layer_update " ) ;
2009-06-03 00:40:38 +00:00
}
2009-05-31 16:45:30 +00:00
2009-06-04 14:11:39 +00:00
static void def_cmp_render_layers ( StructRNA * srna )
2009-06-03 00:40:38 +00:00
{
PropertyRNA * prop ;
2009-06-04 13:55:02 +00:00
prop = RNA_def_property ( srna , " scene " , PROP_POINTER , PROP_NONE ) ;
RNA_def_property_pointer_sdna ( prop , NULL , " id " ) ;
2010-12-02 01:18:59 +00:00
RNA_def_property_pointer_funcs ( prop , NULL , " rna_Node_scene_set " , NULL , NULL ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_struct_type ( prop , " Scene " ) ;
2010-12-02 01:18:59 +00:00
RNA_def_property_flag ( prop , PROP_EDITABLE | PROP_ID_SELF_CHECK ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_ui_text ( prop , " Scene " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-04 13:55:02 +00:00
2009-11-10 04:01:44 +00:00
prop = RNA_def_property ( srna , " layer " , PROP_ENUM , PROP_NONE ) ;
RNA_def_property_enum_sdna ( prop , NULL , " custom1 " ) ;
RNA_def_property_enum_items ( prop , prop_scene_layer_items ) ;
RNA_def_property_enum_funcs ( prop , NULL , NULL , " rna_Node_scene_layer_itemf " ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_ui_text ( prop , " Layer " , " " ) ;
2009-11-11 12:38:22 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-05-31 16:45:30 +00:00
}
2009-06-04 14:11:39 +00:00
static void def_cmp_output_file ( StructRNA * srna )
2009-05-31 16:45:30 +00:00
{
PropertyRNA * prop ;
2009-06-03 00:40:38 +00:00
2009-06-04 13:55:02 +00:00
static EnumPropertyItem type_items [ ] = {
2009-06-16 00:52:21 +00:00
{ R_TARGA , " TARGA " , 0 , " Targa " , " " } ,
{ R_RAWTGA , " RAW_TARGA " , 0 , " Targa Raw " , " " } ,
{ R_PNG , " PNG " , 0 , " PNG " , " " } ,
{ R_BMP , " BMP " , 0 , " BMP " , " " } ,
{ R_JPEG90 , " JPEG " , 0 , " JPEG " , " " } ,
{ R_IRIS , " IRIS " , 0 , " IRIS " , " " } ,
{ R_RADHDR , " RADIANCE_HDR " , 0 , " Radiance HDR " , " " } ,
{ R_CINEON , " CINEON " , 0 , " Cineon " , " " } ,
{ R_DPX , " DPX " , 0 , " DPX " , " " } ,
{ R_OPENEXR , " OPENEXR " , 0 , " OpenEXR " , " " } ,
2009-10-27 21:54:29 +00:00
{ 0 , NULL , 0 , NULL , NULL } } ;
2009-06-04 13:55:02 +00:00
static EnumPropertyItem openexr_codec_items [ ] = {
2009-06-16 00:52:21 +00:00
{ 0 , " NONE " , 0 , " None " , " " } ,
{ 1 , " PXR24 " , 0 , " Pxr24 (lossy) " , " " } ,
{ 2 , " ZIP " , 0 , " ZIP (lossless) " , " " } ,
2010-11-21 17:32:57 +00:00
{ 3 , " PIZ " , 0 , " PIZ (lossless) " , " " } ,
2009-06-16 00:52:21 +00:00
{ 4 , " RLE " , 0 , " RLE (lossless) " , " " } ,
2009-10-27 21:54:29 +00:00
{ 0 , NULL , 0 , NULL , NULL } } ;
2009-06-04 13:55:02 +00:00
RNA_def_struct_sdna_from ( srna , " NodeImageFile " , " storage " ) ;
2009-06-03 00:40:38 +00:00
2010-12-18 16:52:17 +00:00
prop = RNA_def_property ( srna , " filepath " , PROP_STRING , PROP_FILEPATH ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_string_sdna ( prop , NULL , " name " ) ;
2010-06-04 12:01:57 +00:00
RNA_def_property_ui_text ( prop , " File Path " , " Output path for the image, same functionality as render output. " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-03 00:40:38 +00:00
2009-07-21 00:55:20 +00:00
prop = RNA_def_property ( srna , " image_type " , PROP_ENUM , PROP_NONE ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_enum_sdna ( prop , NULL , " imtype " ) ;
RNA_def_property_enum_items ( prop , type_items ) ;
2009-07-21 00:55:20 +00:00
RNA_def_property_ui_text ( prop , " Image Type " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-04 13:55:02 +00:00
2010-08-20 06:09:58 +00:00
prop = RNA_def_property ( srna , " use_exr_half " , PROP_BOOLEAN , PROP_NONE ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_boolean_sdna ( prop , NULL , " subimtype " , R_OPENEXR_HALF ) ;
RNA_def_property_ui_text ( prop , " Half " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-04 13:55:02 +00:00
2009-10-27 21:54:29 +00:00
prop = RNA_def_property ( srna , " exr_codec " , PROP_ENUM , PROP_NONE ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_enum_sdna ( prop , NULL , " codec " ) ;
RNA_def_property_enum_items ( prop , openexr_codec_items ) ;
RNA_def_property_ui_text ( prop , " Codec " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-04 13:55:02 +00:00
prop = RNA_def_property ( srna , " quality " , PROP_INT , PROP_NONE ) ;
RNA_def_property_int_sdna ( prop , NULL , " quality " ) ;
2009-10-28 22:14:31 +00:00
RNA_def_property_range ( prop , 1 , 100 ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_ui_text ( prop , " Quality " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2010-08-17 09:59:55 +00:00
2010-04-01 21:44:56 +00:00
prop = RNA_def_property ( srna , " frame_start " , PROP_INT , PROP_NONE ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_int_sdna ( prop , NULL , " sfra " ) ;
2010-08-17 09:59:55 +00:00
RNA_def_property_int_funcs ( prop , NULL , " rna_Image_start_frame_set " , NULL ) ;
2009-10-11 07:29:53 +00:00
RNA_def_property_range ( prop , MINFRAMEF , MAXFRAMEF ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_ui_text ( prop , " Start Frame " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-04 13:55:02 +00:00
2010-04-01 21:44:56 +00:00
prop = RNA_def_property ( srna , " frame_end " , PROP_INT , PROP_NONE ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_int_sdna ( prop , NULL , " efra " ) ;
2010-08-17 09:59:55 +00:00
RNA_def_property_int_funcs ( prop , NULL , " rna_Image_end_frame_set " , NULL ) ;
2009-10-11 07:29:53 +00:00
RNA_def_property_range ( prop , MINFRAMEF , MAXFRAMEF ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_ui_text ( prop , " End Frame " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-05-31 16:45:30 +00:00
}
2009-06-04 14:11:39 +00:00
static void def_cmp_dilate_erode ( StructRNA * srna )
2009-05-31 16:45:30 +00:00
{
PropertyRNA * prop ;
2009-06-03 00:40:38 +00:00
prop = RNA_def_property ( srna , " distance " , PROP_INT , PROP_NONE ) ;
RNA_def_property_int_sdna ( prop , NULL , " custom2 " ) ;
2009-09-19 19:57:30 +00:00
RNA_def_property_range ( prop , - 100 , 100 ) ;
2009-06-03 00:40:38 +00:00
RNA_def_property_ui_text ( prop , " Distance " , " Distance to grow/shrink (number of iterations) " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-03 00:40:38 +00:00
}
2009-05-31 16:45:30 +00:00
2009-06-04 14:11:39 +00:00
static void def_cmp_scale ( StructRNA * srna )
2009-06-03 00:40:38 +00:00
{
PropertyRNA * prop ;
2009-06-04 13:55:02 +00:00
static EnumPropertyItem space_items [ ] = {
2009-06-16 00:52:21 +00:00
{ 0 , " RELATIVE " , 0 , " Relative " , " " } ,
{ 1 , " ABSOLUTE " , 0 , " Absolute " , " " } ,
{ 2 , " SCENE_SIZE " , 0 , " Scene Size " , " " } ,
2010-07-08 20:58:34 +00:00
{ 3 , " RENDER_SIZE " , 0 , " Render Size " , " " } ,
2009-11-01 10:45:42 +00:00
{ 0 , NULL , 0 , NULL , NULL } } ;
2009-05-31 16:45:30 +00:00
2009-06-03 00:40:38 +00:00
prop = RNA_def_property ( srna , " space " , PROP_ENUM , PROP_NONE ) ;
2009-05-31 16:45:30 +00:00
RNA_def_property_enum_sdna ( prop , NULL , " custom1 " ) ;
2009-06-03 00:40:38 +00:00
RNA_def_property_enum_items ( prop , space_items ) ;
RNA_def_property_ui_text ( prop , " Space " , " Coordinate space to scale relative to " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2010-03-15 22:36:39 +00:00
}
static void def_cmp_rotate ( StructRNA * srna )
{
PropertyRNA * prop ;
static EnumPropertyItem rotate_items [ ] = {
{ 0 , " NEAREST " , 0 , " Nearest " , " " } ,
{ 1 , " BILINEAR " , 0 , " Bilinear " , " " } ,
{ 2 , " BICUBIC " , 0 , " Bicubic " , " " } ,
{ 0 , NULL , 0 , NULL , NULL } } ;
2010-08-21 04:51:00 +00:00
prop = RNA_def_property ( srna , " filter_type " , PROP_ENUM , PROP_NONE ) ;
2010-03-15 22:36:39 +00:00
RNA_def_property_enum_sdna ( prop , NULL , " custom1 " ) ;
RNA_def_property_enum_items ( prop , rotate_items ) ;
RNA_def_property_ui_text ( prop , " Filter " , " Method to use to filter rotation " ) ;
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-05-31 16:45:30 +00:00
}
2009-06-04 14:11:39 +00:00
static void def_cmp_diff_matte ( StructRNA * srna )
2009-06-03 00:40:38 +00:00
{
PropertyRNA * prop ;
2009-09-10 04:12:22 +00:00
RNA_def_struct_sdna_from ( srna , " NodeChroma " , " storage " ) ;
2009-06-03 00:40:38 +00:00
2009-09-10 04:12:22 +00:00
prop = RNA_def_property ( srna , " tolerance " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " t1 " ) ;
2009-10-27 13:46:02 +00:00
RNA_def_property_float_funcs ( prop , NULL , " rna_Matte_t1_set " , NULL ) ;
2009-09-10 04:12:22 +00:00
RNA_def_property_range ( prop , 0.0f , 1.0f ) ;
2010-02-10 21:15:44 +00:00
RNA_def_property_ui_text ( prop , " Tolerance " , " Color distances below this threshold are keyed " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-03 00:40:38 +00:00
2009-09-10 04:12:22 +00:00
prop = RNA_def_property ( srna , " falloff " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " t2 " ) ;
2009-10-27 13:46:02 +00:00
RNA_def_property_float_funcs ( prop , NULL , " rna_Matte_t2_set " , NULL ) ;
2009-09-10 04:12:22 +00:00
RNA_def_property_range ( prop , 0.0f , 1.0f ) ;
2010-02-10 21:15:44 +00:00
RNA_def_property_ui_text ( prop , " Falloff " , " Color distances below this additional threshold are partially keyed " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-09-10 04:12:22 +00:00
}
static void def_cmp_color_matte ( StructRNA * srna )
{
PropertyRNA * prop ;
2009-06-03 00:40:38 +00:00
RNA_def_struct_sdna_from ( srna , " NodeChroma " , " storage " ) ;
2009-10-27 13:46:02 +00:00
2010-08-21 04:51:00 +00:00
prop = RNA_def_property ( srna , " color_hue " , PROP_FLOAT , PROP_NONE ) ;
2009-06-03 00:40:38 +00:00
RNA_def_property_float_sdna ( prop , NULL , " t1 " ) ;
2009-09-10 01:14:21 +00:00
RNA_def_property_range ( prop , 0.0f , 1.0f ) ;
2009-09-10 04:12:22 +00:00
RNA_def_property_ui_text ( prop , " H " , " Hue tolerance for colors to be considered a keying color " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-03 00:40:38 +00:00
2010-08-21 04:51:00 +00:00
prop = RNA_def_property ( srna , " color_saturation " , PROP_FLOAT , PROP_NONE ) ;
2009-06-03 00:40:38 +00:00
RNA_def_property_float_sdna ( prop , NULL , " t2 " ) ;
2009-09-10 01:14:21 +00:00
RNA_def_property_range ( prop , 0.0f , 1.0f ) ;
2009-09-10 04:12:22 +00:00
RNA_def_property_ui_text ( prop , " S " , " Saturation Tolerance for the color " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-03 00:40:38 +00:00
2010-08-21 04:51:00 +00:00
prop = RNA_def_property ( srna , " color_value " , PROP_FLOAT , PROP_NONE ) ;
2009-06-03 00:40:38 +00:00
RNA_def_property_float_sdna ( prop , NULL , " t3 " ) ;
2009-09-10 01:14:21 +00:00
RNA_def_property_range ( prop , 0.0f , 1.0f ) ;
2009-09-10 04:12:22 +00:00
RNA_def_property_ui_text ( prop , " V " , " Value Tolerance for the color " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-09-10 04:12:22 +00:00
}
static void def_cmp_distance_matte ( StructRNA * srna )
{
PropertyRNA * prop ;
RNA_def_struct_sdna_from ( srna , " NodeChroma " , " storage " ) ;
prop = RNA_def_property ( srna , " tolerance " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " t1 " ) ;
2009-10-27 13:46:02 +00:00
RNA_def_property_float_funcs ( prop , NULL , " rna_Matte_t1_set " , NULL ) ;
2009-09-10 04:12:22 +00:00
RNA_def_property_range ( prop , 0.0f , 1.0f ) ;
2010-02-10 21:15:44 +00:00
RNA_def_property_ui_text ( prop , " Tolerance " , " Color distances below this threshold are keyed " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-03 00:40:38 +00:00
prop = RNA_def_property ( srna , " falloff " , PROP_FLOAT , PROP_NONE ) ;
2009-09-10 04:12:22 +00:00
RNA_def_property_float_sdna ( prop , NULL , " t2 " ) ;
2009-10-27 13:46:02 +00:00
RNA_def_property_float_funcs ( prop , NULL , " rna_Matte_t2_set " , NULL ) ;
2009-09-10 01:14:21 +00:00
RNA_def_property_range ( prop , 0.0f , 1.0f ) ;
2010-02-10 21:15:44 +00:00
RNA_def_property_ui_text ( prop , " Falloff " , " Color distances below this additional threshold are partially keyed " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-03 00:40:38 +00:00
}
2009-05-31 16:45:30 +00:00
2009-06-04 14:11:39 +00:00
static void def_cmp_color_spill ( StructRNA * srna )
2009-06-03 00:40:38 +00:00
{
PropertyRNA * prop ;
2010-03-12 18:47:35 +00:00
2009-06-04 13:55:02 +00:00
static EnumPropertyItem channel_items [ ] = {
2009-09-20 13:34:54 +00:00
{ 1 , " R " , 0 , " R " , " Red Spill Suppression " } ,
{ 2 , " G " , 0 , " G " , " Green Spill Suppression " } ,
{ 3 , " B " , 0 , " B " , " Blue Spill Suppression " } ,
2009-11-01 10:45:42 +00:00
{ 0 , NULL , 0 , NULL , NULL } } ;
2010-03-12 18:47:35 +00:00
static EnumPropertyItem limit_channel_items [ ] = {
{ 1 , " R " , 0 , " R " , " Limit by Red " } ,
{ 2 , " G " , 0 , " G " , " Limit by Green " } ,
{ 3 , " B " , 0 , " B " , " Limit by Blue " } ,
{ 0 , NULL , 0 , NULL , NULL } } ;
static EnumPropertyItem algorithm_items [ ] = {
{ 0 , " SIMPLE " , 0 , " Simple " , " Simple Limit Algorithm " } ,
{ 1 , " AVERAGE " , 0 , " Average " , " Average Limit Algorithm " } ,
{ 0 , NULL , 0 , NULL , NULL } } ;
2009-06-03 00:40:38 +00:00
prop = RNA_def_property ( srna , " channel " , PROP_ENUM , PROP_NONE ) ;
RNA_def_property_enum_sdna ( prop , NULL , " custom1 " ) ;
RNA_def_property_enum_items ( prop , channel_items ) ;
RNA_def_property_ui_text ( prop , " Channel " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-03 00:40:38 +00:00
2010-08-20 06:09:58 +00:00
prop = RNA_def_property ( srna , " limit_method " , PROP_ENUM , PROP_NONE ) ;
2010-03-12 18:47:35 +00:00
RNA_def_property_enum_sdna ( prop , NULL , " custom2 " ) ;
RNA_def_property_enum_items ( prop , algorithm_items ) ;
RNA_def_property_ui_text ( prop , " Algorithm " , " " ) ;
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
RNA_def_struct_sdna_from ( srna , " NodeColorspill " , " storage " ) ;
prop = RNA_def_property ( srna , " limit_channel " , PROP_ENUM , PROP_NONE ) ;
RNA_def_property_enum_sdna ( prop , NULL , " limchan " ) ;
RNA_def_property_enum_items ( prop , limit_channel_items ) ;
RNA_def_property_ui_text ( prop , " Limit Channel " , " " ) ;
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
prop = RNA_def_property ( srna , " ratio " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " limscale " ) ;
RNA_def_property_range ( prop , 0.5f , 1.5f ) ;
RNA_def_property_ui_text ( prop , " Ratio " , " Scale limit by value " ) ;
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2010-08-20 06:09:58 +00:00
prop = RNA_def_property ( srna , " use_unspill " , PROP_BOOLEAN , PROP_NONE ) ;
2010-03-12 18:47:35 +00:00
RNA_def_property_boolean_sdna ( prop , NULL , " unspill " , 0 ) ;
RNA_def_property_ui_text ( prop , " Unspill " , " Compensate all channels (diffenrently) by hand " ) ;
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
prop = RNA_def_property ( srna , " unspill_red " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " uspillr " ) ;
RNA_def_property_range ( prop , 0.0f , 1.5f ) ;
RNA_def_property_ui_text ( prop , " R " , " Red spillmap scale " ) ;
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
prop = RNA_def_property ( srna , " unspill_green " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " uspillg " ) ;
RNA_def_property_range ( prop , 0.0f , 1.5f ) ;
RNA_def_property_ui_text ( prop , " G " , " Green spillmap scale " ) ;
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
prop = RNA_def_property ( srna , " unspill_blue " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " uspillb " ) ;
RNA_def_property_range ( prop , 0.0f , 1.5f ) ;
RNA_def_property_ui_text ( prop , " B " , " Blue spillmap scale " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-03 00:40:38 +00:00
}
2009-05-31 16:45:30 +00:00
2009-10-27 13:46:02 +00:00
static void def_cmp_luma_matte ( StructRNA * srna )
{
PropertyRNA * prop ;
RNA_def_struct_sdna_from ( srna , " NodeChroma " , " storage " ) ;
2010-08-21 04:51:00 +00:00
prop = RNA_def_property ( srna , " limit_max " , PROP_FLOAT , PROP_NONE ) ;
2009-10-27 13:46:02 +00:00
RNA_def_property_float_sdna ( prop , NULL , " t1 " ) ;
RNA_def_property_float_funcs ( prop , NULL , " rna_Matte_t1_set " , NULL ) ;
RNA_def_property_range ( prop , 0.0f , 1.0f ) ;
RNA_def_property_ui_text ( prop , " High " , " Values higher than this setting are 100% opaque " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-10-27 13:46:02 +00:00
2010-08-21 04:51:00 +00:00
prop = RNA_def_property ( srna , " limit_min " , PROP_FLOAT , PROP_NONE ) ;
2009-10-27 13:46:02 +00:00
RNA_def_property_float_sdna ( prop , NULL , " t2 " ) ;
RNA_def_property_float_funcs ( prop , NULL , " rna_Matte_t2_set " , NULL ) ;
RNA_def_property_range ( prop , 0.0f , 1.0f ) ;
RNA_def_property_ui_text ( prop , " Low " , " Values lower than this setting are 100% keyed " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-10-27 13:46:02 +00:00
}
2009-09-10 04:12:22 +00:00
static void def_cmp_chroma_matte ( StructRNA * srna )
2009-05-31 16:45:30 +00:00
{
PropertyRNA * prop ;
2009-06-03 00:40:38 +00:00
RNA_def_struct_sdna_from ( srna , " NodeChroma " , " storage " ) ;
2009-05-31 16:45:30 +00:00
2010-08-20 06:09:58 +00:00
prop = RNA_def_property ( srna , " tolerance " , PROP_FLOAT , PROP_NONE ) ;
2009-06-03 00:40:38 +00:00
RNA_def_property_float_sdna ( prop , NULL , " t1 " ) ;
2009-10-27 13:46:02 +00:00
RNA_def_property_float_funcs ( prop , NULL , " rna_Matte_t1_set " , NULL ) ;
2009-09-10 01:14:21 +00:00
RNA_def_property_range ( prop , 1.0f , 80.0f ) ;
2009-06-03 00:40:38 +00:00
RNA_def_property_ui_text ( prop , " Acceptance " , " Tolerance for a color to be considered a keying color " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-03 00:40:38 +00:00
2010-08-21 04:51:00 +00:00
prop = RNA_def_property ( srna , " threshold " , PROP_FLOAT , PROP_NONE ) ;
2009-06-03 00:40:38 +00:00
RNA_def_property_float_sdna ( prop , NULL , " t2 " ) ;
2009-10-27 13:46:02 +00:00
RNA_def_property_float_funcs ( prop , NULL , " rna_Matte_t2_set " , NULL ) ;
2009-09-10 01:14:21 +00:00
RNA_def_property_range ( prop , 0.0f , 30.0f ) ;
2009-06-03 00:40:38 +00:00
RNA_def_property_ui_text ( prop , " Cutoff " , " Tolerance below which colors will be considered as exact matches " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-03 00:40:38 +00:00
prop = RNA_def_property ( srna , " lift " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " fsize " ) ;
2009-09-10 01:14:21 +00:00
RNA_def_property_range ( prop , 0.0f , 1.0f ) ;
2009-06-03 00:40:38 +00:00
RNA_def_property_ui_text ( prop , " Lift " , " Alpha lift " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-03 00:40:38 +00:00
prop = RNA_def_property ( srna , " gain " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " fstrength " ) ;
2009-09-10 01:14:21 +00:00
RNA_def_property_range ( prop , 0.0f , 1.0f ) ;
2009-06-03 00:40:38 +00:00
RNA_def_property_ui_text ( prop , " Gain " , " Alpha gain " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-03 00:40:38 +00:00
prop = RNA_def_property ( srna , " shadow_adjust " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " t3 " ) ;
2009-09-10 01:14:21 +00:00
RNA_def_property_range ( prop , 0.0f , 1.0f ) ;
2009-06-03 00:40:38 +00:00
RNA_def_property_ui_text ( prop , " Shadow Adjust " , " Adjusts the brightness of any shadows captured " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-05-31 16:45:30 +00:00
}
2009-06-04 14:11:39 +00:00
static void def_cmp_channel_matte ( StructRNA * srna )
2009-06-03 00:40:38 +00:00
{
PropertyRNA * prop ;
2009-06-04 13:55:02 +00:00
static EnumPropertyItem color_space_items [ ] = {
2009-11-10 04:01:44 +00:00
{ CMP_NODE_CHANNEL_MATTE_CS_RGB , " RGB " , 0 , " RGB " , " RGB Color Space " } ,
{ CMP_NODE_CHANNEL_MATTE_CS_HSV , " HSV " , 0 , " HSV " , " HSV Color Space " } ,
{ CMP_NODE_CHANNEL_MATTE_CS_YUV , " YUV " , 0 , " YUV " , " YUV Color Space " } ,
{ CMP_NODE_CHANNEL_MATTE_CS_YCC , " YCC " , 0 , " YCbCr " , " YCbCr Color Space " } ,
2009-11-01 10:45:42 +00:00
{ 0 , NULL , 0 , NULL , NULL } } ;
2010-03-13 14:47:26 +00:00
static EnumPropertyItem algorithm_items [ ] = {
{ 0 , " SINGLE " , 0 , " Single " , " Limit by single channel " } ,
{ 1 , " MAX " , 0 , " Max " , " Limit by max of other channels " } ,
{ 0 , NULL , 0 , NULL , NULL } } ;
2009-06-03 00:40:38 +00:00
prop = RNA_def_property ( srna , " color_space " , PROP_ENUM , PROP_NONE ) ;
RNA_def_property_enum_sdna ( prop , NULL , " custom1 " ) ;
RNA_def_property_enum_items ( prop , color_space_items ) ;
RNA_def_property_ui_text ( prop , " Color Space " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-03 00:40:38 +00:00
2010-08-21 04:51:00 +00:00
prop = RNA_def_property ( srna , " matte_channel " , PROP_ENUM , PROP_NONE ) ;
2009-11-10 04:01:44 +00:00
RNA_def_property_enum_sdna ( prop , NULL , " custom2 " ) ;
RNA_def_property_enum_items ( prop , prop_tri_channel_items ) ;
RNA_def_property_enum_funcs ( prop , NULL , NULL , " rna_Node_channel_itemf " ) ;
RNA_def_property_ui_text ( prop , " Channel " , " Channel used to determine matte " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2010-03-13 14:47:26 +00:00
2009-06-03 00:40:38 +00:00
RNA_def_struct_sdna_from ( srna , " NodeChroma " , " storage " ) ;
2010-03-13 14:47:26 +00:00
2010-08-20 06:09:58 +00:00
prop = RNA_def_property ( srna , " limit_method " , PROP_ENUM , PROP_NONE ) ;
2010-03-13 14:47:26 +00:00
RNA_def_property_enum_sdna ( prop , NULL , " algorithm " ) ;
RNA_def_property_enum_items ( prop , algorithm_items ) ;
RNA_def_property_ui_text ( prop , " Algorithm " , " Algorithm to use to limit channel " ) ;
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
prop = RNA_def_property ( srna , " limit_channel " , PROP_ENUM , PROP_NONE ) ;
RNA_def_property_enum_sdna ( prop , NULL , " channel " ) ;
RNA_def_property_enum_items ( prop , prop_tri_channel_items ) ;
RNA_def_property_enum_funcs ( prop , NULL , NULL , " rna_Node_channel_itemf " ) ;
RNA_def_property_ui_text ( prop , " Limit Channel " , " Limit by this channels value " ) ;
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-03 00:40:38 +00:00
2010-08-21 04:51:00 +00:00
prop = RNA_def_property ( srna , " limit_max " , PROP_FLOAT , PROP_NONE ) ;
2009-06-03 00:40:38 +00:00
RNA_def_property_float_sdna ( prop , NULL , " t1 " ) ;
2009-10-27 13:46:02 +00:00
RNA_def_property_float_funcs ( prop , NULL , " rna_Matte_t1_set " , NULL ) ;
2009-09-10 01:14:21 +00:00
RNA_def_property_range ( prop , 0.0f , 1.0f ) ;
2009-06-03 00:40:38 +00:00
RNA_def_property_ui_text ( prop , " High " , " Values higher than this setting are 100% opaque " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-03 00:40:38 +00:00
2010-08-21 04:51:00 +00:00
prop = RNA_def_property ( srna , " limit_min " , PROP_FLOAT , PROP_NONE ) ;
2009-06-03 00:40:38 +00:00
RNA_def_property_float_sdna ( prop , NULL , " t2 " ) ;
2009-10-27 13:46:02 +00:00
RNA_def_property_float_funcs ( prop , NULL , " rna_Matte_t2_set " , NULL ) ;
2009-09-10 01:14:21 +00:00
RNA_def_property_range ( prop , 0.0f , 1.0f ) ;
2009-06-03 00:40:38 +00:00
RNA_def_property_ui_text ( prop , " Low " , " Values lower than this setting are 100% keyed " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-03 00:40:38 +00:00
}
2009-06-04 14:11:39 +00:00
static void def_cmp_flip ( StructRNA * srna )
2009-06-03 00:40:38 +00:00
{
PropertyRNA * prop ;
prop = RNA_def_property ( srna , " axis " , PROP_ENUM , PROP_NONE ) ;
RNA_def_property_enum_sdna ( prop , NULL , " custom1 " ) ;
2009-09-16 18:59:13 +00:00
RNA_def_property_enum_items ( prop , node_flip_items ) ;
2009-06-03 00:40:38 +00:00
RNA_def_property_ui_text ( prop , " Axis " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-03 00:40:38 +00:00
}
2009-06-04 14:11:39 +00:00
static void def_cmp_splitviewer ( StructRNA * srna )
2009-06-03 00:40:38 +00:00
{
PropertyRNA * prop ;
2009-06-04 13:55:02 +00:00
static EnumPropertyItem axis_items [ ] = {
2009-06-16 00:52:21 +00:00
{ 0 , " X " , 0 , " X " , " " } ,
{ 1 , " Y " , 0 , " Y " , " " } ,
2009-11-01 10:45:42 +00:00
{ 0 , NULL , 0 , NULL , NULL } } ;
2009-06-03 00:40:38 +00:00
prop = RNA_def_property ( srna , " axis " , PROP_ENUM , PROP_NONE ) ;
RNA_def_property_enum_sdna ( prop , NULL , " custom2 " ) ;
RNA_def_property_enum_items ( prop , axis_items ) ;
RNA_def_property_ui_text ( prop , " Axis " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-09-18 21:04:54 +00:00
2009-09-21 21:19:58 +00:00
prop = RNA_def_property ( srna , " factor " , PROP_INT , PROP_FACTOR ) ;
2009-09-18 21:04:54 +00:00
RNA_def_property_int_sdna ( prop , NULL , " custom1 " ) ;
RNA_def_property_range ( prop , 0 , 100 ) ;
2009-06-03 00:40:38 +00:00
RNA_def_property_ui_text ( prop , " Factor " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-03 00:40:38 +00:00
}
2009-06-04 14:11:39 +00:00
static void def_cmp_id_mask ( StructRNA * srna )
2009-06-03 00:40:38 +00:00
{
PropertyRNA * prop ;
prop = RNA_def_property ( srna , " index " , PROP_INT , PROP_NONE ) ;
RNA_def_property_int_sdna ( prop , NULL , " custom1 " ) ;
2009-09-10 01:14:21 +00:00
RNA_def_property_range ( prop , 0 , 10000 ) ;
2009-06-03 00:40:38 +00:00
RNA_def_property_ui_text ( prop , " Index " , " Pass index number to convert to alpha " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-03 00:40:38 +00:00
}
2009-06-04 14:11:39 +00:00
static void def_cmp_map_uv ( StructRNA * srna )
2009-06-03 00:40:38 +00:00
{
PropertyRNA * prop ;
2009-09-17 15:06:03 +00:00
2009-09-21 21:19:58 +00:00
prop = RNA_def_property ( srna , " alpha " , PROP_INT , PROP_FACTOR ) ;
2009-06-03 00:40:38 +00:00
RNA_def_property_int_sdna ( prop , NULL , " custom1 " ) ;
2009-09-10 01:14:21 +00:00
RNA_def_property_range ( prop , 0 , 100 ) ;
2009-06-03 00:40:38 +00:00
RNA_def_property_ui_text ( prop , " Alpha " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-03 00:40:38 +00:00
}
2009-06-04 14:11:39 +00:00
static void def_cmp_defocus ( StructRNA * srna )
2009-06-03 00:40:38 +00:00
{
PropertyRNA * prop ;
2009-06-04 13:55:02 +00:00
static EnumPropertyItem bokeh_items [ ] = {
2009-06-16 00:52:21 +00:00
{ 8 , " OCTAGON " , 0 , " Octagonal " , " 8 sides " } ,
{ 7 , " HEPTAGON " , 0 , " Heptagonal " , " 7 sides " } ,
{ 6 , " HEXAGON " , 0 , " Hexagonal " , " 6 sides " } ,
{ 5 , " PENTAGON " , 0 , " Pentagonal " , " 5 sides " } ,
{ 4 , " SQUARE " , 0 , " Square " , " 4 sides " } ,
{ 3 , " TRIANGLE " , 0 , " Triangular " , " 3 sides " } ,
{ 0 , " CIRCLE " , 0 , " Circular " , " " } ,
2009-11-01 10:45:42 +00:00
{ 0 , NULL , 0 , NULL , NULL } } ;
2009-06-03 00:40:38 +00:00
RNA_def_struct_sdna_from ( srna , " NodeDefocus " , " storage " ) ;
prop = RNA_def_property ( srna , " bokeh " , PROP_ENUM , PROP_NONE ) ;
RNA_def_property_enum_sdna ( prop , NULL , " bktype " ) ;
RNA_def_property_enum_items ( prop , bokeh_items ) ;
RNA_def_property_ui_text ( prop , " Bokeh Type " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-03 00:40:38 +00:00
/* TODO: angle in degrees */
prop = RNA_def_property ( srna , " angle " , PROP_INT , PROP_NONE ) ;
RNA_def_property_int_sdna ( prop , NULL , " rotation " ) ;
2009-09-10 01:14:21 +00:00
RNA_def_property_range ( prop , 0 , 90 ) ;
2009-06-03 00:40:38 +00:00
RNA_def_property_ui_text ( prop , " Angle " , " Bokeh shape rotation offset in degrees " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-03 00:40:38 +00:00
2010-08-20 06:09:58 +00:00
prop = RNA_def_property ( srna , " use_gamma_correction " , PROP_BOOLEAN , PROP_NONE ) ;
2009-06-03 00:40:38 +00:00
RNA_def_property_boolean_sdna ( prop , NULL , " gamco " , 1 ) ;
RNA_def_property_ui_text ( prop , " Gamma Correction " , " Enable gamma correction before and after main process " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-03 00:40:38 +00:00
/* TODO */
prop = RNA_def_property ( srna , " f_stop " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " fstop " ) ;
2009-09-10 01:14:21 +00:00
RNA_def_property_range ( prop , 0.0f , 128.0f ) ;
2009-06-03 00:40:38 +00:00
RNA_def_property_ui_text ( prop , " fStop " , " Amount of focal blur, 128=infinity=perfect focus, half the value doubles the blur radius " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-03 00:40:38 +00:00
2010-08-20 06:09:58 +00:00
prop = RNA_def_property ( srna , " blur_max " , PROP_FLOAT , PROP_NONE ) ;
2009-06-03 00:40:38 +00:00
RNA_def_property_float_sdna ( prop , NULL , " maxblur " ) ;
2009-09-10 01:14:21 +00:00
RNA_def_property_range ( prop , 0.0f , 10000.0f ) ;
2009-06-03 00:40:38 +00:00
RNA_def_property_ui_text ( prop , " Max Blur " , " blur limit, maximum CoC radius, 0=no limit " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-03 00:40:38 +00:00
prop = RNA_def_property ( srna , " threshold " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " bthresh " ) ;
2009-09-10 01:14:21 +00:00
RNA_def_property_range ( prop , 0.0f , 100.0f ) ;
2009-06-03 00:40:38 +00:00
RNA_def_property_ui_text ( prop , " Threshold " , " CoC radius threshold, prevents background bleed on in-focus midground, 0=off " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-03 00:40:38 +00:00
2010-08-21 04:51:00 +00:00
prop = RNA_def_property ( srna , " use_preview " , PROP_BOOLEAN , PROP_NONE ) ;
2009-06-03 00:40:38 +00:00
RNA_def_property_boolean_sdna ( prop , NULL , " preview " , 1 ) ;
RNA_def_property_ui_text ( prop , " Preview " , " Enable sampling mode, useful for preview when using low samplecounts " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-03 00:40:38 +00:00
prop = RNA_def_property ( srna , " samples " , PROP_INT , PROP_NONE ) ;
RNA_def_property_int_sdna ( prop , NULL , " samples " ) ;
2009-09-10 01:14:21 +00:00
RNA_def_property_range ( prop , 16 , 256 ) ;
2009-06-03 00:40:38 +00:00
RNA_def_property_ui_text ( prop , " Samples " , " Number of samples (16=grainy, higher=less noise) " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-03 00:40:38 +00:00
prop = RNA_def_property ( srna , " use_zbuffer " , PROP_BOOLEAN , PROP_NONE ) ;
2009-11-20 20:53:23 +00:00
RNA_def_property_boolean_negative_sdna ( prop , NULL , " no_zbuf " , 1 ) ;
RNA_def_property_ui_text ( prop , " Use Z-Buffer " , " Disable when using an image as input instead of actual zbuffer (auto enabled if node not image based, eg. time node) " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-03 00:40:38 +00:00
prop = RNA_def_property ( srna , " z_scale " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " scale " ) ;
2009-09-10 01:14:21 +00:00
RNA_def_property_range ( prop , 0.0f , 1000.0f ) ;
2009-06-03 00:40:38 +00:00
RNA_def_property_ui_text ( prop , " Z-Scale " , " Scales the Z input when not using a zbuffer, controls maximum blur designated by the color white or input value 1 " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-03 00:40:38 +00:00
}
2009-06-04 14:11:39 +00:00
static void def_cmp_invert ( StructRNA * srna )
2009-06-03 00:40:38 +00:00
{
PropertyRNA * prop ;
2010-08-21 04:51:00 +00:00
prop = RNA_def_property ( srna , " invert_rgb " , PROP_BOOLEAN , PROP_NONE ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_boolean_sdna ( prop , NULL , " custom1 " , CMP_CHAN_RGB ) ;
RNA_def_property_ui_text ( prop , " RGB " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-04 13:55:02 +00:00
2010-08-21 04:51:00 +00:00
prop = RNA_def_property ( srna , " invert_alpha " , PROP_BOOLEAN , PROP_NONE ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_boolean_sdna ( prop , NULL , " custom1 " , CMP_CHAN_A ) ;
RNA_def_property_ui_text ( prop , " Alpha " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-03 00:40:38 +00:00
}
2009-06-04 14:11:39 +00:00
static void def_cmp_crop ( StructRNA * srna )
2009-06-03 00:40:38 +00:00
{
PropertyRNA * prop ;
2010-08-20 06:09:58 +00:00
prop = RNA_def_property ( srna , " use_crop_size " , PROP_BOOLEAN , PROP_NONE ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_boolean_sdna ( prop , NULL , " custom1 " , 1 ) ;
RNA_def_property_ui_text ( prop , " Crop Image Size " , " Whether to crop the size of the input image " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2010-08-25 02:18:37 +00:00
prop = RNA_def_property ( srna , " relative " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " custom2 " , 1 ) ;
RNA_def_property_ui_text ( prop , " Relative " , " Use relative values to crop image " ) ;
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-04 13:55:02 +00:00
RNA_def_struct_sdna_from ( srna , " NodeTwoXYs " , " storage " ) ;
2010-08-20 06:09:58 +00:00
prop = RNA_def_property ( srna , " min_x " , PROP_INT , PROP_NONE ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_int_sdna ( prop , NULL , " x1 " ) ;
2009-09-10 01:14:21 +00:00
RNA_def_property_range ( prop , 0 , 10000 ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_ui_text ( prop , " X1 " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-04 13:55:02 +00:00
2010-08-20 06:09:58 +00:00
prop = RNA_def_property ( srna , " max_x " , PROP_INT , PROP_NONE ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_int_sdna ( prop , NULL , " x2 " ) ;
2009-09-10 01:14:21 +00:00
RNA_def_property_range ( prop , 0 , 10000 ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_ui_text ( prop , " X2 " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-04 13:55:02 +00:00
2010-08-20 06:09:58 +00:00
prop = RNA_def_property ( srna , " min_y " , PROP_INT , PROP_NONE ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_int_sdna ( prop , NULL , " y1 " ) ;
2009-09-10 01:14:21 +00:00
RNA_def_property_range ( prop , 0 , 10000 ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_ui_text ( prop , " Y1 " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-04 13:55:02 +00:00
2010-08-20 06:09:58 +00:00
prop = RNA_def_property ( srna , " max_y " , PROP_INT , PROP_NONE ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_int_sdna ( prop , NULL , " y2 " ) ;
2009-09-10 01:14:21 +00:00
RNA_def_property_range ( prop , 0 , 10000 ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_ui_text ( prop , " Y2 " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2010-08-25 02:18:37 +00:00
prop = RNA_def_property ( srna , " rel_min_x " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " fac_x1 " ) ;
RNA_def_property_range ( prop , 0.0 , 1.0 ) ;
RNA_def_property_ui_text ( prop , " X1 " , " " ) ;
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
prop = RNA_def_property ( srna , " rel_max_x " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " fac_x2 " ) ;
RNA_def_property_range ( prop , 0.0 , 1.0 ) ;
RNA_def_property_ui_text ( prop , " X2 " , " " ) ;
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
prop = RNA_def_property ( srna , " rel_min_y " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " fac_y1 " ) ;
RNA_def_property_range ( prop , 0.0 , 1.0 ) ;
RNA_def_property_ui_text ( prop , " Y1 " , " " ) ;
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
prop = RNA_def_property ( srna , " rel_max_y " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " fac_y2 " ) ;
RNA_def_property_range ( prop , 0.0 , 1.0 ) ;
RNA_def_property_ui_text ( prop , " Y2 " , " " ) ;
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-03 00:40:38 +00:00
}
2009-06-04 14:11:39 +00:00
static void def_cmp_dblur ( StructRNA * srna )
2009-06-03 00:40:38 +00:00
{
PropertyRNA * prop ;
2009-06-04 13:55:02 +00:00
RNA_def_struct_sdna_from ( srna , " NodeDBlurData " , " storage " ) ;
prop = RNA_def_property ( srna , " iterations " , PROP_INT , PROP_NONE ) ;
RNA_def_property_int_sdna ( prop , NULL , " iter " ) ;
2009-09-18 21:04:54 +00:00
RNA_def_property_range ( prop , 1 , 32 ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_ui_text ( prop , " Iterations " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-04 13:55:02 +00:00
2010-08-21 04:51:00 +00:00
prop = RNA_def_property ( srna , " use_wrap " , PROP_BOOLEAN , PROP_NONE ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_boolean_sdna ( prop , NULL , " wrap " , 1 ) ;
RNA_def_property_ui_text ( prop , " Wrap " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-04 13:55:02 +00:00
prop = RNA_def_property ( srna , " center_x " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " center_x " ) ;
2009-09-10 01:14:21 +00:00
RNA_def_property_range ( prop , 0.0f , 1.0f ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_ui_text ( prop , " Center X " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-04 13:55:02 +00:00
prop = RNA_def_property ( srna , " center_y " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " center_y " ) ;
2009-09-10 01:14:21 +00:00
RNA_def_property_range ( prop , 0.0f , 1.0f ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_ui_text ( prop , " Center Y " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-04 13:55:02 +00:00
prop = RNA_def_property ( srna , " distance " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " distance " ) ;
2009-09-10 01:14:21 +00:00
RNA_def_property_range ( prop , - 1.0f , 1.0f ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_ui_text ( prop , " Distance " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-04 13:55:02 +00:00
prop = RNA_def_property ( srna , " angle " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " angle " ) ;
2009-09-10 01:14:21 +00:00
RNA_def_property_range ( prop , 0.0f , 360.0f ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_ui_text ( prop , " Angle " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-04 13:55:02 +00:00
prop = RNA_def_property ( srna , " spin " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " spin " ) ;
2009-09-10 01:14:21 +00:00
RNA_def_property_range ( prop , - 360.0f , 360.0f ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_ui_text ( prop , " Spin " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-04 13:55:02 +00:00
prop = RNA_def_property ( srna , " zoom " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " zoom " ) ;
2009-09-10 01:14:21 +00:00
RNA_def_property_range ( prop , 0.0f , 100.0f ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_ui_text ( prop , " Zoom " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-03 00:40:38 +00:00
}
2009-06-04 14:11:39 +00:00
static void def_cmp_bilateral_blur ( StructRNA * srna )
2009-06-03 00:40:38 +00:00
{
PropertyRNA * prop ;
2009-06-04 13:55:02 +00:00
RNA_def_struct_sdna_from ( srna , " NodeBilateralBlurData " , " storage " ) ;
prop = RNA_def_property ( srna , " iterations " , PROP_INT , PROP_NONE ) ;
RNA_def_property_int_sdna ( prop , NULL , " iter " ) ;
2009-09-10 01:14:21 +00:00
RNA_def_property_range ( prop , 1 , 128 ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_ui_text ( prop , " Iterations " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-04 13:55:02 +00:00
prop = RNA_def_property ( srna , " sigma_color " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " sigma_color " ) ;
2009-09-10 01:14:21 +00:00
RNA_def_property_range ( prop , 0.01f , 3.0f ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_ui_text ( prop , " Color Sigma " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-04 13:55:02 +00:00
prop = RNA_def_property ( srna , " sigma_space " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " sigma_space " ) ;
2009-09-10 01:14:21 +00:00
RNA_def_property_range ( prop , 0.01f , 30.0f ) ;
RNA_def_property_ui_text ( prop , " Space Sigma " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-03 00:40:38 +00:00
}
2009-06-04 14:11:39 +00:00
static void def_cmp_premul_key ( StructRNA * srna )
2009-06-03 00:40:38 +00:00
{
PropertyRNA * prop ;
2009-06-04 13:55:02 +00:00
static EnumPropertyItem type_items [ ] = {
2009-06-16 00:52:21 +00:00
{ 0 , " KEY_TO_PREMUL " , 0 , " Key to Premul " , " " } ,
{ 1 , " PREMUL_TO_KEY " , 0 , " Premul to Key " , " " } ,
2009-11-01 10:45:42 +00:00
{ 0 , NULL , 0 , NULL , NULL } } ;
2009-06-04 13:55:02 +00:00
2009-07-21 00:55:20 +00:00
prop = RNA_def_property ( srna , " mapping " , PROP_ENUM , PROP_NONE ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_enum_sdna ( prop , NULL , " custom1 " ) ;
RNA_def_property_enum_items ( prop , type_items ) ;
2009-07-21 00:55:20 +00:00
RNA_def_property_ui_text ( prop , " Mapping " , " Conversion between premultiplied alpha and key alpha " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-04 13:55:02 +00:00
2009-06-03 00:40:38 +00:00
}
2009-06-04 14:11:39 +00:00
static void def_cmp_glare ( StructRNA * srna )
2009-06-03 00:40:38 +00:00
{
PropertyRNA * prop ;
2009-06-04 13:55:02 +00:00
static EnumPropertyItem type_items [ ] = {
2009-06-16 00:52:21 +00:00
{ 3 , " GHOSTS " , 0 , " Ghosts " , " " } ,
{ 2 , " STREAKS " , 0 , " Streaks " , " " } ,
{ 1 , " FOG_GLOW " , 0 , " Fog Glow " , " " } ,
{ 0 , " SIMPLE_STAR " , 0 , " Simple Star " , " " } ,
2009-11-01 10:45:42 +00:00
{ 0 , NULL , 0 , NULL , NULL } } ;
2009-06-04 13:55:02 +00:00
2009-09-18 21:04:54 +00:00
static EnumPropertyItem quality_items [ ] = {
2009-06-16 00:52:21 +00:00
{ 0 , " HIGH " , 0 , " High " , " " } ,
{ 1 , " MEDIUM " , 0 , " Medium " , " " } ,
{ 2 , " LOW " , 0 , " Low " , " " } ,
2009-11-01 10:45:42 +00:00
{ 0 , NULL , 0 , NULL , NULL } } ;
2009-06-04 13:55:02 +00:00
RNA_def_struct_sdna_from ( srna , " NodeGlare " , " storage " ) ;
2009-07-21 00:55:20 +00:00
prop = RNA_def_property ( srna , " glare_type " , PROP_ENUM , PROP_NONE ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_enum_sdna ( prop , NULL , " type " ) ;
RNA_def_property_enum_items ( prop , type_items ) ;
2009-07-21 00:55:20 +00:00
RNA_def_property_ui_text ( prop , " Glare Type " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-04 13:55:02 +00:00
prop = RNA_def_property ( srna , " quality " , PROP_ENUM , PROP_NONE ) ;
RNA_def_property_enum_sdna ( prop , NULL , " quality " ) ;
2009-09-18 21:04:54 +00:00
RNA_def_property_enum_items ( prop , quality_items ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_ui_text ( prop , " Quality " , " If not set to high quality, the effect will be applied to a low-res copy of the source image " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-04 13:55:02 +00:00
prop = RNA_def_property ( srna , " iterations " , PROP_INT , PROP_NONE ) ;
RNA_def_property_int_sdna ( prop , NULL , " iter " ) ;
2009-09-10 01:14:21 +00:00
RNA_def_property_range ( prop , 2 , 5 ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_ui_text ( prop , " Iterations " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-04 13:55:02 +00:00
prop = RNA_def_property ( srna , " color_modulation " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " colmod " ) ;
2009-09-10 01:14:21 +00:00
RNA_def_property_range ( prop , 0.0f , 1.0f ) ;
2009-09-18 21:04:54 +00:00
RNA_def_property_ui_text ( prop , " Color Modulation " , " Amount of Color Modulation, modulates colors of streaks and ghosts for a spectral dispersion effect " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-04 13:55:02 +00:00
prop = RNA_def_property ( srna , " mix " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " mix " ) ;
2009-09-10 01:14:21 +00:00
RNA_def_property_range ( prop , - 1.0f , 1.0f ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_ui_text ( prop , " Mix " , " -1 is original image only, 0 is exact 50/50 mix, 1 is processed image only " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-04 13:55:02 +00:00
prop = RNA_def_property ( srna , " threshold " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " threshold " ) ;
2009-09-10 01:14:21 +00:00
RNA_def_property_range ( prop , 0.0f , 1000.0f ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_ui_text ( prop , " Threshold " , " The glare filter will only be applied to pixels brighter than this value " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-04 13:55:02 +00:00
prop = RNA_def_property ( srna , " streaks " , PROP_INT , PROP_NONE ) ;
RNA_def_property_int_sdna ( prop , NULL , " angle " ) ;
2009-09-10 01:14:21 +00:00
RNA_def_property_range ( prop , 2 , 16 ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_ui_text ( prop , " Streaks " , " Total number of streaks " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-04 13:55:02 +00:00
2010-12-30 21:46:09 +00:00
prop = RNA_def_property ( srna , " angle_offset " , PROP_INT , PROP_NONE ) ;
RNA_def_property_int_sdna ( prop , NULL , " angle_ofs " ) ;
RNA_def_property_range ( prop , 0 , 180 ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_ui_text ( prop , " Angle Offset " , " Streak angle offset in degrees " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-04 13:55:02 +00:00
prop = RNA_def_property ( srna , " fade " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " fade " ) ;
2009-09-10 01:14:21 +00:00
RNA_def_property_range ( prop , 0.75f , 1.0f ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_ui_text ( prop , " Fade " , " Streak fade-out factor " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-04 13:55:02 +00:00
2010-08-20 06:09:58 +00:00
prop = RNA_def_property ( srna , " use_rotate_45 " , PROP_BOOLEAN , PROP_NONE ) ;
2010-12-10 04:39:53 +00:00
RNA_def_property_boolean_sdna ( prop , NULL , " angle " , 0 ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_ui_text ( prop , " Rotate 45 " , " Simple star filter: add 45 degree rotation offset " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-04 13:55:02 +00:00
prop = RNA_def_property ( srna , " size " , PROP_INT , PROP_NONE ) ;
RNA_def_property_int_sdna ( prop , NULL , " size " ) ;
2009-09-10 01:14:21 +00:00
RNA_def_property_range ( prop , 6 , 9 ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_ui_text ( prop , " Size " , " Glow/glare size (not actual size; relative to initial size of bright area of pixels) " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-04 13:55:02 +00:00
/* TODO */
2009-06-03 00:40:38 +00:00
}
2009-06-04 14:11:39 +00:00
static void def_cmp_tonemap ( StructRNA * srna )
2009-06-03 00:40:38 +00:00
{
PropertyRNA * prop ;
2009-06-04 13:55:02 +00:00
static EnumPropertyItem type_items [ ] = {
2009-06-16 00:52:21 +00:00
{ 1 , " RD_PHOTORECEPTOR " , 0 , " R/D Photoreceptor " , " " } ,
{ 0 , " RH_SIMPLE " , 0 , " Rh Simple " , " " } ,
2009-11-01 10:45:42 +00:00
{ 0 , NULL , 0 , NULL , NULL } } ;
2009-06-04 13:55:02 +00:00
RNA_def_struct_sdna_from ( srna , " NodeTonemap " , " storage " ) ;
2009-07-21 00:55:20 +00:00
prop = RNA_def_property ( srna , " tonemap_type " , PROP_ENUM , PROP_NONE ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_enum_sdna ( prop , NULL , " type " ) ;
RNA_def_property_enum_items ( prop , type_items ) ;
2009-07-21 00:55:20 +00:00
RNA_def_property_ui_text ( prop , " Tonemap Type " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-04 13:55:02 +00:00
prop = RNA_def_property ( srna , " key " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " key " ) ;
2009-09-10 01:14:21 +00:00
RNA_def_property_range ( prop , 0.0f , 1.0f ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_ui_text ( prop , " Key " , " The value the average luminance is mapped to " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-04 13:55:02 +00:00
prop = RNA_def_property ( srna , " offset " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " offset " ) ;
2009-09-10 01:14:21 +00:00
RNA_def_property_range ( prop , 0.001f , 10.0f ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_ui_text ( prop , " Offset " , " Normally always 1, but can be used as an extra control to alter the brightness curve " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-04 13:55:02 +00:00
prop = RNA_def_property ( srna , " gamma " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " gamma " ) ;
2009-09-10 01:14:21 +00:00
RNA_def_property_range ( prop , 0.001f , 3.0f ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_ui_text ( prop , " Gamma " , " If not used, set to 1 " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-04 13:55:02 +00:00
prop = RNA_def_property ( srna , " intensity " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " f " ) ;
2009-09-10 01:14:21 +00:00
RNA_def_property_range ( prop , - 8.0f , 8.0f ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_ui_text ( prop , " Intensity " , " If less than zero, darkens image; otherwise, makes it brighter " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-04 13:55:02 +00:00
prop = RNA_def_property ( srna , " contrast " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " m " ) ;
2009-09-10 01:14:21 +00:00
RNA_def_property_range ( prop , 0.0f , 1.0f ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_ui_text ( prop , " Contrast " , " Set to 0 to use estimate from input image " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-04 13:55:02 +00:00
prop = RNA_def_property ( srna , " adaptation " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " a " ) ;
2009-09-10 01:14:21 +00:00
RNA_def_property_range ( prop , 0.0f , 1.0f ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_ui_text ( prop , " Adaptation " , " If 0, global; if 1, based on pixel intensity " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-04 13:55:02 +00:00
prop = RNA_def_property ( srna , " correction " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " c " ) ;
2009-09-10 01:14:21 +00:00
RNA_def_property_range ( prop , 0.0f , 1.0f ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_ui_text ( prop , " Color Correction " , " If 0, same for all channels; if 1, each independent " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-03 00:40:38 +00:00
}
2009-06-04 14:11:39 +00:00
static void def_cmp_lensdist ( StructRNA * srna )
2009-06-03 00:40:38 +00:00
{
PropertyRNA * prop ;
2009-06-04 13:55:02 +00:00
RNA_def_struct_sdna_from ( srna , " NodeLensDist " , " storage " ) ;
2010-08-20 06:09:58 +00:00
prop = RNA_def_property ( srna , " use_projector " , PROP_BOOLEAN , PROP_NONE ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_boolean_sdna ( prop , NULL , " proj " , 1 ) ;
2010-02-10 21:15:44 +00:00
RNA_def_property_ui_text ( prop , " Projector " , " Enable/disable projector mode. Effect is applied in horizontal direction only " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-04 13:55:02 +00:00
2010-08-21 04:51:00 +00:00
prop = RNA_def_property ( srna , " use_jitter " , PROP_BOOLEAN , PROP_NONE ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_boolean_sdna ( prop , NULL , " jit " , 1 ) ;
RNA_def_property_ui_text ( prop , " Jitter " , " Enable/disable jittering; faster, but also noisier " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-04 13:55:02 +00:00
2010-08-21 04:51:00 +00:00
prop = RNA_def_property ( srna , " use_fit " , PROP_BOOLEAN , PROP_NONE ) ;
2009-06-04 13:55:02 +00:00
RNA_def_property_boolean_sdna ( prop , NULL , " fit " , 1 ) ;
RNA_def_property_ui_text ( prop , " Fit " , " For positive distortion factor only: scale image such that black areas are not visible " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-06-03 00:40:38 +00:00
}
2010-01-20 04:19:55 +00:00
static void def_cmp_colorbalance ( StructRNA * srna )
{
PropertyRNA * prop ;
2010-01-27 00:22:29 +00:00
static float default_1 [ 3 ] = { 1.f , 1.f , 1.f } ;
static EnumPropertyItem type_items [ ] = {
{ 0 , " LIFT_GAMMA_GAIN " , 0 , " Lift/Gamma/Gain " , " " } ,
{ 1 , " OFFSET_POWER_SLOPE " , 0 , " Offset/Power/Slope (ASC-CDL) " , " ASC-CDL standard color correction " } ,
{ 0 , NULL , 0 , NULL , NULL } } ;
2010-08-20 06:09:58 +00:00
prop = RNA_def_property ( srna , " correction_method " , PROP_ENUM , PROP_NONE ) ;
2010-01-27 00:22:29 +00:00
RNA_def_property_enum_sdna ( prop , NULL , " custom1 " ) ;
RNA_def_property_enum_items ( prop , type_items ) ;
RNA_def_property_ui_text ( prop , " Correction Formula " , " " ) ;
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2010-01-20 04:19:55 +00:00
RNA_def_struct_sdna_from ( srna , " NodeColorBalance " , " storage " ) ;
prop = RNA_def_property ( srna , " lift " , PROP_FLOAT , PROP_COLOR_GAMMA ) ;
RNA_def_property_float_sdna ( prop , NULL , " lift " ) ;
RNA_def_property_array ( prop , 3 ) ;
2010-03-25 00:10:41 +00:00
RNA_def_property_float_array_default ( prop , default_1 ) ;
RNA_def_property_ui_range ( prop , 0 , 2 , 0.1 , 3 ) ;
2010-01-20 04:19:55 +00:00
RNA_def_property_ui_text ( prop , " Lift " , " Correction for Shadows " ) ;
2010-01-27 00:22:29 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2010-01-20 04:19:55 +00:00
prop = RNA_def_property ( srna , " gamma " , PROP_FLOAT , PROP_COLOR_GAMMA ) ;
RNA_def_property_float_sdna ( prop , NULL , " gamma " ) ;
RNA_def_property_array ( prop , 3 ) ;
2010-01-27 00:22:29 +00:00
RNA_def_property_float_array_default ( prop , default_1 ) ;
RNA_def_property_ui_range ( prop , 0 , 2 , 0.1 , 3 ) ;
2010-01-20 04:19:55 +00:00
RNA_def_property_ui_text ( prop , " Gamma " , " Correction for Midtones " ) ;
2010-01-27 00:22:29 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2010-01-20 04:19:55 +00:00
prop = RNA_def_property ( srna , " gain " , PROP_FLOAT , PROP_COLOR_GAMMA ) ;
RNA_def_property_float_sdna ( prop , NULL , " gain " ) ;
RNA_def_property_array ( prop , 3 ) ;
2010-01-27 00:22:29 +00:00
RNA_def_property_float_array_default ( prop , default_1 ) ;
RNA_def_property_ui_range ( prop , 0 , 2 , 0.1 , 3 ) ;
2010-01-20 04:19:55 +00:00
RNA_def_property_ui_text ( prop , " Gain " , " Correction for Highlights " ) ;
2010-01-27 00:22:29 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
prop = RNA_def_property ( srna , " offset " , PROP_FLOAT , PROP_COLOR_GAMMA ) ;
RNA_def_property_float_sdna ( prop , NULL , " lift " ) ;
RNA_def_property_array ( prop , 3 ) ;
RNA_def_property_ui_range ( prop , 0 , 1 , 0.1 , 3 ) ;
RNA_def_property_ui_text ( prop , " Offset " , " Correction for Shadows " ) ;
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
prop = RNA_def_property ( srna , " power " , PROP_FLOAT , PROP_COLOR_GAMMA ) ;
RNA_def_property_float_sdna ( prop , NULL , " gamma " ) ;
RNA_def_property_array ( prop , 3 ) ;
RNA_def_property_float_array_default ( prop , default_1 ) ;
RNA_def_property_ui_range ( prop , 0 , 2 , 0.1 , 3 ) ;
RNA_def_property_ui_text ( prop , " Power " , " Correction for Midtones " ) ;
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
prop = RNA_def_property ( srna , " slope " , PROP_FLOAT , PROP_COLOR_GAMMA ) ;
RNA_def_property_float_sdna ( prop , NULL , " gain " ) ;
RNA_def_property_array ( prop , 3 ) ;
RNA_def_property_float_array_default ( prop , default_1 ) ;
RNA_def_property_ui_range ( prop , 0 , 2 , 0.1 , 3 ) ;
RNA_def_property_ui_text ( prop , " Slope " , " Correction for Highlights " ) ;
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2010-01-20 04:19:55 +00:00
}
2010-01-21 00:00:45 +00:00
static void def_cmp_huecorrect ( StructRNA * srna )
{
PropertyRNA * prop ;
2009-06-03 00:40:38 +00:00
2010-01-21 00:00:45 +00:00
prop = RNA_def_property ( srna , " mapping " , PROP_POINTER , PROP_NONE ) ;
RNA_def_property_pointer_sdna ( prop , NULL , " storage " ) ;
RNA_def_property_struct_type ( prop , " CurveMapping " ) ;
RNA_def_property_ui_text ( prop , " Mapping " , " " ) ;
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
}
2009-06-03 00:40:38 +00:00
2010-11-12 14:59:01 +00:00
static void def_cmp_zcombine ( StructRNA * srna )
{
PropertyRNA * prop ;
prop = RNA_def_property ( srna , " use_alpha " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " custom1 " , 0 ) ;
RNA_def_property_ui_text ( prop , " Use Alpha " , " Takes Alpha channel into account when doing the Z operation " ) ;
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
}
2010-12-13 21:17:00 +00:00
static void def_cmp_ycc ( StructRNA * srna )
{
PropertyRNA * prop ;
prop = RNA_def_property ( srna , " mode " , PROP_ENUM , PROP_NONE ) ;
RNA_def_property_enum_sdna ( prop , NULL , " custom1 " ) ;
RNA_def_property_enum_items ( prop , node_ycc_items ) ;
RNA_def_property_ui_text ( prop , " Mode " , " " ) ;
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
}
2009-05-31 16:45:30 +00:00
2009-03-24 17:40:58 +00:00
/* -- Texture Nodes --------------------------------------------------------- */
2009-06-04 14:11:39 +00:00
static void def_tex_output ( StructRNA * srna )
2009-05-31 16:45:30 +00:00
{
PropertyRNA * prop ;
2009-06-03 00:40:38 +00:00
RNA_def_struct_sdna_from ( srna , " TexNodeOutput " , " storage " ) ;
2009-05-31 16:45:30 +00:00
2010-08-21 04:51:00 +00:00
prop = RNA_def_property ( srna , " filepath " , PROP_STRING , PROP_NONE ) ;
2009-06-03 00:40:38 +00:00
RNA_def_property_string_sdna ( prop , NULL , " name " ) ;
2009-07-21 00:55:20 +00:00
RNA_def_property_ui_text ( prop , " Output Name " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-05-31 16:45:30 +00:00
}
2009-06-04 14:11:39 +00:00
static void def_tex_image ( StructRNA * srna )
2009-05-31 16:45:30 +00:00
{
PropertyRNA * prop ;
2009-11-19 04:50:00 +00:00
prop = RNA_def_property ( srna , " image " , PROP_POINTER , PROP_NONE ) ;
RNA_def_property_pointer_sdna ( prop , NULL , " id " ) ;
RNA_def_property_struct_type ( prop , " Image " ) ;
RNA_def_property_flag ( prop , PROP_EDITABLE ) ;
RNA_def_property_ui_text ( prop , " Image " , " " ) ;
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
/* is this supposed to be exposed? not sure..
2009-05-31 16:45:30 +00:00
prop = RNA_def_property ( srna , " settings " , PROP_POINTER , PROP_NONE ) ;
RNA_def_property_pointer_sdna ( prop , NULL , " storage " ) ;
RNA_def_property_struct_type ( prop , " ImageUser " ) ;
RNA_def_property_ui_text ( prop , " Settings " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-11-19 04:50:00 +00:00
*/
2009-05-31 16:45:30 +00:00
}
2009-06-04 14:11:39 +00:00
static void def_tex_bricks ( StructRNA * srna )
2009-05-31 16:45:30 +00:00
{
PropertyRNA * prop ;
prop = RNA_def_property ( srna , " offset " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " custom3 " ) ;
2009-09-10 01:14:21 +00:00
RNA_def_property_range ( prop , 0.0f , 1.0f ) ;
2009-05-31 16:45:30 +00:00
RNA_def_property_ui_text ( prop , " Offset Amount " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-05-31 16:45:30 +00:00
prop = RNA_def_property ( srna , " offset_frequency " , PROP_INT , PROP_NONE ) ;
RNA_def_property_int_sdna ( prop , NULL , " custom1 " ) ;
2009-09-10 01:14:21 +00:00
RNA_def_property_range ( prop , 2 , 99 ) ;
2009-05-31 16:45:30 +00:00
RNA_def_property_ui_text ( prop , " Offset Frequency " , " Offset every N rows " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-05-31 16:45:30 +00:00
prop = RNA_def_property ( srna , " squash " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " custom4 " ) ;
2009-09-10 01:14:21 +00:00
RNA_def_property_range ( prop , 0.0f , 99.0f ) ;
2009-05-31 16:45:30 +00:00
RNA_def_property_ui_text ( prop , " Squash Amount " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-05-31 16:45:30 +00:00
prop = RNA_def_property ( srna , " squash_frequency " , PROP_INT , PROP_NONE ) ;
RNA_def_property_int_sdna ( prop , NULL , " custom2 " ) ;
2009-09-10 01:14:21 +00:00
RNA_def_property_range ( prop , 2 , 99 ) ;
2009-05-31 16:45:30 +00:00
RNA_def_property_ui_text ( prop , " Squash Frequency " , " Squash every N rows " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-05-31 16:45:30 +00:00
}
2009-03-24 17:40:58 +00:00
/* -------------------------------------------------------------------------- */
2010-01-15 07:04:00 +00:00
static EnumPropertyItem shader_node_type_items [ MaxNodes ] ;
2009-03-22 14:46:45 +00:00
static void rna_def_shader_node ( BlenderRNA * brna )
2008-12-26 01:37:05 +00:00
{
StructRNA * srna ;
PropertyRNA * prop ;
2009-03-24 17:40:58 +00:00
2010-01-15 07:04:00 +00:00
alloc_node_type_items ( shader_node_type_items , Category_ShaderNode ) ;
2009-03-22 14:46:45 +00:00
2009-05-31 16:45:30 +00:00
srna = RNA_def_struct ( brna , " ShaderNode " , " Node " ) ;
2010-02-10 21:15:44 +00:00
RNA_def_struct_ui_text ( srna , " Shader Node " , " Material shader node " ) ;
2009-03-22 14:46:45 +00:00
RNA_def_struct_sdna ( srna , " bNode " ) ;
2009-05-31 16:45:30 +00:00
prop = RNA_def_property ( srna , " type " , PROP_ENUM , PROP_NONE ) ;
2009-03-23 13:24:48 +00:00
RNA_def_property_clear_flag ( prop , PROP_EDITABLE ) ;
2010-01-15 07:04:00 +00:00
RNA_def_property_enum_items ( prop , shader_node_type_items ) ;
2009-03-22 14:46:45 +00:00
RNA_def_property_ui_text ( prop , " Type " , " " ) ;
2009-03-24 17:40:58 +00:00
}
2010-01-15 07:04:00 +00:00
static EnumPropertyItem compositor_node_type_items [ MaxNodes ] ;
2009-03-24 17:40:58 +00:00
static void rna_def_compositor_node ( BlenderRNA * brna )
{
StructRNA * srna ;
PropertyRNA * prop ;
2010-01-15 07:04:00 +00:00
alloc_node_type_items ( compositor_node_type_items , Category_CompositorNode ) ;
2009-03-24 17:40:58 +00:00
2009-05-31 16:45:30 +00:00
srna = RNA_def_struct ( brna , " CompositorNode " , " Node " ) ;
2009-03-24 17:40:58 +00:00
RNA_def_struct_ui_text ( srna , " Compositor Node " , " " ) ;
RNA_def_struct_sdna ( srna , " bNode " ) ;
2009-05-31 16:45:30 +00:00
prop = RNA_def_property ( srna , " type " , PROP_ENUM , PROP_NONE ) ;
2009-03-24 17:40:58 +00:00
RNA_def_property_clear_flag ( prop , PROP_EDITABLE ) ;
2010-01-15 07:04:00 +00:00
RNA_def_property_enum_items ( prop , compositor_node_type_items ) ;
2009-03-24 17:40:58 +00:00
RNA_def_property_ui_text ( prop , " Type " , " " ) ;
}
2010-01-15 07:04:00 +00:00
static EnumPropertyItem texture_node_type_items [ MaxNodes ] ;
2009-03-24 17:40:58 +00:00
static void rna_def_texture_node ( BlenderRNA * brna )
{
StructRNA * srna ;
PropertyRNA * prop ;
2010-01-15 07:04:00 +00:00
alloc_node_type_items ( texture_node_type_items , Category_TextureNode ) ;
2009-03-24 17:40:58 +00:00
2009-05-31 16:45:30 +00:00
srna = RNA_def_struct ( brna , " TextureNode " , " Node " ) ;
2009-03-24 17:40:58 +00:00
RNA_def_struct_ui_text ( srna , " Texture Node " , " " ) ;
RNA_def_struct_sdna ( srna , " bNode " ) ;
2009-05-31 16:45:30 +00:00
prop = RNA_def_property ( srna , " type " , PROP_ENUM , PROP_NONE ) ;
2009-03-24 17:40:58 +00:00
RNA_def_property_clear_flag ( prop , PROP_EDITABLE ) ;
2010-01-15 07:04:00 +00:00
RNA_def_property_enum_items ( prop , texture_node_type_items ) ;
2009-03-24 17:40:58 +00:00
RNA_def_property_ui_text ( prop , " Type " , " " ) ;
2009-03-22 14:46:45 +00:00
}
2009-03-24 17:40:58 +00:00
/* -------------------------------------------------------------------------- */
2010-12-02 01:18:59 +00:00
static void rna_def_nodetree_link_api ( BlenderRNA * brna , PropertyRNA * cprop )
{
StructRNA * srna ;
PropertyRNA * parm ;
FunctionRNA * func ;
RNA_def_property_srna ( cprop , " NodeLinks " ) ;
srna = RNA_def_struct ( brna , " NodeLinks " , NULL ) ;
RNA_def_struct_sdna ( srna , " bNodeTree " ) ;
RNA_def_struct_ui_text ( srna , " Node Links " , " Collection of Node Links " ) ;
func = RNA_def_function ( srna , " new " , " rna_NodeTree_link_new " ) ;
RNA_def_function_ui_description ( func , " Add a node link to this node tree. " ) ;
2010-12-05 18:59:23 +00:00
RNA_def_function_flag ( func , FUNC_USE_REPORTS ) ;
2010-12-02 01:18:59 +00:00
parm = RNA_def_pointer ( func , " input " , " NodeSocket " , " " , " The input socket. " ) ;
RNA_def_property_flag ( parm , PROP_REQUIRED ) ;
parm = RNA_def_pointer ( func , " output " , " NodeSocket " , " " , " The output socket. " ) ;
RNA_def_property_flag ( parm , PROP_REQUIRED ) ;
/* return */
parm = RNA_def_pointer ( func , " link " , " NodeLink " , " " , " New node link. " ) ;
RNA_def_function_return ( func , parm ) ;
func = RNA_def_function ( srna , " remove " , " rna_NodeTree_link_remove " ) ;
RNA_def_function_ui_description ( func , " remove a node link from the node tree. " ) ;
2010-12-05 18:59:23 +00:00
RNA_def_function_flag ( func , FUNC_USE_REPORTS ) ;
2010-12-02 01:18:59 +00:00
parm = RNA_def_pointer ( func , " link " , " NodeLink " , " " , " The node link to remove. " ) ;
RNA_def_property_flag ( parm , PROP_REQUIRED ) ;
}
static void rna_def_composite_nodetree_api ( BlenderRNA * brna , PropertyRNA * cprop )
{
StructRNA * srna ;
PropertyRNA * parm ;
FunctionRNA * func ;
RNA_def_property_srna ( cprop , " CompositorNodes " ) ;
srna = RNA_def_struct ( brna , " CompositorNodes " , NULL ) ;
RNA_def_struct_sdna ( srna , " bNodeTree " ) ;
RNA_def_struct_ui_text ( srna , " Compositor Nodes " , " Collection of Compositor Nodes " ) ;
func = RNA_def_function ( srna , " new " , " rna_NodeTree_node_composite_new " ) ;
RNA_def_function_ui_description ( func , " Add a node to this node tree. " ) ;
RNA_def_function_flag ( func , FUNC_USE_CONTEXT | FUNC_USE_REPORTS ) ;
parm = RNA_def_enum ( func , " type " , compositor_node_type_items , 0 , " Type " , " Type of node to add " ) ;
RNA_def_property_flag ( parm , PROP_REQUIRED ) ;
2011-01-13 04:53:55 +00:00
RNA_def_pointer ( func , " group " , " NodeTree " , " " , " The group tree " ) ;
2010-12-02 01:18:59 +00:00
/* return value */
parm = RNA_def_pointer ( func , " node " , " Node " , " " , " New node. " ) ;
RNA_def_function_return ( func , parm ) ;
func = RNA_def_function ( srna , " remove " , " rna_NodeTree_node_remove " ) ;
RNA_def_function_ui_description ( func , " remove a node from this node tree. " ) ;
2010-12-05 18:59:23 +00:00
RNA_def_function_flag ( func , FUNC_USE_REPORTS ) ;
2010-12-02 01:18:59 +00:00
parm = RNA_def_pointer ( func , " node " , " Node " , " " , " The node to remove. " ) ;
RNA_def_property_flag ( parm , PROP_REQUIRED ) ;
}
static void rna_def_shader_nodetree_api ( BlenderRNA * brna , PropertyRNA * cprop )
{
StructRNA * srna ;
PropertyRNA * parm ;
FunctionRNA * func ;
RNA_def_property_srna ( cprop , " ShaderNodes " ) ;
srna = RNA_def_struct ( brna , " ShaderNodes " , NULL ) ;
RNA_def_struct_sdna ( srna , " bNodeTree " ) ;
RNA_def_struct_ui_text ( srna , " Shader Nodes " , " Collection of Shader Nodes " ) ;
func = RNA_def_function ( srna , " new " , " rna_NodeTree_node_new " ) ;
RNA_def_function_ui_description ( func , " Add a node to this node tree. " ) ;
RNA_def_function_flag ( func , FUNC_USE_CONTEXT | FUNC_USE_REPORTS ) ;
parm = RNA_def_enum ( func , " type " , shader_node_type_items , 0 , " Type " , " Type of node to add " ) ;
RNA_def_property_flag ( parm , PROP_REQUIRED ) ;
2011-01-13 04:53:55 +00:00
RNA_def_pointer ( func , " group " , " NodeTree " , " " , " The group tree " ) ;
2010-12-02 01:18:59 +00:00
/* return value */
parm = RNA_def_pointer ( func , " node " , " Node " , " " , " New node. " ) ;
RNA_def_function_return ( func , parm ) ;
func = RNA_def_function ( srna , " remove " , " rna_NodeTree_node_remove " ) ;
RNA_def_function_ui_description ( func , " remove a node from this node tree. " ) ;
2010-12-05 18:59:23 +00:00
RNA_def_function_flag ( func , FUNC_USE_REPORTS ) ;
2010-12-02 01:18:59 +00:00
parm = RNA_def_pointer ( func , " node " , " Node " , " " , " The node to remove. " ) ;
RNA_def_property_flag ( parm , PROP_REQUIRED ) ;
}
static void rna_def_texture_nodetree_api ( BlenderRNA * brna , PropertyRNA * cprop )
{
StructRNA * srna ;
PropertyRNA * parm ;
FunctionRNA * func ;
RNA_def_property_srna ( cprop , " TextureNodes " ) ;
srna = RNA_def_struct ( brna , " TextureNodes " , NULL ) ;
RNA_def_struct_sdna ( srna , " bNodeTree " ) ;
RNA_def_struct_ui_text ( srna , " Texture Nodes " , " Collection of Texture Nodes " ) ;
func = RNA_def_function ( srna , " new " , " rna_NodeTree_node_texture_new " ) ;
RNA_def_function_ui_description ( func , " Add a node to this node tree. " ) ;
RNA_def_function_flag ( func , FUNC_USE_CONTEXT | FUNC_USE_REPORTS ) ;
parm = RNA_def_enum ( func , " type " , texture_node_type_items , 0 , " Type " , " Type of node to add " ) ;
RNA_def_property_flag ( parm , PROP_REQUIRED ) ;
2011-01-13 04:53:55 +00:00
RNA_def_pointer ( func , " group " , " NodeTree " , " " , " The group tree " ) ;
2010-12-02 01:18:59 +00:00
/* return value */
parm = RNA_def_pointer ( func , " node " , " Node " , " " , " New node. " ) ;
RNA_def_function_return ( func , parm ) ;
func = RNA_def_function ( srna , " remove " , " rna_NodeTree_node_remove " ) ;
RNA_def_function_ui_description ( func , " remove a node from this node tree. " ) ;
2010-12-05 18:59:23 +00:00
RNA_def_function_flag ( func , FUNC_USE_REPORTS ) ;
2010-12-02 01:18:59 +00:00
parm = RNA_def_pointer ( func , " node " , " Node " , " " , " The node to remove. " ) ;
RNA_def_property_flag ( parm , PROP_REQUIRED ) ;
}
2009-11-11 02:15:09 +00:00
static void rna_def_node_socket ( BlenderRNA * brna )
{
StructRNA * srna ;
2010-12-02 01:18:59 +00:00
PropertyRNA * prop ;
static EnumPropertyItem node_socket_type_items [ ] = {
{ SOCK_VALUE , " VALUE " , 0 , " Value " , " " } ,
{ SOCK_VECTOR , " VECTOR " , 0 , " Vector " , " " } ,
{ SOCK_RGBA , " RGBA " , 0 , " RGBA " , " " } ,
{ 0 , NULL , 0 , NULL , NULL } } ;
2009-11-11 02:15:09 +00:00
srna = RNA_def_struct ( brna , " NodeSocket " , NULL ) ;
RNA_def_struct_ui_text ( srna , " Node Socket " , " Input or output socket of a node " ) ;
RNA_def_struct_refine_func ( srna , " rna_NodeSocketType_refine " ) ;
RNA_def_struct_sdna ( srna , " bNodeSocket " ) ;
RNA_def_struct_ui_icon ( srna , ICON_PLUG ) ;
RNA_def_struct_path_func ( srna , " rna_NodeSocket_path " ) ;
2010-12-02 01:18:59 +00:00
prop = RNA_def_property ( srna , " name " , PROP_STRING , PROP_NONE ) ;
RNA_def_property_clear_flag ( prop , PROP_EDITABLE ) ;
RNA_def_property_ui_text ( prop , " Name " , " Socket name " ) ;
RNA_def_struct_name_property ( srna , prop ) ;
/* can add back if there is any use in reading them */
#if 0
prop = RNA_def_property ( srna , " min " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " ns.min " ) ;
RNA_def_property_clear_flag ( prop , PROP_EDITABLE ) ;
RNA_def_property_ui_text ( prop , " Minimum Value " , " " ) ;
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_NodeSocket_update " ) ;
prop = RNA_def_property ( srna , " max " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " ns.max " ) ;
RNA_def_property_clear_flag ( prop , PROP_EDITABLE ) ;
RNA_def_property_ui_text ( prop , " Maximum Value " , " " ) ;
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_NodeSocket_update " ) ;
# endif
prop = RNA_def_property ( srna , " type " , PROP_ENUM , PROP_NONE ) ;
RNA_def_property_clear_flag ( prop , PROP_EDITABLE ) ;
RNA_def_property_enum_items ( prop , node_socket_type_items ) ;
RNA_def_property_ui_text ( prop , " Type " , " Node Socket type " ) ;
2009-11-11 02:15:09 +00:00
}
static void rna_def_node_socket_value ( BlenderRNA * brna )
{
StructRNA * srna ;
PropertyRNA * prop ;
2010-12-02 01:18:59 +00:00
srna = RNA_def_struct ( brna , " ValueNodeSocket " , " NodeSocket " ) ;
2009-11-11 02:15:09 +00:00
RNA_def_struct_ui_text ( srna , " Value Node Socket " , " Input or output socket of a node " ) ;
RNA_def_struct_sdna ( srna , " bNodeSocket " ) ;
RNA_def_struct_ui_icon ( srna , ICON_PLUG ) ;
RNA_def_struct_path_func ( srna , " rna_NodeSocket_path " ) ;
2010-12-02 01:18:59 +00:00
2009-11-11 02:15:09 +00:00
prop = RNA_def_property ( srna , " default_value " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " ns.vec " ) ;
RNA_def_property_array ( prop , 1 ) ;
2010-02-10 21:15:44 +00:00
RNA_def_property_ui_text ( prop , " Default Value " , " Default value of the socket when no link is attached " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_NodeSocket_update " ) ;
2009-11-11 02:15:09 +00:00
RNA_def_property_float_funcs ( prop , NULL , NULL , " rna_NodeSocket_defvalue_range " ) ;
}
static void rna_def_node_socket_vector ( BlenderRNA * brna )
{
StructRNA * srna ;
PropertyRNA * prop ;
2010-12-02 01:18:59 +00:00
srna = RNA_def_struct ( brna , " VectorNodeSocket " , " NodeSocket " ) ;
2009-11-11 02:15:09 +00:00
RNA_def_struct_ui_text ( srna , " Vector Node Socket " , " Input or output socket of a node " ) ;
RNA_def_struct_sdna ( srna , " bNodeSocket " ) ;
RNA_def_struct_ui_icon ( srna , ICON_PLUG ) ;
RNA_def_struct_path_func ( srna , " rna_NodeSocket_path " ) ;
2010-12-02 01:18:59 +00:00
2009-11-11 02:15:09 +00:00
prop = RNA_def_property ( srna , " default_value " , PROP_FLOAT , PROP_XYZ ) ;
RNA_def_property_float_sdna ( prop , NULL , " ns.vec " ) ;
RNA_def_property_array ( prop , 3 ) ;
2010-02-10 21:15:44 +00:00
RNA_def_property_ui_text ( prop , " Default Value " , " Default value of the socket when no link is attached " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_NodeSocket_update " ) ;
2009-11-11 02:15:09 +00:00
RNA_def_property_float_funcs ( prop , NULL , NULL , " rna_NodeSocket_defvalue_range " ) ;
}
static void rna_def_node_socket_rgba ( BlenderRNA * brna )
{
StructRNA * srna ;
PropertyRNA * prop ;
2010-12-02 01:18:59 +00:00
srna = RNA_def_struct ( brna , " RGBANodeSocket " , " NodeSocket " ) ;
2009-11-11 02:15:09 +00:00
RNA_def_struct_ui_text ( srna , " RGBA Node Socket " , " Input or output socket of a node " ) ;
RNA_def_struct_sdna ( srna , " bNodeSocket " ) ;
RNA_def_struct_ui_icon ( srna , ICON_PLUG ) ;
RNA_def_struct_path_func ( srna , " rna_NodeSocket_path " ) ;
2010-12-02 01:18:59 +00:00
2009-11-11 02:15:09 +00:00
prop = RNA_def_property ( srna , " default_value " , PROP_FLOAT , PROP_COLOR ) ;
RNA_def_property_float_sdna ( prop , NULL , " ns.vec " ) ;
RNA_def_property_array ( prop , 4 ) ;
2010-02-10 21:15:44 +00:00
RNA_def_property_ui_text ( prop , " Default Value " , " Default value of the socket when no link is attached " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_NodeSocket_update " ) ;
2009-11-11 02:15:09 +00:00
RNA_def_property_float_funcs ( prop , NULL , NULL , " rna_NodeSocket_defvalue_range " ) ;
}
2009-03-22 14:46:45 +00:00
static void rna_def_node ( BlenderRNA * brna )
{
StructRNA * srna ;
PropertyRNA * prop ;
2008-12-26 01:37:05 +00:00
2009-05-31 16:45:30 +00:00
srna = RNA_def_struct ( brna , " Node " , NULL ) ;
2010-02-10 21:15:44 +00:00
RNA_def_struct_ui_text ( srna , " Node " , " Node in a node tree " ) ;
2008-12-26 01:37:05 +00:00
RNA_def_struct_sdna ( srna , " bNode " ) ;
2009-11-11 02:15:09 +00:00
RNA_def_struct_ui_icon ( srna , ICON_NODE ) ;
2009-03-22 14:46:45 +00:00
RNA_def_struct_refine_func ( srna , " rna_Node_refine " ) ;
2009-09-05 04:04:51 +00:00
RNA_def_struct_path_func ( srna , " rna_Node_path " ) ;
2008-12-26 01:37:05 +00:00
RNA: subtypes and units
* Reviewed subtypes, making them more specific and adding new ones.
* Subtypes now have an associated type of units (length, area, volume,
mass, rotation, time, velocity, acceleration). These are not used
yet anywhere.
* Centralized code that decides the name of array items based on
subtype (XYZ, RGB), was copied in 3 places.
* RNA_def_float etc functions still need to be update, will do this
later together with another change.
2009-08-10 21:31:05 +00:00
prop = RNA_def_property ( srna , " location " , PROP_FLOAT , PROP_XYZ ) ;
2008-12-26 01:37:05 +00:00
RNA_def_property_float_sdna ( prop , NULL , " locx " ) ;
RNA_def_property_array ( prop , 2 ) ;
RNA_def_property_range ( prop , - 10000.0f , 10000.0f ) ;
RNA_def_property_ui_text ( prop , " Location " , " " ) ;
2009-11-11 09:11:21 +00:00
RNA_def_property_update ( prop , NC_NODE , " rna_Node_update " ) ;
2008-12-26 01:37:05 +00:00
2009-05-31 16:45:30 +00:00
prop = RNA_def_property ( srna , " name " , PROP_STRING , PROP_NONE ) ;
2010-02-10 21:15:44 +00:00
RNA_def_property_ui_text ( prop , " Name " , " Node name " ) ;
2008-12-26 01:37:05 +00:00
RNA_def_struct_name_property ( srna , prop ) ;
2010-10-15 10:25:43 +00:00
RNA_def_property_string_funcs ( prop , NULL , NULL , " rna_Node_name_set " ) ;
RNA_def_property_update ( prop , NC_NODE | NA_EDITED , " rna_Node_update " ) ;
2009-11-11 02:15:09 +00:00
prop = RNA_def_property ( srna , " inputs " , PROP_COLLECTION , PROP_NONE ) ;
RNA_def_property_collection_sdna ( prop , NULL , " inputs " , NULL ) ;
RNA_def_property_struct_type ( prop , " NodeSocket " ) ;
RNA_def_property_ui_text ( prop , " Inputs " , " " ) ;
prop = RNA_def_property ( srna , " outputs " , PROP_COLLECTION , PROP_NONE ) ;
RNA_def_property_collection_sdna ( prop , NULL , " outputs " , NULL ) ;
RNA_def_property_struct_type ( prop , " NodeSocket " ) ;
RNA_def_property_ui_text ( prop , " Outputs " , " " ) ;
2008-12-26 01:37:05 +00:00
}
2010-11-13 22:38:33 +00:00
static void rna_def_node_link ( BlenderRNA * brna )
{
StructRNA * srna ;
PropertyRNA * prop ;
srna = RNA_def_struct ( brna , " NodeLink " , NULL ) ;
RNA_def_struct_ui_text ( srna , " NodeLink " , " Link between nodes in a node tree " ) ;
RNA_def_struct_sdna ( srna , " bNodeLink " ) ;
RNA_def_struct_ui_icon ( srna , ICON_NODE ) ;
prop = RNA_def_property ( srna , " from_node " , PROP_POINTER , PROP_NONE ) ;
RNA_def_property_pointer_sdna ( prop , NULL , " fromnode " ) ;
RNA_def_property_struct_type ( prop , " Node " ) ;
RNA_def_property_ui_text ( prop , " From node " , " " ) ;
prop = RNA_def_property ( srna , " to_node " , PROP_POINTER , PROP_NONE ) ;
RNA_def_property_pointer_sdna ( prop , NULL , " tonode " ) ;
RNA_def_property_struct_type ( prop , " Node " ) ;
RNA_def_property_ui_text ( prop , " To node " , " " ) ;
prop = RNA_def_property ( srna , " from_socket " , PROP_POINTER , PROP_NONE ) ;
RNA_def_property_pointer_sdna ( prop , NULL , " fromsock " ) ;
RNA_def_property_struct_type ( prop , " NodeSocket " ) ;
RNA_def_property_ui_text ( prop , " From socket " , " " ) ;
prop = RNA_def_property ( srna , " to_socket " , PROP_POINTER , PROP_NONE ) ;
RNA_def_property_pointer_sdna ( prop , NULL , " tosock " ) ;
RNA_def_property_struct_type ( prop , " NodeSocket " ) ;
RNA_def_property_ui_text ( prop , " To socket " , " " ) ;
}
2009-03-22 14:46:45 +00:00
static void rna_def_nodetree ( BlenderRNA * brna )
2008-11-27 00:23:22 +00:00
{
StructRNA * srna ;
PropertyRNA * prop ;
2010-12-02 01:18:59 +00:00
/* FunctionRNA *func; */
/* PropertyRNA *parm; */
static EnumPropertyItem nodetree_type_items [ ] = {
{ NTREE_SHADER , " SHADER " , 0 , " Shader " , " " } ,
{ NTREE_COMPOSIT , " COMPOSITE " , 0 , " Composite " , " " } ,
{ NTREE_TEXTURE , " TEXTURE " , 0 , " Texture " , " " } ,
{ 0 , NULL , 0 , NULL , NULL } } ;
2008-11-27 00:23:22 +00:00
2009-05-31 16:45:30 +00:00
srna = RNA_def_struct ( brna , " NodeTree " , " ID " ) ;
2010-02-10 21:15:44 +00:00
RNA_def_struct_ui_text ( srna , " Node Tree " , " Node tree consisting of linked nodes used for materials, textures and compositing " ) ;
2008-11-29 01:04:15 +00:00
RNA_def_struct_sdna ( srna , " bNodeTree " ) ;
2009-11-11 02:15:09 +00:00
RNA_def_struct_ui_icon ( srna , ICON_NODETREE ) ;
2010-12-02 01:18:59 +00:00
RNA_def_struct_refine_func ( srna , " rna_NodeTree_refine " ) ;
2009-11-11 08:12:54 +00:00
/* AnimData */
2009-09-19 11:59:23 +00:00
rna_def_animdata_common ( srna ) ;
2009-11-11 08:12:54 +00:00
2010-11-13 22:38:33 +00:00
/* NodeLinks Collection */
prop = RNA_def_property ( srna , " links " , PROP_COLLECTION , PROP_NONE ) ;
RNA_def_property_collection_sdna ( prop , NULL , " links " , NULL ) ;
RNA_def_property_struct_type ( prop , " NodeLink " ) ;
RNA_def_property_ui_text ( prop , " Links " , " " ) ;
2010-12-02 01:18:59 +00:00
rna_def_nodetree_link_api ( brna , prop ) ;
2009-11-11 08:12:54 +00:00
/* Grease Pencil */
prop = RNA_def_property ( srna , " grease_pencil " , PROP_POINTER , PROP_NONE ) ;
RNA_def_property_pointer_sdna ( prop , NULL , " gpd " ) ;
RNA_def_property_flag ( prop , PROP_EDITABLE ) ;
RNA_def_property_struct_type ( prop , " GreasePencil " ) ;
RNA_def_property_ui_text ( prop , " Grease Pencil Data " , " Grease Pencil datablock " ) ;
2010-12-02 01:18:59 +00:00
/* these are too much like operators, better to have data level access
* ngroup = bpy . data . node_groups . new ( )
* ngroup . nodes . new ( . . . . ) etc . */
#if 0
func = RNA_def_function ( srna , " group_add " , " nodeMakeGroupFromSelected " ) ;
RNA_def_function_ui_description ( func , " Make a group from the active nodes. " ) ;
/* return */
parm = RNA_def_pointer ( func , " group " , " Node " , " " , " New group. " ) ;
RNA_def_function_return ( func , parm ) ;
func = RNA_def_function ( srna , " ungroup " , " nodeGroupUnGroup " ) ;
RNA_def_function_ui_description ( func , " Ungroup node group " ) ;
parm = RNA_def_pointer ( func , " group " , " Node " , " " , " The group to ungroup. " ) ;
RNA_def_property_flag ( parm , PROP_REQUIRED ) ;
parm = RNA_def_int ( func , " bool " , 0 , 0 , 1 , " Bool " , " " , 0 , 1 ) ;
RNA_def_function_return ( func , parm ) ;
# endif
prop = RNA_def_property ( srna , " type " , PROP_ENUM , PROP_NONE ) ;
RNA_def_property_clear_flag ( prop , PROP_EDITABLE ) ;
RNA_def_property_enum_items ( prop , nodetree_type_items ) ;
RNA_def_property_ui_text ( prop , " Type " , " Node Tree type " ) ;
}
static void rna_def_composite_nodetree ( BlenderRNA * brna )
{
StructRNA * srna ;
PropertyRNA * prop ;
srna = RNA_def_struct ( brna , " CompositorNodeTree " , " NodeTree " ) ;
RNA_def_struct_ui_text ( srna , " Compositor Node Tree " , " Node tree consisting of linked nodes used for compositing " ) ;
RNA_def_struct_sdna ( srna , " bNodeTree " ) ;
RNA_def_struct_ui_icon ( srna , ICON_NODETREE ) ;
/* Nodes Collection */
prop = RNA_def_property ( srna , " nodes " , PROP_COLLECTION , PROP_NONE ) ;
RNA_def_property_collection_sdna ( prop , NULL , " nodes " , NULL ) ;
RNA_def_property_struct_type ( prop , " Node " ) ;
RNA_def_property_ui_text ( prop , " Nodes " , " " ) ;
rna_def_composite_nodetree_api ( brna , prop ) ;
}
static void rna_def_shader_nodetree ( BlenderRNA * brna )
{
StructRNA * srna ;
PropertyRNA * prop ;
srna = RNA_def_struct ( brna , " ShaderNodeTree " , " NodeTree " ) ;
RNA_def_struct_ui_text ( srna , " Shader Node Tree " , " Node tree consisting of linked nodes used for materials " ) ;
RNA_def_struct_sdna ( srna , " bNodeTree " ) ;
RNA_def_struct_ui_icon ( srna , ICON_NODETREE ) ;
/* Nodes Collection */
prop = RNA_def_property ( srna , " nodes " , PROP_COLLECTION , PROP_NONE ) ;
RNA_def_property_collection_sdna ( prop , NULL , " nodes " , NULL ) ;
RNA_def_property_struct_type ( prop , " Node " ) ;
RNA_def_property_ui_text ( prop , " Nodes " , " " ) ;
rna_def_shader_nodetree_api ( brna , prop ) ;
}
static void rna_def_texture_nodetree ( BlenderRNA * brna )
{
StructRNA * srna ;
PropertyRNA * prop ;
srna = RNA_def_struct ( brna , " TextureNodeTree " , " NodeTree " ) ;
RNA_def_struct_ui_text ( srna , " Texture Node Tree " , " Node tree consisting of linked nodes used for textures " ) ;
RNA_def_struct_sdna ( srna , " bNodeTree " ) ;
RNA_def_struct_ui_icon ( srna , ICON_NODETREE ) ;
/* Nodes Collection */
prop = RNA_def_property ( srna , " nodes " , PROP_COLLECTION , PROP_NONE ) ;
RNA_def_property_collection_sdna ( prop , NULL , " nodes " , NULL ) ;
RNA_def_property_struct_type ( prop , " Node " ) ;
RNA_def_property_ui_text ( prop , " Nodes " , " " ) ;
rna_def_texture_nodetree_api ( brna , prop ) ;
2009-03-22 14:46:45 +00:00
}
2009-06-04 14:11:39 +00:00
static void define_specific_node ( BlenderRNA * brna , int id , void ( * func ) ( StructRNA * ) )
2009-03-24 17:40:58 +00:00
{
2009-06-04 14:11:39 +00:00
StructRNA * srna = def_node ( brna , id ) ;
if ( func )
func ( srna ) ;
2009-03-24 17:40:58 +00:00
}
2009-03-22 14:46:45 +00:00
void RNA_def_nodetree ( BlenderRNA * brna )
{
2009-03-24 17:40:58 +00:00
init ( ) ;
2009-03-22 14:46:45 +00:00
rna_def_nodetree ( brna ) ;
2009-11-11 02:15:09 +00:00
rna_def_node_socket ( brna ) ;
rna_def_node_socket_value ( brna ) ;
rna_def_node_socket_vector ( brna ) ;
rna_def_node_socket_rgba ( brna ) ;
2008-12-26 01:37:05 +00:00
rna_def_node ( brna ) ;
2010-11-13 22:38:33 +00:00
rna_def_node_link ( brna ) ;
2009-03-22 14:46:45 +00:00
rna_def_shader_node ( brna ) ;
2009-03-24 17:40:58 +00:00
rna_def_compositor_node ( brna ) ;
rna_def_texture_node ( brna ) ;
2010-12-02 01:18:59 +00:00
rna_def_composite_nodetree ( brna ) ;
rna_def_shader_nodetree ( brna ) ;
rna_def_texture_nodetree ( brna ) ;
2009-03-24 17:40:58 +00:00
# define DefNode(Category, ID, DefFunc, EnumName, StructName, UIName, UIDesc) \
2009-06-04 14:11:39 +00:00
define_specific_node ( brna , ID , DefFunc ) ;
2009-03-24 17:40:58 +00:00
# include "rna_nodetree_types.h"
# undef DefNode
2010-01-13 06:35:12 +00:00
define_specific_node ( brna , NODE_GROUP , def_group ) ;
2008-11-27 00:23:22 +00:00
}
# endif