Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_nodetree.c
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
| Show First 20 Lines • Show All 3,049 Lines • ▼ Show 20 Lines | if (engine_type && engine_type->update_script_node) { | ||||
| RenderEngine *engine = RE_engine_create(engine_type); | RenderEngine *engine = RE_engine_create(engine_type); | ||||
| engine_type->update_script_node(engine, ntree, node); | engine_type->update_script_node(engine, ntree, node); | ||||
| RE_engine_free(engine); | RE_engine_free(engine); | ||||
| } | } | ||||
| ED_node_tag_update_nodetree(bmain, ntree, node); | ED_node_tag_update_nodetree(bmain, ntree, node); | ||||
| } | } | ||||
| static void rna_ShaderNodePrincipled_update(Main *bmain, Scene *scene, PointerRNA *ptr) | static void rna_ShaderNode_socket_update(Main *bmain, Scene *scene, PointerRNA *ptr) | ||||
| { | |||||
| bNodeTree *ntree = (bNodeTree *)ptr->id.data; | |||||
| bNode *node = (bNode *)ptr->data; | |||||
| nodeUpdate(ntree, node); | |||||
| rna_Node_update(bmain, scene, ptr); | |||||
| } | |||||
| static void rna_ShaderNodeSubsurface_update(Main *bmain, Scene *scene, PointerRNA *ptr) | |||||
| { | { | ||||
| bNodeTree *ntree = (bNodeTree *)ptr->id.data; | bNodeTree *ntree = (bNodeTree *)ptr->id.data; | ||||
| bNode *node = (bNode *)ptr->data; | bNode *node = (bNode *)ptr->data; | ||||
| nodeUpdate(ntree, node); | nodeUpdate(ntree, node); | ||||
| rna_Node_update(bmain, scene, ptr); | rna_Node_update(bmain, scene, ptr); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 922 Lines • ▼ Show 20 Lines | |||||
| static void def_sh_tex_voronoi(StructRNA *srna) | static void def_sh_tex_voronoi(StructRNA *srna) | ||||
| { | { | ||||
| static const EnumPropertyItem prop_coloring_items[] = { | static const EnumPropertyItem prop_coloring_items[] = { | ||||
| {SHD_VORONOI_INTENSITY, "INTENSITY", 0, "Intensity", "Only calculate intensity"}, | {SHD_VORONOI_INTENSITY, "INTENSITY", 0, "Intensity", "Only calculate intensity"}, | ||||
| {SHD_VORONOI_CELLS, "CELLS", 0, "Cells", "Color cells by position"}, | {SHD_VORONOI_CELLS, "CELLS", 0, "Cells", "Color cells by position"}, | ||||
| {0, NULL, 0, NULL, NULL} | {0, NULL, 0, NULL, NULL} | ||||
| }; | }; | ||||
| static EnumPropertyItem prop_distance_items[] = { | |||||
| { SHD_VORONOI_DISTANCE, "DISTANCE", 0, "Distance", "Distance" }, | |||||
| { SHD_VORONOI_MANHATTAN, "MANHATTAN", 0, "Manhattan", "Manhattan (city block) distance" }, | |||||
| { SHD_VORONOI_CHEBYCHEV, "CHEBYCHEV", 0, "Chebychev", "Chebychev distance" }, | |||||
| { SHD_VORONOI_MINKOWSKI, "MINKOWSKI", 0, "Minkowski", "Minkowski distance" }, | |||||
| { 0, NULL, 0, NULL, NULL } | |||||
| }; | |||||
| static EnumPropertyItem prop_feature_items[] = { | |||||
| { SHD_VORONOI_F1, "F1", 0, "Closest", "Closest point" }, | |||||
| { SHD_VORONOI_F2, "F2", 0, "2nd Closest", "2nd closest point" }, | |||||
| { SHD_VORONOI_F3, "F3", 0, "3rd Closest", "3rd closest point" }, | |||||
| { SHD_VORONOI_F4, "F4", 0, "4th Closest", "4th closest point" }, | |||||
| { SHD_VORONOI_F2F1, "F2F1", 0, "Crackle", "Difference between 2nd and 1st closest point" }, | |||||
| { 0, NULL, 0, NULL, NULL } | |||||
| }; | |||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| RNA_def_struct_sdna_from(srna, "NodeTexVoronoi", "storage"); | RNA_def_struct_sdna_from(srna, "NodeTexVoronoi", "storage"); | ||||
| def_sh_tex(srna); | def_sh_tex(srna); | ||||
| prop = RNA_def_property(srna, "coloring", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "coloring", PROP_ENUM, PROP_NONE); | ||||
| RNA_def_property_enum_sdna(prop, NULL, "coloring"); | RNA_def_property_enum_sdna(prop, NULL, "coloring"); | ||||
| RNA_def_property_enum_items(prop, prop_coloring_items); | RNA_def_property_enum_items(prop, prop_coloring_items); | ||||
| RNA_def_property_ui_text(prop, "Coloring", ""); | RNA_def_property_ui_text(prop, "Coloring", ""); | ||||
| RNA_def_property_update(prop, 0, "rna_Node_update"); | RNA_def_property_update(prop, 0, "rna_Node_update"); | ||||
| prop = RNA_def_property(srna, "distance", PROP_ENUM, PROP_NONE); | |||||
| RNA_def_property_enum_sdna(prop, NULL, "distance"); | |||||
| RNA_def_property_enum_items(prop, prop_distance_items); | |||||
| RNA_def_property_ui_text(prop, "Distance metric", ""); | |||||
| RNA_def_property_update(prop, 0, "rna_ShaderNode_socket_update"); | |||||
| prop = RNA_def_property(srna, "feature", PROP_ENUM, PROP_NONE); | |||||
| RNA_def_property_enum_sdna(prop, NULL, "feature"); | |||||
| RNA_def_property_enum_items(prop, prop_feature_items); | |||||
| RNA_def_property_ui_text(prop, "Feature Output", ""); | |||||
| RNA_def_property_update(prop, 0, "rna_Node_update"); | |||||
| } | } | ||||
| static void def_sh_tex_wave(StructRNA *srna) | static void def_sh_tex_wave(StructRNA *srna) | ||||
| { | { | ||||
| static const EnumPropertyItem prop_wave_type_items[] = { | static const EnumPropertyItem prop_wave_type_items[] = { | ||||
| {SHD_WAVE_BANDS, "BANDS", 0, "Bands", "Use standard wave texture in bands"}, | {SHD_WAVE_BANDS, "BANDS", 0, "Bands", "Use standard wave texture in bands"}, | ||||
| {SHD_WAVE_RINGS, "RINGS", 0, "Rings", "Use wave texture in rings"}, | {SHD_WAVE_RINGS, "RINGS", 0, "Rings", "Use wave texture in rings"}, | ||||
| {0, NULL, 0, NULL, NULL} | {0, NULL, 0, NULL, NULL} | ||||
| ▲ Show 20 Lines • Show All 255 Lines • ▼ Show 20 Lines | |||||
| static void def_principled(StructRNA *srna) | static void def_principled(StructRNA *srna) | ||||
| { | { | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| prop = RNA_def_property(srna, "distribution", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "distribution", PROP_ENUM, PROP_NONE); | ||||
| RNA_def_property_enum_sdna(prop, NULL, "custom1"); | RNA_def_property_enum_sdna(prop, NULL, "custom1"); | ||||
| RNA_def_property_enum_items(prop, node_principled_distribution_items); | RNA_def_property_enum_items(prop, node_principled_distribution_items); | ||||
| RNA_def_property_ui_text(prop, "Distribution", ""); | RNA_def_property_ui_text(prop, "Distribution", ""); | ||||
| RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_ShaderNodePrincipled_update"); | RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_ShaderNode_socket_update"); | ||||
| prop = RNA_def_property(srna, "subsurface_method", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "subsurface_method", PROP_ENUM, PROP_NONE); | ||||
| RNA_def_property_enum_sdna(prop, NULL, "custom2"); | RNA_def_property_enum_sdna(prop, NULL, "custom2"); | ||||
| RNA_def_property_enum_items(prop, node_subsurface_method_items); | RNA_def_property_enum_items(prop, node_subsurface_method_items); | ||||
| RNA_def_property_ui_text(prop, "Subsurface Method", "Method for rendering subsurface scattering"); | RNA_def_property_ui_text(prop, "Subsurface Method", "Method for rendering subsurface scattering"); | ||||
| RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_ShaderNodePrincipled_update"); | RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_ShaderNode_socket_update"); | ||||
| } | } | ||||
| static void def_refraction(StructRNA *srna) | static void def_refraction(StructRNA *srna) | ||||
| { | { | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| prop = RNA_def_property(srna, "distribution", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "distribution", PROP_ENUM, PROP_NONE); | ||||
| RNA_def_property_enum_sdna(prop, NULL, "custom1"); | RNA_def_property_enum_sdna(prop, NULL, "custom1"); | ||||
| ▲ Show 20 Lines • Show All 218 Lines • ▼ Show 20 Lines | static void def_sh_subsurface(StructRNA *srna) | ||||
| }; | }; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| prop = RNA_def_property(srna, "falloff", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "falloff", PROP_ENUM, PROP_NONE); | ||||
| RNA_def_property_enum_sdna(prop, NULL, "custom1"); | RNA_def_property_enum_sdna(prop, NULL, "custom1"); | ||||
| RNA_def_property_enum_items(prop, prop_subsurface_falloff_items); | RNA_def_property_enum_items(prop, prop_subsurface_falloff_items); | ||||
| RNA_def_property_ui_text(prop, "Falloff", "Function to determine how much light nearby points contribute based on their distance to the shading point"); | RNA_def_property_ui_text(prop, "Falloff", "Function to determine how much light nearby points contribute based on their distance to the shading point"); | ||||
| RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_ShaderNodeSubsurface_update"); | RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_ShaderNode_socket_update"); | ||||
| } | } | ||||
| static void def_sh_tex_ies(StructRNA *srna) | static void def_sh_tex_ies(StructRNA *srna) | ||||
| { | { | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| prop = RNA_def_property(srna, "ies", PROP_POINTER, PROP_NONE); | prop = RNA_def_property(srna, "ies", PROP_POINTER, PROP_NONE); | ||||
| RNA_def_property_pointer_sdna(prop, NULL, "id"); | RNA_def_property_pointer_sdna(prop, NULL, "id"); | ||||
| ▲ Show 20 Lines • Show All 4,072 Lines • Show Last 20 Lines | |||||