26 .description(
"Faces to participate in the unwrap operation");
28 "Edges to mark where the mesh is \"cut\" for the purposes of unwrapping");
30 "Space between islands");
34 "Virtually fill holes in mesh before unwrapping, to better avoid overlaps "
35 "and preserve symmetry");
37 "UV coordinates between 0 and 1 for each face corner in the selected faces");
57 const bool fill_holes,
60 const AttrDomain domain)
65 const Span<int> corner_verts = mesh.corner_verts();
69 face_evaluator.
add(selection_field);
70 face_evaluator.evaluate();
71 const IndexMask selection = face_evaluator.get_evaluated_as_mask(0);
72 if (selection.is_empty()) {
78 edge_evaluator.
add(seam_field);
79 edge_evaluator.evaluate();
80 const IndexMask seam = edge_evaluator.get_evaluated_as_mask(0);
85 selection.foreach_index([&](
const int face_index) {
93 const int corner = face[i];
94 const int vert = corner_verts[corner];
96 mp_co[i] = positions[vert];
97 mp_uv[i] = uv[corner];
112 seam.foreach_index([&](
const int i) {
130 return mesh.attributes().adapt_domain<
float3>(
138 const bool fill_holes_;
145 const bool fill_holes,
148 : bke::MeshFieldInput(
CPPType::get<
float3>(),
"UV Unwrap Field"),
149 selection_(selection),
151 fill_holes_(fill_holes),
159 const AttrDomain domain,
173 return AttrDomain::Corner;
183 const bool fill_holes =
params.extract_input<
bool>(
"Fill Holes");
184 const float margin =
params.extract_input<
float>(
"Margin");
187 selection_field, seam_field, fill_holes, margin, method)));
197 "This method gives a good 2D representation of a mesh"},
202 "Uses LSCM (Least Squares Conformal Mapping). This usually gives a less accurate UV "
203 "mapping than Angle Based, but works better for simpler objects"},
204 {0,
nullptr, 0,
nullptr,
nullptr},
#define NODE_CLASS_CONVERTER
#define NODE_STORAGE_FUNCS(StorageT)
GeometryNodeUVUnwrapMethod
@ GEO_NODE_UV_UNWRAP_METHOD_CONFORMAL
@ GEO_NODE_UV_UNWRAP_METHOD_ANGLE_BASED
#define NOD_REGISTER_NODE(REGISTER_FUNC)
#define NOD_storage_enum_accessors(member)
void uiLayoutSetPropSep(uiLayout *layout, bool is_sep)
void uiLayoutSetPropDecorate(uiLayout *layout, bool is_sep)
void uiItemR(uiLayout *layout, PointerRNA *ptr, const char *propname, eUI_Item_Flag flag, const char *name, int icon)
constexpr int64_t size() const
static VArray ForContainer(ContainerT container)
int add(GField field, GVArray *varray_ptr)
virtual void for_each_field_input_recursive(FunctionRef< void(const FieldInput &)> fn) const
const FieldNode & node() const
local_group_size(16, 16) .push_constant(Type b
void node_type_storage(bNodeType *ntype, const char *storagename, void(*freefunc)(bNode *node), void(*copyfunc)(bNodeTree *dest_ntree, bNode *dest_node, const bNode *src_node))
void node_register_type(bNodeType *ntype)
void uv_parametrizer_construct_end(ParamHandle *phandle, bool fill_holes, bool topology_from_uvs, int *r_count_failed=nullptr)
void uv_parametrizer_edge_set_seam(ParamHandle *phandle, const ParamKey *vkeys)
void uv_parametrizer_average(ParamHandle *handle, bool ignore_pinned, bool scale_uv, bool shear)
void uv_parametrizer_flush(ParamHandle *handle)
void uv_parametrizer_lscm_end(ParamHandle *handle)
void uv_parametrizer_lscm_begin(ParamHandle *handle, bool live, bool abf)
void uv_parametrizer_lscm_solve(ParamHandle *handle, int *count_changed, int *count_failed)
void uv_parametrizer_pack(ParamHandle *handle, float margin, bool do_rotate, bool ignore_pinned)
void uv_parametrizer_face_add(ParamHandle *handle, const ParamKey key, const int nverts, const ParamKey *vkeys, const float **co, float **uv, const float *weight, const bool *pin, const bool *select)
static void node_layout(uiLayout *layout, bContext *, PointerRNA *ptr)
static VArray< float3 > construct_uv_gvarray(const Mesh &mesh, const Field< bool > selection_field, const Field< bool > seam_field, const bool fill_holes, const float margin, const GeometryNodeUVUnwrapMethod method, const AttrDomain domain)
static void node_declare(NodeDeclarationBuilder &b)
static void node_geo_exec(GeoNodeExecParams params)
static void node_register()
static void node_rna(StructRNA *srna)
static void node_init(bNodeTree *, bNode *node)
PropertyRNA * RNA_def_node_enum(StructRNA *srna, const char *identifier, const char *ui_name, const char *ui_description, const EnumPropertyItem *static_items, const EnumRNAAccessors accessors, std::optional< int > default_value, const EnumPropertyItemFunc item_func, const bool allow_animation)
void geo_node_type_base(blender::bke::bNodeType *ntype, int type, const char *name, short nclass)
void node_free_standard_storage(bNode *node)
void node_copy_standard_storage(bNodeTree *, bNode *dest_node, const bNode *src_node)
void(* initfunc)(bNodeTree *ntree, bNode *node)
NodeGeometryExecFunction geometry_node_execute
void(* draw_buttons)(uiLayout *, bContext *C, PointerRNA *ptr)
NodeDeclareFunction declare