Blender V5.3
uvedit_unwrap_ops.cc File Reference
#include <cmath>
#include <cstdlib>
#include <cstring>
#include "MEM_guardedalloc.h"
#include "DNA_meshdata_types.h"
#include "DNA_modifier_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "BKE_global.hh"
#include "BLI_array.hh"
#include "BLI_linklist.hh"
#include "BLI_listbase.hh"
#include "BLI_math_geom_c.hh"
#include "BLI_math_matrix_c.hh"
#include "BLI_math_rotation_c.hh"
#include "BLI_math_vector_c.hh"
#include "BLI_memarena.hh"
#include "BLI_rect.hh"
#include "BLI_string_utf8.hh"
#include "BLI_time.hh"
#include "BLI_utildefines.hh"
#include "BLI_vector.hh"
#include "BLT_translation.hh"
#include "BKE_context.hh"
#include "BKE_customdata.hh"
#include "BKE_deform.hh"
#include "BKE_editmesh.hh"
#include "BKE_image.hh"
#include "BKE_layer.hh"
#include "BKE_lib_id.hh"
#include "BKE_main.hh"
#include "BKE_mesh.hh"
#include "BKE_object_types.hh"
#include "BKE_report.hh"
#include "BKE_screen.hh"
#include "BKE_subdiv.hh"
#include "BKE_subdiv_mesh.hh"
#include "BKE_subdiv_modifier.hh"
#include "BKE_uvproject.h"
#include "DEG_depsgraph.hh"
#include "GEO_uv_pack.hh"
#include "GEO_uv_parametrizer.hh"
#include "UI_interface_layout.hh"
#include "UI_resources.hh"
#include "ED_image.hh"
#include "ED_mesh.hh"
#include "ED_screen.hh"
#include "ED_undo.hh"
#include "ED_uvedit.hh"
#include "ED_view3d.hh"
#include "DEG_depsgraph_query.hh"
#include "RNA_access.hh"
#include "RNA_define.hh"
#include "WM_api.hh"
#include "WM_types.hh"
#include "uvedit_intern.hh"

Go to the source code of this file.

Classes

struct  blender::UnwrapOptions
struct  blender::MinStretch
struct  blender::UVPackIslandsData
struct  blender::ThickFace
struct  blender::UV_FaceBranch
class  blender::ParamHandle
struct  blender::ParamSlimOptions

Namespaces

namespace  blender
 BMesh Iterators.

Macros

#define PACK_ROTATE_METHOD_AXIS_ALIGNED_OFFSET   3

Typedefs

using blender::ParamKey

Functions

