Geometry Nodes: Add STL Import Node

This commit adds an initial STL import node, the first of the nodes from the
current Google Summer of Code Project [0]. The importer is refactored to
output a mesh pointer, and a node is added to wrap around the importer.
The node supports error messages from the importer. A new experimental
option is added to hide the nodes by default until they're ready to be exposed
generally.

0: https://devtalk.blender.org/t/gsoc-2024-geometry-nodes-file-import-nodes/34482)

Pull Request: https://projects.blender.org/blender/blender/pulls/122418
This commit is contained in:
Devashish Lal
2024-06-10 20:47:37 +02:00
committed by Hans Goudey
parent d573ee1e6c
commit d1455c4138
14 changed files with 163 additions and 23 deletions

View File

@@ -243,11 +243,13 @@ class NODE_MT_geometry_node_GEO_INPUT(Menu):
bl_idname = "NODE_MT_geometry_node_GEO_INPUT"
bl_label = "Input"
def draw(self, _context):
def draw(self, context):
layout = self.layout
layout.menu("NODE_MT_geometry_node_GEO_INPUT_CONSTANT")
layout.menu("NODE_MT_geometry_node_GEO_INPUT_GROUP")
layout.menu("NODE_MT_geometry_node_GEO_INPUT_SCENE")
if context.preferences.experimental.use_new_file_import_nodes:
layout.menu("NODE_MT_category_IMPORT")
node_add_menu.draw_assets_for_catalog(layout, self.bl_label)
@@ -448,6 +450,14 @@ class NODE_MT_category_PRIMITIVES_MESH(Menu):
node_add_menu.add_node_type(layout, "GeometryNodeMeshUVSphere")
node_add_menu.draw_assets_for_catalog(layout, "Mesh/Primitives")
class NODE_MT_category_IMPORT(Menu):
bl_idname = "NODE_MT_category_IMPORT"
bl_label = "Import"
def draw(self, _context):
layout = self.layout
node_add_menu.add_node_type(layout, "GeometryNodeImportSTL")
node_add_menu.draw_assets_for_catalog(layout, "Input/Import")
class NODE_MT_geometry_node_mesh_topology(Menu):
bl_idname = "NODE_MT_geometry_node_mesh_topology"
@@ -816,6 +826,7 @@ classes = (
NODE_MT_geometry_node_GEO_MESH_OPERATIONS,
NODE_MT_category_GEO_UV,
NODE_MT_category_PRIMITIVES_MESH,
NODE_MT_category_IMPORT,
NODE_MT_geometry_node_mesh_topology,
NODE_MT_category_GEO_POINT,
NODE_MT_category_simulation,

View File

@@ -2798,6 +2798,7 @@ class USERPREF_PT_experimental_new_features(ExperimentalPanel, Panel):
({"property": "use_extended_asset_browser"},
("blender/blender/projects/10", "Pipeline, Assets & IO Project Page")),
({"property": "use_new_volume_nodes"}, ("blender/blender/issues/103248", "#103248")),
({"property": "use_new_file_import_nodes"}, ("blender/blender/issues/122846", "#122846")),
({"property": "use_shader_node_previews"}, ("blender/blender/issues/110353", "#110353")),
),
)