diff options
author | Jacques Lucke <jacques@blender.org> | 2021-09-27 16:33:48 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2021-09-27 16:39:47 +0300 |
commit | 3d2ce25afd7e8ed823277f34f370fb1fb49a739e (patch) | |
tree | cef95f4fa1db1dc37670f2ee47da6a3eb94eb770 /release | |
parent | 43167a2c251b8388be3dc4d2460913f41de13c49 (diff) |
Geometry Nodes: support creating new attributes in modifier
This patch allows passing a field to the modifier as output. In the
modifier, the user can choose an attribute name. The attribute
will be filled with values computed by the field. This only works
for realized mesh/curve/point data. As mentioned in T91376, the
output domain is selected in the node group itself. We might want
to add this functionality to the modifier later as well, but not now.
Differential Revision: https://developer.blender.org/D12644
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/startup/bl_ui/space_node.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/release/scripts/startup/bl_ui/space_node.py b/release/scripts/startup/bl_ui/space_node.py index 5f36009901a..f806fc345d1 100644 --- a/release/scripts/startup/bl_ui/space_node.py +++ b/release/scripts/startup/bl_ui/space_node.py @@ -754,6 +754,11 @@ class NodeTreeInterfacePanel: # Display descriptions only for Geometry Nodes, since it's only used in the modifier panel. if tree.type == 'GEOMETRY': layout.prop(active_socket, "description") + field_socket_prefixes = { + "NodeSocketInt", "NodeSocketColor", "NodeSocketVector", "NodeSocketBool", "NodeSocketFloat"} + is_field_type = any(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") active_socket.draw(context, layout) |