Geometry Nodes: Initial very basic list support
This includes a new list structure type and socket shape, a node to create lists, a node to retrieve values from lists, and a node to retrieve the length of lists. It also implements multi-function support so that function nodes work on lists. There are three nodes included in this PR. - **List** Creates a list of elements with a given size. The values are computed with a field that can use the index as an input. - **Get List Item** A field node that retrieves an element from a a list at a given index. The index input is dynamic, so if the input is a list, the output will be a list too. - **List Length** Just gives the length of a list. When a function node is used with multiple list inputs, the shorter lists are repeated to extend it to the length of the longest. The list nodes and structure type are hidden behind an experimental feature until we can be sure they're useful for an actual use case. Pull Request: https://projects.blender.org/blender/blender/pulls/140679
This commit is contained in:
@@ -660,6 +660,8 @@ class NODE_MT_category_GEO_UTILITIES(Menu):
|
||||
layout.separator()
|
||||
layout.menu("NODE_MT_category_GEO_UTILITIES_FIELD")
|
||||
layout.menu("NODE_MT_category_GEO_UTILITIES_MATH")
|
||||
if context.preferences.experimental.use_geometry_nodes_lists:
|
||||
layout.menu("NODE_MT_category_utilities_list")
|
||||
layout.menu("NODE_MT_category_utilities_matrix")
|
||||
layout.menu("NODE_MT_category_GEO_UTILITIES_ROTATION")
|
||||
layout.menu("NODE_MT_category_GEO_UTILITIES_DEPRECATED")
|
||||
@@ -745,6 +747,18 @@ class NODE_MT_category_utilities_matrix(Menu):
|
||||
node_add_menu.draw_assets_for_catalog(layout, "Utilities/Matrix")
|
||||
|
||||
|
||||
class NODE_MT_category_utilities_list(Menu):
|
||||
bl_idname = "NODE_MT_category_utilities_list"
|
||||
bl_label = "List"
|
||||
|
||||
def draw(self, _context):
|
||||
layout = self.layout
|
||||
node_add_menu.add_node_type(layout, "GeometryNodeList")
|
||||
node_add_menu.add_node_type(layout, "GeometryNodeListGetItem")
|
||||
node_add_menu.add_node_type(layout, "GeometryNodeListLength")
|
||||
node_add_menu.draw_assets_for_catalog(layout, "Utilities/List")
|
||||
|
||||
|
||||
class NODE_MT_category_GEO_UTILITIES_MATH(Menu):
|
||||
bl_idname = "NODE_MT_category_GEO_UTILITIES_MATH"
|
||||
bl_label = "Math"
|
||||
@@ -961,6 +975,7 @@ classes = (
|
||||
NODE_MT_category_GEO_UTILITIES_MATH,
|
||||
NODE_MT_category_GEO_UTILITIES_ROTATION,
|
||||
NODE_MT_geometry_node_GEO_INPUT_GIZMO,
|
||||
NODE_MT_category_utilities_list,
|
||||
NODE_MT_category_utilities_matrix,
|
||||
NODE_MT_category_GEO_UTILITIES_DEPRECATED,
|
||||
NODE_MT_category_GEO_GROUP,
|
||||
|
||||
@@ -2865,6 +2865,7 @@ class USERPREF_PT_experimental_new_features(ExperimentalPanel, Panel):
|
||||
({"property": "use_shader_node_previews"}, ("blender/blender/issues/110353", "#110353")),
|
||||
({"property": "use_bundle_and_closure_nodes"}, ("blender/blender/issues/134029", "#134029")),
|
||||
({"property": "use_socket_structure_type"}, ("blender/blender/issues/127106", "#127106")),
|
||||
({"property": "use_geometry_nodes_lists"}, ("blender/blender/issues/140918", "#140918")),
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user