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 1,587 Lines • ▼ Show 20 Lines | |||||
| static void rna_NodeTree_interface_update(bNodeTree *ntree, bContext *C) | static void rna_NodeTree_interface_update(bNodeTree *ntree, bContext *C) | ||||
| { | { | ||||
| Main *bmain = CTX_data_main(C); | Main *bmain = CTX_data_main(C); | ||||
| BKE_ntree_update_tag_interface(ntree); | BKE_ntree_update_tag_interface(ntree); | ||||
| ED_node_tree_propagate_change(NULL, bmain, ntree); | ED_node_tree_propagate_change(NULL, bmain, ntree); | ||||
| } | } | ||||
| static bool rna_NodeTree_contains_in(bNodeTree *ntree_to_search_for, bNodeTree *ntree_to_search_in) | |||||
| { | |||||
| return ntreeContainTree(ntree_to_search_in, ntree_to_search_for); | |||||
| } | |||||
| /* ******** NodeLink ******** */ | /* ******** NodeLink ******** */ | ||||
| static bool rna_NodeLink_is_hidden_get(PointerRNA *ptr) | static bool rna_NodeLink_is_hidden_get(PointerRNA *ptr) | ||||
| { | { | ||||
| bNodeLink *link = ptr->data; | bNodeLink *link = ptr->data; | ||||
| return nodeLinkIsHidden(link); | return nodeLinkIsHidden(link); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 11,109 Lines • ▼ Show 20 Lines | static void rna_def_nodetree(BlenderRNA *brna) | ||||
| RNA_def_property_update(prop, NC_NODE, NULL); | RNA_def_property_update(prop, NC_NODE, NULL); | ||||
| /* exposed as a function for runtime interface type properties */ | /* exposed as a function for runtime interface type properties */ | ||||
| func = RNA_def_function(srna, "interface_update", "rna_NodeTree_interface_update"); | func = RNA_def_function(srna, "interface_update", "rna_NodeTree_interface_update"); | ||||
| RNA_def_function_ui_description(func, "Updated node group interface"); | RNA_def_function_ui_description(func, "Updated node group interface"); | ||||
| parm = RNA_def_pointer(func, "context", "Context", "", ""); | parm = RNA_def_pointer(func, "context", "Context", "", ""); | ||||
| RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); | RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); | ||||
| /* Check to avoid creating recursive node groups. */ | |||||
| func = RNA_def_function(srna, "contains_in", "rna_NodeTree_contains_in"); | |||||
| RNA_def_function_ui_description(func, "Recursively check if this node group contained in"); | |||||
HooglyBoogly: This comment can be moved to the function's description. Suggestion: `Check if the node tree… | |||||
| parm = RNA_def_pointer(func, "other_tree", "NodeTree", "", ""); | |||||
Done Inline Actionscontains_in -> contains_group HooglyBoogly: `contains_in` -> `contains_group` | |||||
Done Inline ActionsA . contains_in . B mean, that searching in B group try to find A group. Moder: `A` . `contains_in` . `B` mean, that searching in `B` group try to find `A` group.
but
`A` . | |||||
Done Inline ActionsI think contains_group is clearer. The function acts like a question-- "Does A contain B". A is the subject and B is the direct object. "contains_in" sounds like incorrect grammar IMO HooglyBoogly: I think `contains_group` is clearer. The function acts like a question-- "Does A contain B". A… | |||||
| RNA_def_property_ui_text(parm, "", "Node tree for recursive check"); | |||||
| RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); | |||||
| parm = RNA_def_property(func, "contained", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_function_return(func, parm); | |||||
| /* registration */ | /* registration */ | ||||
| prop = RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE); | prop = RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE); | ||||
| RNA_def_property_string_sdna(prop, NULL, "typeinfo->idname"); | RNA_def_property_string_sdna(prop, NULL, "typeinfo->idname"); | ||||
| RNA_def_property_flag(prop, PROP_REGISTER); | RNA_def_property_flag(prop, PROP_REGISTER); | ||||
| RNA_def_property_ui_text(prop, "ID Name", ""); | RNA_def_property_ui_text(prop, "ID Name", ""); | ||||
| prop = RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE); | prop = RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE); | ||||
| RNA_def_property_string_sdna(prop, NULL, "typeinfo->ui_name"); | RNA_def_property_string_sdna(prop, NULL, "typeinfo->ui_name"); | ||||
| ▲ Show 20 Lines • Show All 312 Lines • Show Last 20 Lines | |||||
This comment can be moved to the function's description. Suggestion: Check if the node tree contains another. Used to avoid creating recursive node groups