static void blender::island_uv_transform (FaceIsland *island, const float matrix[2][2], const float pre_translate[2])
static float blender::uv_nearest_image_tile_distance (const Image *image, const float coords[2], float nearest_tile_co[2])
static float blender::uv_nearest_grid_tile_distance (const int udim_grid[2], const float coords[2], float nearest_tile_co[2])
static bool blender::island_has_pins (const Scene *scene, const BMesh *bm, FaceIsland *island, const geometry::UVPackIsland_Params *params)
static void blender::uvedit_pack_islands_multi (const Scene *scene, const Span< Object * > objects, BMesh **bmesh_override, const SpaceImage *udim_source_closest, const bool original_selection, const bool notify_wm, const rctf *custom_region, geometry::UVPackIsland_Params *params)
Utility Functions
static bool blender::uvedit_ensure_uvs (Object *obedit)
Shared Properties
static void blender::uv_map_operator_property_correct_aspect (wmOperatorType *ot)
Parametrizer Conversion
static void blender::modifier_unwrap_state (Object *obedit, const UnwrapOptions *options, bool *r_use_subsurf)
static UnwrapOptions blender::unwrap_options_get (wmOperator *op, Object *ob, const ToolSettings *ts)
template<typename T>
static bool blender::rna_property_sync_flag (PointerRNA *ptr, const char *prop_name, T flag, bool flipped, T *value_p)
static bool blender::rna_property_sync_enum (PointerRNA *ptr, const char *prop_name, int *value_p)
template<typename T>
static bool blender::rna_property_sync_enum_char (PointerRNA *ptr, const char *prop_name, T *value_p)
static bool blender::rna_property_sync_int (PointerRNA *ptr, const char *prop_name, int *value_p)
static bool blender::rna_property_sync_float (PointerRNA *ptr, const char *prop_name, float *value_p)
static bool blender::rna_property_sync_string (PointerRNA *ptr, const char *prop_name, char value_p[])
static void blender::unwrap_options_sync_toolsettings (wmOperator *op, ToolSettings *ts)
static bool blender::uvedit_have_selection (const Scene *scene, BMesh *bm, const UnwrapOptions *options)
static bool blender::uvedit_have_selection_multi (const Scene *scene, const Span< Object * > objects, const UnwrapOptions *options)
void blender::ED_uvedit_get_aspect_from_material (Object *ob, const int material_index, float *r_aspx, float *r_aspy)
void blender::ED_uvedit_get_aspect (Object *obedit, float *r_aspx, float *r_aspy)
float blender::ED_uvedit_get_aspect_y (Object *obedit)
static bool blender::uvedit_is_face_affected (const Scene *scene, const BMesh *bm, BMFace *efa, const UnwrapOptions *options, const BMUVOffsets &offsets)
static void blender::uvedit_prepare_pinned_indices (ParamHandle *handle, const Scene *scene, const BMesh *bm, BMFace *efa, const UnwrapOptions *options, const BMUVOffsets &offsets)
static void blender::construct_param_handle_face_add (ParamHandle *handle, const Scene *scene, const BMesh *bm, BMFace *efa, geometry::ParamKey face_index, const UnwrapOptions *options, const BMUVOffsets &offsets, const int cd_weight_offset, const int cd_weight_index)
static void blender::construct_param_edge_set_seams (ParamHandle *handle, BMesh *bm, const UnwrapOptions *options)
static ParamHandle * blender::construct_param_handle (const Scene *scene, Object *ob, const UnwrapOptions *options, int *r_count_failed=nullptr)
static ParamHandle * blender::construct_param_handle_multi (const Scene *scene, const Span< Object * > objects, const UnwrapOptions *options)
static void blender::texface_from_original_index (const Scene *scene, const BMesh *bm, const BMUVOffsets &offsets, BMFace *efa, int index, float **r_uv, bool *r_pin, bool *r_select)
static Mesh * blender::subdivide_edit_mesh (const Object *object, BMesh *bm, const SubsurfModifierData *smd)
static ParamHandle * blender::construct_param_handle_subsurfed (const Scene *scene, Object *ob, const UnwrapOptions *options, int *r_count_failed=nullptr)
Minimize Stretch Operator
static bool blender::minimize_stretch_init (bContext *C, wmOperator *op)
static void blender::minimize_stretch_iteration (bContext *C, wmOperator *op, bool interactive)
static void blender::minimize_stretch_exit (bContext *C, wmOperator *op, bool cancel)
static wmOperatorStatus blender::minimize_stretch_exec (bContext *C, wmOperator *op)
static wmOperatorStatus blender::minimize_stretch_invoke (bContext *C, wmOperator *op, const wmEvent *)
static wmOperatorStatus blender::minimize_stretch_modal (bContext *C, wmOperator *op, const wmEvent *event)
static void blender::minimize_stretch_cancel (bContext *C, wmOperator *op)
void blender::UV_OT_minimize_stretch (wmOperatorType *ot)
Average UV Islands Scale Operator
static wmOperatorStatus blender::average_islands_scale_exec (bContext *C, wmOperator *op)
void blender::UV_OT_average_islands_scale (wmOperatorType *ot)
UV Map Clip & Correct
static void blender::uv_map_clip_correct_properties_ex (wmOperatorType *ot, bool clip_to_bounds)
static void blender::uv_map_clip_correct_properties (wmOperatorType *ot)
static void blender::uv_map_clip_correct (const Scene *scene, const Span< Object * > objects, wmOperator *op, bool per_face_aspect, bool only_selected_uvs)
Project UV From View Operator
static wmOperatorStatus blender::uv_from_view_exec (bContext *C, wmOperator *op)
static wmOperatorStatus blender::uv_from_view_invoke (bContext *C, wmOperator *op, const wmEvent *)
static bool blender::uv_from_view_poll (bContext *C)
void blender::UV_OT_project_from_view (wmOperatorType *ot)
Reset UV Operator
static wmOperatorStatus blender::reset_exec (bContext *C, wmOperator *)
void blender::UV_OT_reset (wmOperatorType *ot)
Sphere UV Project Operator
static void blender::uv_map_mirror (BMFace *efa, const bool *regular, const bool fan, const int cd_loop_uv_offset)
static float blender::uv_sphere_project (const Scene *scene, BMesh *bm, BMFace *efa_init, const float center[3], const float rotmat[3][3], const bool fan, const BMUVOffsets &offsets, const bool only_selected_uvs, const bool use_seams, const float branch_init)
static wmOperatorStatus blender::sphere_project_exec (bContext *C, wmOperator *op)
void blender::UV_OT_sphere_project (wmOperatorType *ot)
Cylinder UV Project Operator
static float blender::uv_cylinder_project (const Scene *scene, BMesh *bm, BMFace *efa_init, const float center[3], const float rotmat[3][3], const bool fan, const BMUVOffsets &offsets, const bool only_selected_uvs, const bool use_seams, const float branch_init)
static wmOperatorStatus blender::cylinder_project_exec (bContext *C, wmOperator *op)
void blender::UV_OT_cylinder_project (wmOperatorType *ot)
Cube UV Project Operator
static void blender::uvedit_unwrap_cube_project (const Scene *scene, BMesh *bm, float cube_size, const bool use_select, const bool only_selected_uvs, const float center[3])
static wmOperatorStatus blender::cube_project_exec (bContext *C, wmOperator *op)
void blender::UV_OT_cube_project (wmOperatorType *ot)
Simple UVs for Texture Painting
void blender::ED_uvedit_add_simple_uvs (Main *bmain, const Scene *scene, Object *ob)

