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:
authorAleksi Juvani <aleksijuvani>2022-06-29 20:25:20 +0300
committerHans Goudey <h.goudey@me.com>2022-06-29 20:25:46 +0300
commit4593fb52cf809de29bffa8f18af9a9a792def30d (patch)
tree934ca14b1be5710501fa95bb09c4efcf1ce45e81 /source/blender/makesrna/intern/rna_nodetree.c
parentd23818fcd97872667ee969ec85704d3155f2c17a (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 'source/blender/makesrna/intern/rna_nodetree.c')
-rw-r--r--source/blender/makesrna/intern/rna_nodetree.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index 0ad109e711f..386ef3f74a3 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -9879,6 +9879,33 @@ static void def_geo_points_to_volume(StructRNA *srna)
RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update");
}
+static void def_geo_uv_unwrap(StructRNA *srna)
+{
+ PropertyRNA *prop;
+
+ static EnumPropertyItem rna_node_geometry_uv_unwrap_method_items[] = {
+ {GEO_NODE_UV_UNWRAP_METHOD_ANGLE_BASED,
+ "ANGLE_BASED",
+ 0,
+ "Angle Based",
+ "This method gives a good 2D representation of a mesh"},
+ {GEO_NODE_UV_UNWRAP_METHOD_CONFORMAL,
+ "CONFORMAL",
+ 0,
+ "Conformal",
+ "Uses LSCM (Least Squares Conformal Mapping). This usually gives a less accurate UV "
+ "mapping than Angle Based, but works better for simpler objects"},
+ {0, NULL, 0, NULL, NULL},
+ };
+
+ RNA_def_struct_sdna_from(srna, "NodeGeometryUVUnwrap", "storage");
+
+ prop = RNA_def_property(srna, "method", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_items(prop, rna_node_geometry_uv_unwrap_method_items);
+ RNA_def_property_ui_text(prop, "Method", "");
+ RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
+}
+
static void def_geo_collection_info(StructRNA *srna)
{
PropertyRNA *prop;