Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2021-09-27 16:33:48 +0300
committerJacques Lucke <jacques@blender.org>2021-09-27 16:39:47 +0300
commit3d2ce25afd7e8ed823277f34f370fb1fb49a739e (patch)
treecef95f4fa1db1dc37670f2ee47da6a3eb94eb770 /release
parent43167a2c251b8388be3dc4d2460913f41de13c49 (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.py5
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)