diff options
author | Hans Goudey <h.goudey@me.com> | 2022-04-28 16:39:30 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-04-28 16:39:30 +0300 |
commit | 0ad73bb9655f04afb5ad56174d8fb416cded3e4c (patch) | |
tree | e427b3514ee5165843f9a5dc2724d85c92fd215a /source/blender/makesrna/intern/rna_nodetree.c | |
parent | b0e47ffdcf13cd00c42e6cab4c3556679ad9fea4 (diff) |
Geometry Nodes: Add default attribute name to field inputs/outputs
Geometry node group inputs and outputs get a new property that controls
the attribute name used for that field input/output when assigning the
node group to a modifier for the first time. If the default name is assigned
to an input, the default "Use attribute name" is true .
In order to properly detect when a node group is first assigned,
the modifier now clears its properties when clearing the node group.
Ref T96707
Differential Revision: https://developer.blender.org/D14761
Diffstat (limited to 'source/blender/makesrna/intern/rna_nodetree.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_nodetree.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 4195782db08..4d68330c84d 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -10890,6 +10890,14 @@ static void rna_def_node_socket_interface(BlenderRNA *brna) "Attribute domain used by the geometry nodes modifier to create an attribute output"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_NodeSocketInterface_update"); + prop = RNA_def_property(srna, "default_attribute_name", PROP_STRING, PROP_NONE); + RNA_def_property_string_sdna(prop, NULL, "default_attribute_name"); + RNA_def_property_ui_text(prop, + "Default Attribute", + "The attribute name used by default when the node group is used by a " + "geometry nodes modifier"); + RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_NodeSocketInterface_update"); + /* registration */ prop = RNA_def_property(srna, "bl_socket_idname", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "typeinfo->idname"); |