UV Map Common Transforms

#define VIEW_ON_EQUATOR   0
#define VIEW_ON_POLES   1
#define ALIGN_TO_OBJECT   2
#define POLAR_ZX   0
#define POLAR_ZY   1
enum  { blender::PINCH = 0 , blender::FAN = 1 }
static void blender::uv_map_transform_calc_bounds (BMesh *bm, float r_min[3], float r_max[3])
static void blender::uv_map_transform_calc_center_median (BMesh *bm, float r_center[3])
static void blender::uv_map_transform_center (const Scene *scene, View3D *v3d, Object *ob, BMesh *bm, float r_center[3], float r_bounds[2][3])
static void blender::uv_map_rotation_matrix_ex (float result[4][4], RegionView3D *rv3d, Object *ob, float upangledeg, float sideangledeg, float radius, const float offset[4])
static void blender::uv_map_transform (bContext *C, wmOperator *op, float rotmat[3][3])
static void blender::uv_transform_properties (wmOperatorType *ot, int radius)
static void blender::shrink_loop_uv_by_aspect_ratio (BMFace *efa, const int cd_loop_uv_offset, const float aspect_y)
static void blender::correct_uv_aspect (Object *ob, BMesh *bm)
static void blender::correct_uv_aspect_per_face (Object *ob, BMesh *bm)

Pack UV Islands Operator

