Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/geometry/nodes/node_geo_uv_unwrap.cc
| Show All 30 Lines | b.add_input<decl::Float>(N_("Margin")) | ||||
| .default_value(0.001f) | .default_value(0.001f) | ||||
| .min(0.0f) | .min(0.0f) | ||||
| .max(1.0f) | .max(1.0f) | ||||
| .description(N_("Space between islands")); | .description(N_("Space between islands")); | ||||
| b.add_input<decl::Bool>(N_("Fill Holes")) | b.add_input<decl::Bool>(N_("Fill Holes")) | ||||
| .default_value(true) | .default_value(true) | ||||
| .description(N_("Virtually fill holes in mesh before unwrapping, to better avoid overlaps " | .description(N_("Virtually fill holes in mesh before unwrapping, to better avoid overlaps " | ||||
| "and preserve symmetry")); | "and preserve symmetry")); | ||||
| b.add_output<decl::Vector>(N_("UV")).field_source().description( | b.add_output<decl::Vector>(N_("UV")).field_source_reference_all().description( | ||||
| N_("UV coordinates between 0 and 1 for each face corner in the selected faces")); | N_("UV coordinates between 0 and 1 for each face corner in the selected faces")); | ||||
| } | } | ||||
| static void node_layout(uiLayout *layout, bContext * /*C*/, PointerRNA *ptr) | static void node_layout(uiLayout *layout, bContext * /*C*/, PointerRNA *ptr) | ||||
| { | { | ||||
| uiLayoutSetPropSep(layout, true); | uiLayoutSetPropSep(layout, true); | ||||
| uiLayoutSetPropDecorate(layout, false); | uiLayoutSetPropDecorate(layout, false); | ||||
| uiItemR(layout, ptr, "method", 0, "", ICON_NONE); | uiItemR(layout, ptr, "method", 0, "", ICON_NONE); | ||||
| ▲ Show 20 Lines • Show All 108 Lines • ▼ Show 20 Lines | public: | ||||
| GVArray get_varray_for_context(const Mesh &mesh, | GVArray get_varray_for_context(const Mesh &mesh, | ||||
| const eAttrDomain domain, | const eAttrDomain domain, | ||||
| const IndexMask /*mask*/) const final | const IndexMask /*mask*/) const final | ||||
| { | { | ||||
| return construct_uv_gvarray(mesh, selection, seam, fill_holes, margin, method, domain); | return construct_uv_gvarray(mesh, selection, seam, fill_holes, margin, method, domain); | ||||
| } | } | ||||
| void for_each_field_input_recursive(FunctionRef<void(const FieldInput &)> fn) const | |||||
| { | |||||
| selection.node().for_each_field_input_recursive(fn); | |||||
| seam.node().for_each_field_input_recursive(fn); | |||||
| } | |||||
| std::optional<eAttrDomain> preferred_domain(const Mesh & /*mesh*/) const override | std::optional<eAttrDomain> preferred_domain(const Mesh & /*mesh*/) const override | ||||
| { | { | ||||
| return ATTR_DOMAIN_CORNER; | return ATTR_DOMAIN_CORNER; | ||||
| } | } | ||||
| }; | }; | ||||
| static void node_geo_exec(GeoNodeExecParams params) | static void node_geo_exec(GeoNodeExecParams params) | ||||
| { | { | ||||
| Show All 28 Lines | |||||