diff options
author | Aleksi Juvani <aleksijuvani> | 2022-06-29 20:25:20 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-06-29 20:25:46 +0300 |
commit | 4593fb52cf809de29bffa8f18af9a9a792def30d (patch) | |
tree | 934ca14b1be5710501fa95bb09c4efcf1ce45e81 /release/scripts/startup/nodeitems_builtins.py | |
parent | d23818fcd97872667ee969ec85704d3155f2c17a (diff) |
Geometry Nodes: UV Unwrap and Pack Islands Nodes
This commit adds new Unwrap and Pack Islands nodes, with equivalent
functionality to the existing Unwrap and Pack Islands operators. The
Unwrap node uses generic boolean attributes to determine seams instead
of looking at the seam flags in the mesh geometry.
Unlike the Unwrap operator, the Unwrap node doesn't perform aspect
ratio correction, because this is trivial for the user to implement
with a Vector Math node if it is desired.
The Unwrap node implicitly performs a Pack Islands operation upon
completion, because the results may not be generally useful otherwise.
This matches the behaviour of the Unwrap operator.
The nodes use the existing Vector socket type, and do not introduce a
new 2D Vector type (see T92765).
Differential Revision: https://developer.blender.org/D14389
Diffstat (limited to 'release/scripts/startup/nodeitems_builtins.py')
-rw-r--r-- | release/scripts/startup/nodeitems_builtins.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/release/scripts/startup/nodeitems_builtins.py b/release/scripts/startup/nodeitems_builtins.py index 5983596dab1..21bb3d01616 100644 --- a/release/scripts/startup/nodeitems_builtins.py +++ b/release/scripts/startup/nodeitems_builtins.py @@ -157,6 +157,17 @@ def geometry_node_items(context): yield NodeItem("GeometryNodeSetPosition") +# Custom Menu for UV Nodes. +def uv_node_items(context): + if context is None: + return + space = context.space_data + if not space: + return + yield NodeItem("GeometryNodeUVUnwrap") + yield NodeItem("GeometryNodeUVPackIslands") + + # Custom Menu for Geometry Node Input Nodes. def geometry_input_node_items(context): if context is None: @@ -654,6 +665,7 @@ geometry_node_categories = [ NodeItem("GeometryNodeCurvePrimitiveBezierSegment"), ]), GeometryNodeCategory("GEO_GEOMETRY", "Geometry", items=geometry_node_items), + GeometryNodeCategory("GEO_UV", "UV", items=uv_node_items), GeometryNodeCategory("GEO_INPUT", "Input", items=geometry_input_node_items), GeometryNodeCategory("GEO_INSTANCE", "Instances", items=geometry_instance_node_items), GeometryNodeCategory("GEO_MATERIAL", "Material", items=geometry_material_node_items), |