enum  { blender::PACK_UDIM_SRC_CLOSEST = 0 , blender::PACK_UDIM_SRC_ACTIVE , blender::PACK_ORIGINAL_AABB , blender::PACK_CUSTOM_REGION }
static const EnumPropertyItem blender::pack_margin_method_items []
static const EnumPropertyItem blender::pack_rotate_method_items []
static const EnumPropertyItem blender::pack_shape_method_items []
static const EnumPropertyItem blender::pinned_islands_method_items []
static void blender::pack_islands_startjob (void *pidv, wmJobWorkerStatus *worker_status)
static void blender::pack_islands_endjob (void *pidv)
static void blender::pack_islands_freejob (void *pidv)
static wmOperatorStatus blender::pack_islands_exec (bContext *C, wmOperator *op)
static void blender::uv_pack_islands_ui (bContext *, wmOperator *op)
static wmOperatorStatus blender::uv_pack_islands_invoke (bContext *C, wmOperator *op, const wmEvent *event)
void blender::UV_OT_pack_islands (wmOperatorType *ot)

UV Unwrap Operator

enum  { blender::UNWRAP_ERROR_NONUNIFORM = (1 << 0) , blender::UNWRAP_ERROR_NEGATIVE = (1 << 1) }
static void blender::uvedit_unwrap (const Scene *scene, Object *obedit, const UnwrapOptions *options, int *r_count_changed, int *r_count_failed)
static void blender::uvedit_unwrap_multi (const Scene *scene, const Span< Object * > objects, const UnwrapOptions *options, int *r_count_changed=nullptr, int *r_count_failed=nullptr)
void blender::ED_uvedit_live_unwrap (const Scene *scene, const Span< Object * > objects)
static wmOperatorStatus blender::unwrap_exec (bContext *C, wmOperator *op)
static void blender::unwrap_draw (bContext *, wmOperator *op)
void blender::UV_OT_unwrap (wmOperatorType *ot)

Live UV Unwrap

static struct  blender::g_live_unwrap = {nullptr}
bool blender::ED_uvedit_live_unwrap_timer_check (const wmTimer *timer)
static bool blender::uvedit_live_unwrap_timer_validate (const wmWindowManager *wm)
void blender::ED_uvedit_live_unwrap_begin (Scene *scene, Object *obedit, struct wmWindow *win_modal)
void blender::ED_uvedit_live_unwrap_re_solve ()
void blender::ED_uvedit_live_unwrap_end (bool cancel)

Smart UV Project Operator

static const float blender::smart_uv_project_area_ignore = 1e-12f
static int blender::smart_uv_project_thickface_area_cmp_fn (const void *tf_a_p, const void *tf_b_p)
static Vector< float3 > blender::smart_uv_project_calculate_project_normals (const ThickFace *thick_faces, const uint thick_faces_len, BMesh *bm, const float project_angle_limit_half_cos, const float project_angle_limit_cos, const float area_weight)
static wmOperatorStatus blender::smart_project_exec (bContext *C, wmOperator *op)
static wmOperatorStatus blender::smart_project_invoke (bContext *C, wmOperator *op, const wmEvent *event)
void blender::UV_OT_smart_project (wmOperatorType *ot)

Macro Definition Documentation

◆ ALIGN_TO_OBJECT

#define ALIGN_TO_OBJECT   2

◆ PACK_ROTATE_METHOD_AXIS_ALIGNED_OFFSET

#define PACK_ROTATE_METHOD_AXIS_ALIGNED_OFFSET   3

◆ POLAR_ZX

#define POLAR_ZX   0

Definition at line 2263 of file uvedit_unwrap_ops.cc.

Referenced by blender::uv_transform_properties().

◆ POLAR_ZY

#define POLAR_ZY   1

◆ VIEW_ON_EQUATOR

#define VIEW_ON_EQUATOR   0

◆ VIEW_ON_POLES

#define VIEW_ON_POLES   1

Definition at line 2260 of file uvedit_unwrap_ops.cc.

Referenced by blender::uv_transform_properties().