diff options
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r-- | source/blender/makesrna/intern/rna_nodetree.c | 395 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_nodetree_types.h | 42 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_object_api.c | 6 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_render.c | 58 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_space.c | 19 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_ui_api.c | 20 |
6 files changed, 526 insertions, 14 deletions
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 1445cf3b537..55432511730 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -108,6 +108,27 @@ EnumPropertyItem node_filter_items[] = { {6, "SHADOW", 0, "Shadow", ""}, {0, NULL, 0, NULL, NULL}}; +EnumPropertyItem prop_noise_basis_items[] = { + {SHD_NOISE_PERLIN, "PERLIN", 0, "Perlin", ""}, + {SHD_NOISE_VORONOI_F1, "VORONOI_F1", 0, "Voronoi F1", ""}, + {SHD_NOISE_VORONOI_F2, "VORONOI_F2", 0, "Voronoi F2", ""}, + {SHD_NOISE_VORONOI_F3, "VORONOI_F3", 0, "Voronoi F3", ""}, + {SHD_NOISE_VORONOI_F4, "VORONOI_F4", 0, "Voronoi F4", ""}, + {SHD_NOISE_VORONOI_F2_F1, "VORONOI_F2_F1", 0, "Voronoi F2-F1", ""}, + {SHD_NOISE_VORONOI_CRACKLE, "VORONOI_CRACKLE", 0, "Voronoi Crackle", ""}, + {SHD_NOISE_CELL_NOISE, "CELL_NOISE", 0, "Cell Noise", ""}, + {0, NULL, 0, NULL, NULL}}; + +EnumPropertyItem prop_noise_type_items[] = { + {SHD_NOISE_SOFT, "SOFT", 0, "Soft", ""}, + {SHD_NOISE_HARD, "HARD", 0, "Hard", ""}, + {0, NULL, 0, NULL, NULL}}; + +EnumPropertyItem prop_wave_items[] = { + {SHD_WAVE_SINE, "SINE", 0, "Sine", "Uses a sine wave to produce bands"}, + {SHD_WAVE_SAW, "SAW", 0, "Saw", "Uses a saw wave to produce bands"}, + {SHD_WAVE_TRI, "TRI", 0, "Tri", "Uses a triangle wave to produce bands"}, + {0, NULL, 0, NULL, NULL}}; /* Add any new socket value subtype here. * When adding a new subtype here, make sure you also add it @@ -771,6 +792,12 @@ static EnumPropertyItem node_ycc_items[] = { { 2, "JFIF", 0, "Jpeg", ""}, {0, NULL, 0, NULL, NULL}}; +static EnumPropertyItem node_glossy_items[] = { +{SHD_GLOSSY_SHARP, "SHARP", 0, "Sharp", ""}, +{SHD_GLOSSY_BECKMANN, "BECKMANN", 0, "Beckmann", ""}, +{SHD_GLOSSY_GGX, "GGX", 0, "GGX", ""}, +{0, NULL, 0, NULL, NULL}}; + #define MaxNodes 50000 enum @@ -1138,6 +1165,357 @@ static void def_sh_geometry(StructRNA *srna) RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); } +static void def_sh_attribute(StructRNA *srna) +{ + PropertyRNA *prop; + + RNA_def_struct_sdna_from(srna, "NodeShaderAttribute", "storage"); + + prop = RNA_def_property(srna, "attribute_name", PROP_STRING, PROP_NONE); + RNA_def_property_string_sdna(prop, NULL, "name"); + RNA_def_property_ui_text(prop, "Attribute Name", ""); + RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); +} + +static void def_sh_tex_sky(StructRNA *srna) +{ + PropertyRNA *prop; + + RNA_def_struct_sdna_from(srna, "NodeTexSky", "storage"); + + prop = RNA_def_property(srna, "sun_direction", PROP_FLOAT, PROP_DIRECTION); + RNA_def_property_ui_text(prop, "Sun Direction", "Direction from where the sun is shining"); + RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); + + prop = RNA_def_property(srna, "turbidity", PROP_FLOAT, PROP_NONE); + RNA_def_property_ui_text(prop, "Turbidity", ""); + RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); +} + +static void def_sh_tex_environment(StructRNA *srna) +{ + static const EnumPropertyItem prop_color_space_items[]= { + {SHD_COLORSPACE_SRGB, "SRGB", 0, "sRGB", "Image is in sRGB color space"}, + {SHD_COLORSPACE_LINEAR, "LINEAR", 0, "Linear", "Image is in scene linear color space"}, + {0, NULL, 0, NULL, NULL}}; + + PropertyRNA *prop; + + 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"); + + RNA_def_struct_sdna_from(srna, "NodeTexImage", "storage"); + + prop= RNA_def_property(srna, "color_space", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_items(prop, prop_color_space_items); + RNA_def_property_ui_text(prop, "Color Space", "Image file color space"); + RNA_def_property_update(prop, 0, "rna_Node_update"); +} + +static void def_sh_tex_image(StructRNA *srna) +{ + static const EnumPropertyItem prop_color_space_items[]= { + {SHD_COLORSPACE_LINEAR, "LINEAR", 0, "Linear", "Image is in scene linear color space"}, + {SHD_COLORSPACE_SRGB, "SRGB", 0, "sRGB", "Image is in sRGB color space"}, + {0, NULL, 0, NULL, NULL}}; + + PropertyRNA *prop; + + 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"); + + RNA_def_struct_sdna_from(srna, "NodeTexImage", "storage"); + + prop= RNA_def_property(srna, "color_space", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_items(prop, prop_color_space_items); + RNA_def_property_ui_text(prop, "Color Space", "Image file color space"); + RNA_def_property_update(prop, 0, "rna_Node_update"); +} + +static void def_sh_tex_blend(StructRNA *srna) +{ + static EnumPropertyItem prop_blend_progression[] = { + {SHD_BLEND_LINEAR, "LINEAR", 0, "Linear", "Creates a linear progression"}, + {SHD_BLEND_QUADRATIC, "QUADRATIC", 0, "Quadratic", "Creates a quadratic progression"}, + {SHD_BLEND_EASING, "EASING", 0, "Easing", "Creates a progression easing from one step to the next"}, + {SHD_BLEND_DIAGONAL, "DIAGONAL", 0, "Diagonal", "Creates a diagonal progression"}, + {SHD_BLEND_SPHERICAL, "SPHERICAL", 0, "Spherical", "Creates a spherical progression"}, + {SHD_BLEND_QUADRATIC_SPHERE, "QUADRATIC_SPHERE", 0, "Quadratic sphere", "Creates a quadratic progression in the shape of a sphere"}, + {SHD_BLEND_RADIAL, "RADIAL", 0, "Radial", "Creates a radial progression"}, + {0, NULL, 0, NULL, NULL}}; + + static const EnumPropertyItem prop_axis_items[]= { + {SHD_BLEND_HORIZONTAL, "HORIZONTAL", 0, "Horizontal", "Flips the texture's X and Y axis"}, + {SHD_BLEND_VERTICAL, "VERTICAL", 0, "Vertical", "Flips the texture's X and Y axis"}, + {0, NULL, 0, NULL, NULL}}; + + PropertyRNA *prop; + + RNA_def_struct_sdna_from(srna, "NodeTexBlend", "storage"); + + prop= RNA_def_property(srna, "progression", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "progression"); + RNA_def_property_enum_items(prop, prop_blend_progression); + RNA_def_property_ui_text(prop, "Progression", "Sets the style of the color blending"); + RNA_def_property_update(prop, 0, "rna_Node_update"); + + prop= RNA_def_property(srna, "axis", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_bitflag_sdna(prop, NULL, "axis"); + RNA_def_property_enum_items(prop, prop_axis_items); + RNA_def_property_ui_text(prop, "Axis", "Flips the texture's X and Y axis"); + RNA_def_property_update(prop, 0, "rna_Node_update"); +} + +static void def_sh_tex_clouds(StructRNA *srna) +{ + PropertyRNA *prop; + + RNA_def_struct_sdna_from(srna, "NodeTexClouds", "storage"); + + prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "basis"); + RNA_def_property_enum_items(prop, prop_noise_basis_items); + RNA_def_property_ui_text(prop, "Noise Basis", "Sets the noise basis used for turbulence"); + RNA_def_property_update(prop, 0, "rna_Node_update"); + + prop= RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "hard"); + RNA_def_property_enum_items(prop, prop_noise_type_items); + RNA_def_property_ui_text(prop, "Noise Type", ""); + RNA_def_property_update(prop, 0, "rna_Node_update"); + + prop= RNA_def_property(srna, "turbulence_depth", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "depth"); + RNA_def_property_range(prop, 0, 30); + RNA_def_property_ui_text(prop, "Depth", "Level of detail in the added turbulent noise"); + RNA_def_property_update(prop, 0, "rna_Node_update"); +} + +static void def_sh_tex_distnoise(StructRNA *srna) +{ + PropertyRNA *prop; + + RNA_def_struct_sdna_from(srna, "NodeTexDistortedNoise", "storage"); + + prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "basis"); + RNA_def_property_enum_items(prop, prop_noise_basis_items); + RNA_def_property_ui_text(prop, "Noise Basis", "Sets the noise basis used for turbulence"); + RNA_def_property_update(prop, 0, "rna_Node_update"); + + prop= RNA_def_property(srna, "noise_distortion", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "distortion_basis"); + RNA_def_property_enum_items(prop, prop_noise_basis_items); + RNA_def_property_ui_text(prop, "Noise Distortion", "Sets the noise basis used for distortion"); + RNA_def_property_update(prop, 0, "rna_Node_update"); +} + +static void def_sh_tex_magic(StructRNA *srna) +{ + PropertyRNA *prop; + + RNA_def_struct_sdna_from(srna, "NodeTexMagic", "storage"); + + prop= RNA_def_property(srna, "turbulence_depth", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "depth"); + RNA_def_property_range(prop, 0, 10); + RNA_def_property_ui_text(prop, "Depth", "Level of detail in the added turbulent noise"); + RNA_def_property_update(prop, 0, "rna_Node_update"); +} + +static void def_sh_tex_marble(StructRNA *srna) +{ + static EnumPropertyItem prop_marble_stype[] = { + {SHD_MARBLE_SOFT, "SOFT", 0, "Soft", "Uses soft marble"}, + {SHD_MARBLE_SHARP, "SHARP", 0, "Sharp", "Uses more clearly defined marble"}, + {SHD_MARBLE_SHARPER, "SHARPER", 0, "Sharper", "Uses very clearly defined marble"}, + {0, NULL, 0, NULL, NULL}}; + + PropertyRNA *prop; + + RNA_def_struct_sdna_from(srna, "NodeTexMarble", "storage"); + + prop= RNA_def_property(srna, "marble_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "type"); + RNA_def_property_enum_items(prop, prop_marble_stype); + RNA_def_property_ui_text(prop, "Type", ""); + RNA_def_property_update(prop, 0, "rna_Node_update"); + + prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "basis"); + RNA_def_property_enum_items(prop, prop_noise_basis_items); + RNA_def_property_ui_text(prop, "Noise Basis", "Sets the noise basis used for turbulence"); + RNA_def_property_update(prop, 0, "rna_Node_update"); + + prop= RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "hard"); + RNA_def_property_enum_items(prop, prop_noise_type_items); + RNA_def_property_ui_text(prop, "Noise Type", ""); + RNA_def_property_update(prop, 0, "rna_Node_update"); + + prop= RNA_def_property(srna, "turbulence_depth", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "depth"); + RNA_def_property_range(prop, 0, 30); + RNA_def_property_ui_text(prop, "Depth", "Level of detail in the added turbulent noise"); + RNA_def_property_update(prop, 0, "rna_Node_update"); + + prop= RNA_def_property(srna, "wave_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "wave"); + RNA_def_property_enum_items(prop, prop_wave_items); + RNA_def_property_ui_text(prop, "Wave Type", ""); + RNA_def_property_update(prop, 0, "rna_Node_update"); +} + +static void def_sh_tex_musgrave(StructRNA *srna) +{ + static EnumPropertyItem prop_musgrave_type[] = { + {SHD_MUSGRAVE_MULTIFRACTAL, "MULTIFRACTAL", 0, "Multifractal", ""}, + {SHD_MUSGRAVE_RIDGED_MULTIFRACTAL, "RIDGED_MULTIFRACTAL", 0, "Ridged Multifractal", ""}, + {SHD_MUSGRAVE_HYBRID_MULTIFRACTAL, "HYBRID_MULTIFRACTAL", 0, "Hybrid Multifractal", ""}, + {SHD_MUSGRAVE_FBM, "FBM", 0, "fBM", ""}, + {SHD_MUSGRAVE_HETERO_TERRAIN, "HETERO_TERRAIN", 0, "Hetero Terrain", ""}, + {0, NULL, 0, NULL, NULL}}; + + PropertyRNA *prop; + + RNA_def_struct_sdna_from(srna, "NodeTexMusgrave", "storage"); + + prop= RNA_def_property(srna, "musgrave_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "type"); + RNA_def_property_enum_items(prop, prop_musgrave_type); + RNA_def_property_ui_text(prop, "Type", ""); + RNA_def_property_update(prop, 0, "rna_Node_update"); + + prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "basis"); + RNA_def_property_enum_items(prop, prop_noise_basis_items); + RNA_def_property_ui_text(prop, "Noise Basis", "Sets the noise basis used for turbulence"); + RNA_def_property_update(prop, 0, "rna_Node_update"); +} + +static void def_sh_tex_stucci(StructRNA *srna) +{ + static EnumPropertyItem prop_stucci_stype[] = { + {SHD_STUCCI_PLASTIC, "PLASTIC", 0, "Plastic", "Uses standard stucci"}, + {SHD_STUCCI_WALL_IN, "WALL_IN", 0, "Wall in", "Creates Dimples"}, + {SHD_STUCCI_WALL_OUT, "WALL_OUT", 0, "Wall out", "Creates Ridges"}, + {0, NULL, 0, NULL, NULL}}; + + PropertyRNA *prop; + + RNA_def_struct_sdna_from(srna, "NodeTexStucci", "storage"); + + prop= RNA_def_property(srna, "stucci_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "type"); + RNA_def_property_enum_items(prop, prop_stucci_stype); + RNA_def_property_ui_text(prop, "Type", ""); + RNA_def_property_update(prop, 0, "rna_Node_update"); + + prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "basis"); + RNA_def_property_enum_items(prop, prop_noise_basis_items); + RNA_def_property_ui_text(prop, "Noise Basis", "Sets the noise basis used for turbulence"); + RNA_def_property_update(prop, 0, "rna_Node_update"); + + prop= RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "hard"); + RNA_def_property_enum_items(prop, prop_noise_type_items); + RNA_def_property_ui_text(prop, "Noise Type", ""); + RNA_def_property_update(prop, 0, "rna_Node_update"); +} + +static void def_sh_tex_voronoi(StructRNA *srna) +{ + static EnumPropertyItem prop_distance_metric_items[] = { + {SHD_VORONOI_ACTUAL_DISTANCE, "DISTANCE", 0, "Actual Distance", ""}, + {SHD_VORONOI_DISTANCE_SQUARED, "DISTANCE_SQUARED", 0, "Distance Squared", ""}, + {SHD_VORONOI_MANHATTAN, "MANHATTAN", 0, "Manhattan", ""}, + {SHD_VORONOI_CHEBYCHEV, "CHEBYCHEV", 0, "Chebychev", ""}, + {SHD_VORONOI_MINKOVSKY_H, "MINKOVSKY_HALF", 0, "Minkovsky 1/2", ""}, + {SHD_VORONOI_MINKOVSKY_4, "MINKOVSKY_FOUR", 0, "Minkovsky 4", ""}, + {SHD_VORONOI_MINKOVSKY, "MINKOVSKY", 0, "Minkovsky", ""}, + {0, NULL, 0, NULL, NULL}}; + + static EnumPropertyItem prop_coloring_items[] = { + {SHD_VORONOI_INTENSITY, "INTENSITY", 0, "Intensity", "Only calculate intensity"}, + {SHD_VORONOI_POSITION, "POSITION", 0, "Position", "Color cells by position"}, + {SHD_VORONOI_POSITION_OUTLINE, "POSITION_OUTLINE", 0, "Position and Outline", "Use position plus an outline based on F2-F.1"}, + {SHD_VORONOI_POSITION_OUTLINE_INTENSITY, "POSITION_OUTLINE_INTENSITY", 0, "Position, Outline, and Intensity", "Multiply position and outline by intensity"}, + {0, NULL, 0, NULL, NULL}}; + + PropertyRNA *prop; + + RNA_def_struct_sdna_from(srna, "NodeTexVoronoi", "storage"); + + prop= RNA_def_property(srna, "distance_metric", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "distance_metric"); + RNA_def_property_enum_items(prop, prop_distance_metric_items); + RNA_def_property_ui_text(prop, "Distance Metric", ""); + RNA_def_property_update(prop, 0, "rna_Node_update"); + + prop= RNA_def_property(srna, "coloring", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "coloring"); + RNA_def_property_enum_items(prop, prop_coloring_items); + RNA_def_property_ui_text(prop, "Coloring", ""); + RNA_def_property_update(prop, 0, "rna_Node_update"); +} + +static void def_sh_tex_wood(StructRNA *srna) +{ + static EnumPropertyItem prop_wood_type_items[] = { + {SHD_WOOD_BANDS, "BANDS", 0, "Bands", "Uses standard wood texture in bands"}, + {SHD_WOOD_RINGS, "RINGS", 0, "Rings", "Uses wood texture in rings"}, + {SHD_WOOD_BAND_NOISE, "BAND_NOISE", 0, "Band Noise", "Adds noise to standard wood"}, + {SHD_WOOD_RING_NOISE, "RING_NOISE", 0, "Ring Noise", "Adds noise to rings"}, + {0, NULL, 0, NULL, NULL}}; + + PropertyRNA *prop; + + RNA_def_struct_sdna_from(srna, "NodeTexWood", "storage"); + + prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "basis"); + RNA_def_property_enum_items(prop, prop_noise_basis_items); + RNA_def_property_ui_text(prop, "Noise Basis", "Sets the noise basis used for turbulence"); + RNA_def_property_update(prop, 0, "rna_Node_update"); + + prop= RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "hard"); + RNA_def_property_enum_items(prop, prop_noise_type_items); + RNA_def_property_ui_text(prop, "Noise Type", ""); + RNA_def_property_update(prop, 0, "rna_Node_update"); + + prop= RNA_def_property(srna, "wood_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "type"); + RNA_def_property_enum_items(prop, prop_wood_type_items); + RNA_def_property_ui_text(prop, "Wood Type", ""); + RNA_def_property_update(prop, 0, "rna_Node_update"); + + prop= RNA_def_property(srna, "wave_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "wave"); + RNA_def_property_enum_items(prop, prop_wave_items); + RNA_def_property_ui_text(prop, "Wave Type", ""); + RNA_def_property_update(prop, 0, "rna_Node_update"); +} + +static void def_glossy(StructRNA *srna) +{ + PropertyRNA *prop; + + prop = RNA_def_property(srna, "distribution", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "custom1"); + RNA_def_property_enum_items(prop, node_glossy_items); + RNA_def_property_ui_text(prop, "Distribution", ""); + RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); +} /* -- Compositor Nodes ------------------------------------------------------ */ @@ -2674,6 +3052,16 @@ static void rna_def_node_socket(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Name", "Socket name"); RNA_def_struct_name_property(srna, prop); RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_NodeGroupSocket_update"); + + prop = RNA_def_property(srna, "group_socket", PROP_POINTER, PROP_NONE); + RNA_def_property_pointer_sdna(prop, NULL, "groupsock"); + RNA_def_property_struct_type(prop, "NodeSocket"); + RNA_def_property_ui_text(prop, "Group Socket", "For group nodes, the group input or output socket this corresponds to"); + + prop = RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SOCK_COLLAPSED); + RNA_def_property_ui_text(prop, "Expanded", "Socket links are expanded in the user interface"); + RNA_def_property_update(prop, NC_NODE|NA_EDITED, NULL); } static void rna_def_node_socket_subtype(BlenderRNA *brna, int type, int subtype, const char *name, const char *ui_name) @@ -2682,7 +3070,7 @@ static void rna_def_node_socket_subtype(BlenderRNA *brna, int type, int subtype, PropertyRNA *prop=NULL; PropertySubType propsubtype= PROP_NONE; - #define SUBTYPE(socktype, stypename, id, idname) { PROP_##id, #id, 0, #idname, ""}, + #define SUBTYPE(socktype, stypename, id, idname) { PROP_##id, #socktype "_" #id, 0, #idname, ""}, static EnumPropertyItem subtype_items[] = { NODE_DEFINE_SUBTYPES {0, NULL, 0, NULL, NULL} @@ -2809,6 +3197,11 @@ static void rna_def_node(BlenderRNA *brna) RNA_def_property_struct_type(prop, "Node"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Parent", "Parent this node is attached to"); + + prop = RNA_def_property(srna, "show_texture", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", NODE_ACTIVE_TEXTURE); + RNA_def_property_ui_text(prop, "Show Texture", "Draw node in viewport textured draw mode"); + RNA_def_property_update(prop, 0, "rna_Node_update"); } static void rna_def_node_link(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_nodetree_types.h b/source/blender/makesrna/intern/rna_nodetree_types.h index 1bbf47db094..6744dc77469 100644 --- a/source/blender/makesrna/intern/rna_nodetree_types.h +++ b/source/blender/makesrna/intern/rna_nodetree_types.h @@ -40,7 +40,7 @@ DefNode( ShaderNode, SH_NODE_VALTORGB, def_colorramp, "VALTO DefNode( ShaderNode, SH_NODE_RGBTOBW, 0, "RGBTOBW", RGBToBW, "RGB to BW", "" ) DefNode( ShaderNode, SH_NODE_TEXTURE, def_texture, "TEXTURE", Texture, "Texture", "" ) DefNode( ShaderNode, SH_NODE_NORMAL, 0, "NORMAL", Normal, "Normal", "" ) -DefNode( ShaderNode, SH_NODE_GEOMETRY, def_sh_geometry, "GEOMETRY", Geometry, "Geometry", "" ) +DefNode( ShaderNode, SH_NODE_GEOM, def_sh_geometry, "GEOM", Geom, "Geometry", "" ) DefNode( ShaderNode, SH_NODE_MAPPING, def_sh_mapping, "MAPPING", Mapping, "Mapping", "" ) DefNode( ShaderNode, SH_NODE_CURVE_VEC, def_vector_curve, "CURVE_VEC", VectorCurve, "Vector Curve", "" ) DefNode( ShaderNode, SH_NODE_CURVE_RGB, def_rgb_curve, "CURVE_RGB", RGBCurve, "RGB Curve", "" ) @@ -53,7 +53,45 @@ DefNode( ShaderNode, SH_NODE_INVERT, 0, "INVER DefNode( ShaderNode, SH_NODE_SEPRGB, 0, "SEPRGB", SeparateRGB, "Separate RGB", "" ) DefNode( ShaderNode, SH_NODE_COMBRGB, 0, "COMBRGB", CombineRGB, "Combine RGB", "" ) DefNode( ShaderNode, SH_NODE_HUE_SAT, 0, "HUE_SAT", HueSaturation, "Hue/Saturation", "" ) - +DefNode( ShaderNode, SH_NODE_OUTPUT_MATERIAL, 0, "OUTPUT_MATERIAL",OutputMaterial, "Material Output", "" ) +DefNode( ShaderNode, SH_NODE_OUTPUT_LAMP, 0, "OUTPUT_LAMP", OutputLamp, "Lamp Output", "" ) +//DefNode( ShaderNode, SH_NODE_OUTPUT_TEXTURE, 0, "OUTPUT_TEXTURE", OutputTexture, "Texture Output", "" ) +DefNode( ShaderNode, SH_NODE_OUTPUT_WORLD, 0, "OUTPUT_WORLD", OutputWorld, "World Output", "" ) +DefNode( ShaderNode, SH_NODE_FRESNEL, 0, "FRESNEL", Fresnel, "Fresnel", "" ) +DefNode( ShaderNode, SH_NODE_BLEND_WEIGHT, 0, "BLEND_WEIGHT", BlendWeight, "BlendWeight", "" ) +DefNode( ShaderNode, SH_NODE_MIX_SHADER, 0, "MIX_SHADER", MixShader, "Mix Shader", "" ) +DefNode( ShaderNode, SH_NODE_ADD_SHADER, 0, "ADD_SHADER", AddShader, "Add Shader", "" ) + +DefNode( ShaderNode, SH_NODE_ATTRIBUTE, def_sh_attribute, "ATTRIBUTE", Attribute, "Attribute", "") +DefNode( ShaderNode, SH_NODE_BACKGROUND, 0, "BACKGROUND", Background, "Background", "") +DefNode( ShaderNode, SH_NODE_HOLDOUT, 0, "HOLDOUT", Holdout, "Holdout", "") +DefNode( ShaderNode, SH_NODE_BSDF_ANISOTROPIC, 0, "BSDF_ANISOTROPIC", BsdfAnisotropic, "Bsdf Anisotropic", "") +DefNode( ShaderNode, SH_NODE_BSDF_DIFFUSE, 0, "BSDF_DIFFUSE", BsdfDiffuse, "Diffuse Bsdf", "") +DefNode( ShaderNode, SH_NODE_BSDF_GLOSSY, def_glossy, "BSDF_GLOSSY", BsdfGlossy, "Glossy Bsdf", "") +DefNode( ShaderNode, SH_NODE_BSDF_GLASS, def_glossy, "BSDF_GLASS", BsdfGlass, "Glass Bsdf", "") +DefNode( ShaderNode, SH_NODE_BSDF_TRANSLUCENT, 0, "BSDF_TRANSLUCENT", BsdfTranslucent, "Translucent Bsdf", "") +DefNode( ShaderNode, SH_NODE_BSDF_TRANSPARENT, 0, "BSDF_TRANSPARENT", BsdfTransparent, "Transparent Bsdf", "") +DefNode( ShaderNode, SH_NODE_BSDF_VELVET, 0, "BSDF_VELVET", BsdfVelvet, "Velvet Bsdf", "") +DefNode( ShaderNode, SH_NODE_VOLUME_TRANSPARENT, 0, "VOLUME_TRANSPARENT", VolumeTransparent, "Transparent Volume", "") +DefNode( ShaderNode, SH_NODE_VOLUME_ISOTROPIC, 0, "VOLUME_ISOTROPIC", VolumeIsotropic, "Isotropic Volume", "") +DefNode( ShaderNode, SH_NODE_EMISSION, 0, "EMISSION", Emission, "Emission", "") +DefNode( ShaderNode, SH_NODE_GEOMETRY, 0, "GEOMETRY", Geometry, "Geometry", "") +DefNode( ShaderNode, SH_NODE_LIGHT_PATH, 0, "LIGHT_PATH", Light_path, "Light_path", "") +DefNode( ShaderNode, SH_NODE_TEX_IMAGE, def_sh_tex_image, "TEX_IMAGE", TexImage, "Image Texture", "") +DefNode( ShaderNode, SH_NODE_TEX_ENVIRONMENT, def_sh_tex_environment, "TEX_ENVIRONMENT", TexEnvironment, "Environment Texture", "") +DefNode( ShaderNode, SH_NODE_TEX_NOISE, 0, "TEX_NOISE", TexNoise, "Noise Texture", "") +DefNode( ShaderNode, SH_NODE_TEX_SKY, def_sh_tex_sky, "TEX_SKY", TexSky, "Sky Texture", "") +DefNode( ShaderNode, SH_NODE_TEX_BLEND, def_sh_tex_blend, "TEX_BLEND", TexBlend, "Blend Texture", "") +DefNode( ShaderNode, SH_NODE_TEX_CLOUDS, def_sh_tex_clouds, "TEX_CLOUDS", TexClouds, "Clouds Texture", "") +DefNode( ShaderNode, SH_NODE_TEX_DISTNOISE, def_sh_tex_distnoise, "TEX_DISTORTED_NOISE", TexDistortedNoise, "Distorted Noise Texture", "") +DefNode( ShaderNode, SH_NODE_TEX_MAGIC, def_sh_tex_magic, "TEX_MAGIC", TexMagic, "Magic Texture", "") +DefNode( ShaderNode, SH_NODE_TEX_MARBLE, def_sh_tex_marble, "TEX_MARBLE", TexMarble, "Marble Texture", "") +DefNode( ShaderNode, SH_NODE_TEX_MUSGRAVE, def_sh_tex_musgrave, "TEX_MUSGRAVE", TexMusgrave, "Musgrave Texture", "") +DefNode( ShaderNode, SH_NODE_TEX_STUCCI, def_sh_tex_stucci, "TEX_STUCCI", TexStucci, "Stucci Texture", "") +DefNode( ShaderNode, SH_NODE_TEX_VORONOI, def_sh_tex_voronoi, "TEX_VORONOI", TexVoronoi, "Voronoi Texture", "") +DefNode( ShaderNode, SH_NODE_TEX_WOOD, def_sh_tex_wood, "TEX_WOOD", TexWood, "Wood Texture", "") +DefNode( ShaderNode, SH_NODE_TEX_COORD, 0, "TEX_COORD", TexCoord, "Texture Coordinate", "") + DefNode( CompositorNode, CMP_NODE_VIEWER, 0, "VIEWER", Viewer, "Viewer", "" ) DefNode( CompositorNode, CMP_NODE_RGB, 0, "RGB", RGB, "RGB", "" ) DefNode( CompositorNode, CMP_NODE_VALUE, 0, "VALUE", Value, "Value", "" ) diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c index 0acff2a5790..c4508c718e5 100644 --- a/source/blender/makesrna/intern/rna_object_api.c +++ b/source/blender/makesrna/intern/rna_object_api.c @@ -76,7 +76,7 @@ /* copied from Mesh_getFromObject and adapted to RNA interface */ /* settings: 0 - preview, 1 - render */ -static Mesh *rna_Object_to_mesh(Object *ob, ReportList *reports, Scene *sce, int apply_modifiers, int settings) +Mesh *rna_Object_to_mesh(Object *ob, ReportList *reports, Scene *sce, int apply_modifiers, int settings) { Mesh *tmpmesh; Curve *tmpcu = NULL; @@ -284,7 +284,7 @@ static void dupli_render_particle_set(Scene *scene, Object *ob, int level, int e dupli_render_particle_set(scene, go->ob, level+1, enable); } /* When no longer needed, duplilist should be freed with Object.free_duplilist */ -static void rna_Object_create_duplilist(Object *ob, ReportList *reports, Scene *sce) +void rna_Object_create_duplilist(Object *ob, ReportList *reports, Scene *sce) { if (!(ob->transflag & OB_DUPLI)) { BKE_report(reports, RPT_ERROR, "Object does not have duplis"); @@ -306,7 +306,7 @@ static void rna_Object_create_duplilist(Object *ob, ReportList *reports, Scene * /* ob->duplilist should now be freed with Object.free_duplilist */ } -static void rna_Object_free_duplilist(Object *ob) +void rna_Object_free_duplilist(Object *ob) { if (ob->duplilist) { free_object_duplilist(ob->duplilist); diff --git a/source/blender/makesrna/intern/rna_render.c b/source/blender/makesrna/intern/rna_render.c index 530d162b1fe..ef9bf6a9e02 100644 --- a/source/blender/makesrna/intern/rna_render.c +++ b/source/blender/makesrna/intern/rna_render.c @@ -95,6 +95,41 @@ static void engine_render(RenderEngine *engine, struct Scene *scene) RNA_parameter_list_free(&list); } +static void engine_preview_update(RenderEngine *engine, const struct bContext *context, struct ID *id) +{ + extern FunctionRNA rna_RenderEngine_preview_update_func; + PointerRNA ptr; + ParameterList list; + FunctionRNA *func; + + RNA_pointer_create(NULL, engine->type->ext.srna, engine, &ptr); + func= &rna_RenderEngine_preview_update_func; + + RNA_parameter_list_create(&list, &ptr, func); + RNA_parameter_set_lookup(&list, "context", &context); + RNA_parameter_set_lookup(&list, "id", &id); + engine->type->ext.call(NULL, &ptr, func, &list); + + RNA_parameter_list_free(&list); +} + +static void engine_preview_render(RenderEngine *engine) +{ + extern FunctionRNA rna_RenderEngine_preview_render_func; + + PointerRNA ptr; + ParameterList list; + FunctionRNA *func; + + RNA_pointer_create(NULL, engine->type->ext.srna, engine, &ptr); + func= &rna_RenderEngine_preview_render_func; + + RNA_parameter_list_create(&list, &ptr, func); + engine->type->ext.call(NULL, &ptr, func, &list); + + RNA_parameter_list_free(&list); +} + static void engine_view_update(RenderEngine *engine, const struct bContext *context) { extern FunctionRNA rna_RenderEngine_view_update_func; @@ -148,7 +183,7 @@ static StructRNA *rna_RenderEngine_register(Main *bmain, ReportList *reports, vo RenderEngineType *et, dummyet = {NULL}; RenderEngine dummyengine= {NULL}; PointerRNA dummyptr; - int have_function[4]; + int have_function[6]; /* setup dummy engine & engine type to store static properties in */ dummyengine.type= &dummyet; @@ -185,8 +220,10 @@ static StructRNA *rna_RenderEngine_register(Main *bmain, ReportList *reports, vo et->update= (have_function[0])? engine_update: NULL; et->render= (have_function[1])? engine_render: NULL; - et->view_update= (have_function[2])? engine_view_update: NULL; - et->view_draw= (have_function[3])? engine_view_draw: NULL; + et->preview_update= (have_function[2])? engine_preview_update: NULL; + et->preview_render= (have_function[3])? engine_preview_render: NULL; + et->view_update= (have_function[4])? engine_view_update: NULL; + et->view_draw= (have_function[5])? engine_view_draw: NULL; BLI_addtail(&R_engines, et); @@ -233,7 +270,7 @@ static void rna_RenderLayer_rect_get(PointerRNA *ptr, float *values) memcpy(values, rl->rectf, sizeof(float)*rl->rectx*rl->recty*4); } -static void rna_RenderLayer_rect_set(PointerRNA *ptr, const float *values) +void rna_RenderLayer_rect_set(PointerRNA *ptr, const float *values) { RenderLayer *rl= (RenderLayer*)ptr->data; memcpy(rl->rectf, values, sizeof(float)*rl->rectx*rl->recty*4); @@ -255,7 +292,7 @@ static void rna_RenderPass_rect_get(PointerRNA *ptr, float *values) memcpy(values, rpass->rect, sizeof(float)*rpass->rectx*rpass->recty*rpass->channels); } -static void rna_RenderPass_rect_set(PointerRNA *ptr, const float *values) +void rna_RenderPass_rect_set(PointerRNA *ptr, const float *values) { RenderPass *rpass= (RenderPass*)ptr->data; memcpy(rpass->rect, values, sizeof(float)*rpass->rectx*rpass->recty*rpass->channels); @@ -287,6 +324,17 @@ static void rna_def_render_engine(BlenderRNA *brna) RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL); RNA_def_pointer(func, "scene", "Scene", "", ""); + /* preview render callbacks */ + func= RNA_def_function(srna, "preview_update", NULL); + RNA_def_function_ui_description(func, "Export scene data for preview render of the given datablock"); + RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL); + RNA_def_pointer(func, "context", "Context", "", ""); + RNA_def_pointer(func, "id", "ID", "", ""); + + func= RNA_def_function(srna, "preview_render", NULL); + RNA_def_function_ui_description(func, "Execute preview render"); + RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL); + /* viewport render callbacks */ func= RNA_def_function(srna, "view_update", NULL); RNA_def_function_ui_description(func, "Update on data changes for viewport render"); diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 0dc4ca343fe..5793a2ba6f1 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -101,7 +101,8 @@ EnumPropertyItem viewport_shade_items[] = { {OB_BOUNDBOX, "BOUNDBOX", ICON_BBOX, "Bounding Box", "Display the object's local bounding boxes only"}, {OB_WIRE, "WIREFRAME", ICON_WIRE, "Wireframe", "Display the object as wire edges"}, {OB_SOLID, "SOLID", ICON_SOLID, "Solid", "Display the object solid, lit with default OpenGL lights"}, - {OB_TEXTURE, "TEXTURED", ICON_POTATO, "Textured", "Display the object solid, with face-assigned textures"}, + {OB_TEXTURE, "TEXTURED", ICON_POTATO, "Texture", "Display the object solid, with a texture"}, + {OB_MATERIAL, "MATERIAL", ICON_MATERIAL_DATA, "Material", "Display objects solid, with GLSL material"}, {OB_RENDER, "RENDERED", ICON_SMOOTH, "Rendered", "Display render preview"}, {0, NULL, 0, NULL, NULL}}; @@ -457,6 +458,7 @@ static EnumPropertyItem *rna_SpaceView3D_viewport_shade_itemf(bContext *UNUSED(C RNA_enum_items_add_value(&item, &totitem, viewport_shade_items, OB_WIRE); RNA_enum_items_add_value(&item, &totitem, viewport_shade_items, OB_SOLID); RNA_enum_items_add_value(&item, &totitem, viewport_shade_items, OB_TEXTURE); + RNA_enum_items_add_value(&item, &totitem, viewport_shade_items, OB_MATERIAL); if(type->view_draw) { RNA_enum_items_add_value(&item, &totitem, viewport_shade_items, OB_RENDER); @@ -1542,6 +1544,17 @@ static void rna_def_space_view3d(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "dist"); RNA_def_property_ui_text(prop, "Distance", "Distance to the view location"); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); + + prop= RNA_def_property(srna, "view_camera_zoom", PROP_INT, PROP_UNSIGNED); + RNA_def_property_int_sdna(prop, NULL, "camzoom"); + RNA_def_property_ui_text(prop, "Camera Zoom", "Zoom factor in camera view"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); + + prop= RNA_def_property(srna, "view_camera_offset", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "camdx"); + RNA_def_property_array(prop, 2); + RNA_def_property_ui_text(prop, "Camera Offset", "View shift in camera view"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); } static void rna_def_space_buttons(BlenderRNA *brna) @@ -2438,9 +2451,9 @@ static void rna_def_space_filebrowser(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "params"); RNA_def_property_ui_text(prop, "Filebrowser Parameter", "Parameters and Settings for the Filebrowser"); - prop= RNA_def_property(srna, "operator", PROP_POINTER, PROP_NONE); + prop= RNA_def_property(srna, "active_operator", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "op"); - RNA_def_property_ui_text(prop, "Operator", ""); + RNA_def_property_ui_text(prop, "Active Operator", ""); } static void rna_def_space_info(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c index 25c673a168f..eb66c820455 100644 --- a/source/blender/makesrna/intern/rna_ui_api.c +++ b/source/blender/makesrna/intern/rna_ui_api.c @@ -429,6 +429,26 @@ void RNA_api_ui_layout(StructRNA *srna) func= RNA_def_function(srna, "template_reports_banner", "uiTemplateReportsBanner"); RNA_def_function_flag(func, FUNC_USE_CONTEXT); + func= RNA_def_function(srna, "template_node_link", "uiTemplateNodeLink"); + parm= RNA_def_pointer(func, "ntree", "NodeTree", "", ""); + RNA_def_property_flag(parm, PROP_REQUIRED); + parm= RNA_def_pointer(func, "node", "Node", "", ""); + RNA_def_property_flag(parm, PROP_REQUIRED); + parm= RNA_def_pointer(func, "socket", "NodeSocket", "", ""); + RNA_def_property_flag(parm, PROP_REQUIRED); + + func= RNA_def_function(srna, "template_node_view", "uiTemplateNodeView"); + RNA_def_function_flag(func, FUNC_USE_CONTEXT); + parm= RNA_def_pointer(func, "ntree", "NodeTree", "", ""); + RNA_def_property_flag(parm, PROP_REQUIRED); + parm= RNA_def_pointer(func, "node", "Node", "", ""); + RNA_def_property_flag(parm, PROP_REQUIRED); + parm= RNA_def_pointer(func, "socket", "NodeSocket", "", ""); + RNA_def_property_flag(parm, PROP_REQUIRED); + + func= RNA_def_function(srna, "template_texture_user", "uiTemplateTextureUser"); + RNA_def_function_flag(func, FUNC_USE_CONTEXT); + func= RNA_def_function(srna, "template_keymap_item_properties", "uiTemplateKeymapItemProperties"); parm= RNA_def_pointer(func, "item", "KeyMapItem", "", ""); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL); |