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
This commit is contained in:
2022-04-28 08:39:30 -05:00
parent b0e47ffdcf
commit 0ad73bb965
5 changed files with 53 additions and 6 deletions

View File

@@ -797,8 +797,10 @@ class NodeTreeInterfacePanel:
active_socket.bl_socket_idname.startswith(prefix)
for prefix in field_socket_prefixes
)
if in_out == 'OUT' and is_field_type:
layout.prop(active_socket, "attribute_domain")
if is_field_type:
if in_out == 'OUT':
layout.prop(active_socket, "attribute_domain")
layout.prop(active_socket, "default_attribute_name")
active_socket.draw(context, layout)