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 4,514 Lines • ▼ Show 20 Lines | static void rna_GeometryNode_socket_update(Main *bmain, Scene *scene, PointerRNA *ptr) | ||||
| rna_Node_update(bmain, scene, ptr); | rna_Node_update(bmain, scene, ptr); | ||||
| } | } | ||||
| static void rna_CompositorNodeScale_update(Main *bmain, Scene *scene, PointerRNA *ptr) | static void rna_CompositorNodeScale_update(Main *bmain, Scene *scene, PointerRNA *ptr) | ||||
| { | { | ||||
| rna_Node_update(bmain, scene, ptr); | rna_Node_update(bmain, scene, ptr); | ||||
| } | } | ||||
| static void rna_ShaderNode_is_active_output_set(PointerRNA *ptr, bool value) | |||||
| { | |||||
| bNodeTree *ntree = (bNodeTree *)ptr->owner_id; | |||||
| bNode *node = ptr->data; | |||||
| if (value) { | |||||
| /* If this node becomes the active output, the others of the same type can't be the active | |||||
| * output anymore. */ | |||||
| LISTBASE_FOREACH (bNode *, other_node, &ntree->nodes) { | |||||
| if (other_node->type == node->type) { | |||||
| other_node->flag &= ~NODE_DO_OUTPUT; | |||||
| } | |||||
| } | |||||
| node->flag |= NODE_DO_OUTPUT; | |||||
| } | |||||
| else { | |||||
| node->flag &= ~NODE_DO_OUTPUT; | |||||
| } | |||||
| } | |||||
| static PointerRNA rna_ShaderNodePointDensity_psys_get(PointerRNA *ptr) | static PointerRNA rna_ShaderNodePointDensity_psys_get(PointerRNA *ptr) | ||||
| { | { | ||||
| bNode *node = ptr->data; | bNode *node = ptr->data; | ||||
| NodeShaderTexPointDensity *shader_point_density = node->storage; | NodeShaderTexPointDensity *shader_point_density = node->storage; | ||||
| Object *ob = (Object *)node->id; | Object *ob = (Object *)node->id; | ||||
| ParticleSystem *psys = NULL; | ParticleSystem *psys = NULL; | ||||
| PointerRNA value; | PointerRNA value; | ||||
| ▲ Show 20 Lines • Show All 752 Lines • ▼ Show 20 Lines | |||||
| static void def_sh_output(StructRNA *srna) | static void def_sh_output(StructRNA *srna) | ||||
| { | { | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| prop = RNA_def_property(srna, "is_active_output", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "is_active_output", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", NODE_DO_OUTPUT); | RNA_def_property_boolean_sdna(prop, NULL, "flag", NODE_DO_OUTPUT); | ||||
| RNA_def_property_ui_text( | RNA_def_property_ui_text( | ||||
| prop, "Active Output", "True if this node is used as the active output"); | prop, "Active Output", "True if this node is used as the active output"); | ||||
| RNA_def_property_boolean_funcs(prop, NULL, "rna_ShaderNode_is_active_output_set"); | |||||
| RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); | RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); | ||||
| prop = RNA_def_property(srna, "target", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "target", 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_shader_output_target_items); | RNA_def_property_enum_items(prop, prop_shader_output_target_items); | ||||
| RNA_def_property_ui_text( | RNA_def_property_ui_text( | ||||
| prop, "Target", "Which renderer and viewport shading types to use the shaders for"); | prop, "Target", "Which renderer and viewport shading types to use the shaders for"); | ||||
| RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); | RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); | ||||
| ▲ Show 20 Lines • Show All 8,343 Lines • Show Last 20 Lines | |||||