Blender V5.3
uvedit_ops.cc File Reference
#include <cmath>
#include <cstdlib>
#include <cstring>
#include "MEM_guardedalloc.h"
#include "DNA_image_types.h"
#include "DNA_material_types.h"
#include "DNA_mesh_types.h"
#include "DNA_node_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_space_types.h"
#include "BLI_bounds.hh"
#include "BLI_enum_flags.hh"
#include "BLI_kdtree.hh"
#include "BLI_math_base.hh"
#include "BLI_math_geom_c.hh"
#include "BLI_math_vector.hh"
#include "BLI_math_vector_c.hh"
#include "BLT_translation.hh"
#include "BKE_context.hh"
#include "BKE_customdata.hh"
#include "BKE_editmesh.hh"
#include "BKE_layer.hh"
#include "BKE_main_invariants.hh"
#include "BKE_material.hh"
#include "BKE_mesh_mapping.hh"
#include "BKE_mesh_types.hh"
#include "BKE_node.hh"
#include "BKE_node_legacy_types.hh"
#include "DEG_depsgraph.hh"
#include "DEG_depsgraph_query.hh"
#include "ED_image.hh"
#include "ED_mesh.hh"
#include "ED_node.hh"
#include "ED_screen.hh"
#include "ED_uvedit.hh"
#include "RNA_access.hh"
#include "RNA_define.hh"
#include "RNA_enum_types.hh"
#include "WM_api.hh"
#include "WM_message.hh"
#include "WM_types.hh"
#include "UI_interface.hh"
#include "UI_interface_layout.hh"
#include "UI_resources.hh"
#include "UI_view2d.hh"
#include "uvedit_intern.hh"

Go to the source code of this file.

Classes

struct  blender::UVAlignIslandBounds

Namespaces

namespace  blender
 BMesh Iterators.

Functions

State Testing
bool blender::ED_uvedit_test (Object *obedit)
Object Active Image
static bool blender::is_image_texture_node (bNode *node)
bool blender::ED_object_get_active_image (Object *ob, int mat_nr, Image **r_ima, ImageUser **r_iuser, const bNode **r_node, const bNodeTree **r_ntree)
void blender::ED_object_assign_active_image (Main *bmain, Object *ob, int mat_nr, Image *ima)
Live Unwrap Utilities
void blender::uvedit_live_unwrap_update (SpaceImage *sima, Scene *scene, Object *obedit)
Remove Doubles Operator
static wmOperatorStatus blender::uv_remove_doubles_to_selected (bContext *C, wmOperator *op)
static wmOperatorStatus blender::uv_remove_doubles_to_unselected (bContext *C, wmOperator *op)
static wmOperatorStatus blender::uv_remove_doubles_to_selected_shared_vertex (bContext *C, wmOperator *op)
static wmOperatorStatus blender::uv_remove_doubles_exec (bContext *C, wmOperator *op)
static void blender::UV_OT_remove_doubles (wmOperatorType *ot)
Weld Near Operator
static wmOperatorStatus blender::uv_weld_exec (bContext *C, wmOperator *)
static void blender::UV_OT_weld (wmOperatorType *ot)
Snap Cursor Operator
static void blender::uv_snap_to_pixel (float uvco[2], float w, float h)
static void blender::uv_snap_cursor_to_pixels (SpaceImage *sima)
static bool blender::uv_snap_cursor_to_selection (Scene *scene, Span< Object * > objects_edit, SpaceImage *sima)
static void blender::uv_snap_cursor_to_origin (float uvco[2])
static wmOperatorStatus blender::uv_snap_cursor_exec (bContext *C, wmOperator *op)
static void blender::UV_OT_snap_cursor (wmOperatorType *ot)
Snap Selection Operator
static bool blender::uv_snap_uvs_to_cursor (Scene *scene, Object *obedit, const float cursor[2])
static bool blender::uv_snap_uvs_offset (Scene *scene, Object *obedit, const float offset[2])
static bool blender::uv_snap_uvs_to_adjacent_unselected (Scene *scene, Object *obedit)
static bool blender::uv_snap_uvs_to_pixels (SpaceImage *sima, Scene *scene, Object *obedit)
static wmOperatorStatus blender::uv_snap_selection_exec (bContext *C, wmOperator *op)
static void blender::UV_OT_snap_selected (wmOperatorType *ot)
Pin UVs Operator
static wmOperatorStatus blender::uv_pin_exec (bContext *C, wmOperator *op)
static void blender::UV_OT_pin (wmOperatorType *ot)
Reveal Operator
static wmOperatorStatus blender::uv_reveal_exec (bContext *C, wmOperator *op)
static void blender::UV_OT_reveal (wmOperatorType *ot)
Set 2D Cursor Operator
static wmOperatorStatus blender::uv_set_2d_cursor_exec (bContext *C, wmOperator *op)
static wmOperatorStatus blender::uv_set_2d_cursor_invoke (bContext *C, wmOperator *op, const wmEvent *event)
static void blender::UV_OT_cursor_set (wmOperatorType *ot)
Seam from UV Islands Operator
static wmOperatorStatus blender::uv_seams_from_islands_exec (bContext *C, wmOperator *op)
static void blender::UV_OT_seams_from_islands (wmOperatorType *ot)
Mark Seam Operator
static wmOperatorStatus blender::uv_mark_seam_exec (bContext *C, wmOperator *op)
static wmOperatorStatus blender::uv_mark_seam_invoke (bContext *C, wmOperator *op, const wmEvent *)
static void blender::UV_OT_mark_seam (wmOperatorType *ot)
static bool blender::uv_copy_mirrored_faces (const Scene *scene, BMesh *bm, const int mesh_axis, const int uv_axis, const int precision, int *r_double_warn)
static wmOperatorStatus blender::uv_copy_mirrored_faces_exec (bContext *C, wmOperator *op)
void blender::UV_OT_copy_mirrored_faces (wmOperatorType *ot)
Operator Registration & Keymap
void blender::ED_operatortypes_uvedit ()
void blender::ED_operatormacros_uvedit ()
void blender::ED_keymap_uvedit (wmKeyConfig *keyconf)

Hide Operator

#define UV_VERT_SEL_TEST(ts, bm, l, bool_test)
#define UV_EDGE_SEL_TEST(ts, bm, l, bool_test)
static bool blender::bm_face_is_any_sel (const ToolSettings *ts, const BMesh *bm, BMFace *f, bool select_test)
static bool blender::bm_face_is_any_vert_sel (const ToolSettings *ts, const BMesh *bm, BMFace *f, bool select_test)
static bool blender::bm_face_is_any_edge_sel (const ToolSettings *ts, const BMesh *bm, BMFace *f, bool select_test)
static bool blender::bm_face_is_all_uv_sel (const ToolSettings *ts, const BMesh *bm, BMFace *f, bool select_test)
static bool blender::uv_mesh_hide_select_sync (const ToolSettings *ts, Object *ob, BMEditMesh *em, bool swap)
static bool blender::uv_mesh_hide_no_sync (const Scene *scene, Object *ob, BMEditMesh *em, bool swap)
static wmOperatorStatus blender::uv_hide_exec (bContext *C, wmOperator *op)
static void blender::UV_OT_hide (wmOperatorType *ot)

Geometric Utilities

enum class  blender::UVMoveType { blender::Dynamic = 0 , blender::Pixel = 1 , blender::Udim = 2 }
enum class  blender::UVMoveDirection { blender::X = 0 , blender::Y = 1 }
void blender::ED_uvedit_foreach_uv (const Scene *scene, BMesh *bm, const bool skip_invisible, const bool selected, FunctionRef< void(float[2])> user_fn)
void blender::ED_uvedit_foreach_uv_multi (const Scene *scene, const Span< Object * > objects_edit, const bool skip_invisible, const bool skip_nonselected, FunctionRef< void(float[2])> user_fn)
bool blender::ED_uvedit_minmax_multi (const Scene *scene, const Span< Object * > objects_edit, float r_min[2], float r_max[2])
void blender::ED_uvedit_select_all (const ToolSettings *ts, BMesh *bm)
static bool blender::uvedit_median_multi (const Scene *scene, const Span< Object * > objects_edit, float co[2])
bool blender::ED_uvedit_center_multi (const Scene *scene, Span< Object * > objects_edit, float r_cent[2], char mode)
bool blender::ED_uvedit_center_from_pivot_ex (const Main &bmain, const SpaceImage *sima, Scene *scene, ViewLayer *view_layer, float r_center[2], char mode, bool *r_has_select)
static wmOperatorStatus blender::uv_move_on_axis_exec (bContext *C, wmOperator *op)
static void blender::UV_OT_move_on_axis (wmOperatorType *ot)

Weld Align Operator

enum  blender::eUVWeldAlign {
  blender::UV_STRAIGHTEN , blender::UV_STRAIGHTEN_X , blender::UV_STRAIGHTEN_Y , blender::UV_ALIGN_AUTO ,
  blender::UV_ALIGN_X , blender::UV_ALIGN_Y , blender::UV_WELD
}
enum class  blender::UVAlignPositionMode { blender::Mean = 0 , blender::Min = 1 , blender::Max = 2 }
enum  blender::eUVEndPointPrecedence { blender::UVEP_INVALID = 0 , blender::UVEP_SELECTED = (1 << 0) , blender::UVEP_PINNED = (1 << 1) }
enum class  blender::UVAlignInitialPosition { blender::BoundingBox = 0 , blender::UVTileGrid = 1 , blender::ActiveUDIM = 2 , blender::Cursor = 3 }
enum class  blender::UVAlignIslandAxis { blender::X = 0 , blender::Y = 1 }
enum class  blender::UVAlignIslandMode { blender::Max = 0 , blender::Min = 1 , blender::Center = 2 , blender::None = 3 }
enum  blender::UVAlignIslandOrder { blender::LargeToSmall = 0 , blender::SmallToLarge = 1 , blender::Fixed = 2 }
static bool blender::uvedit_uv_align_weld (Scene *scene, BMesh *bm, const eUVWeldAlign tool, const float cent[2])
 blender::ENUM_OPERATORS (eUVEndPointPrecedence)
static eUVEndPointPrecedence blender::uvedit_line_update_get_precedence (const bool pinned)
static bool blender::uvedit_line_update_endpoint (const float *luv, const bool pinned, float uv_a[2], eUVEndPointPrecedence *prec_a, float uv_b[2], eUVEndPointPrecedence *prec_b)
static bool blender::uvedit_uv_straighten_elements (const UvElement *element, const int len, const BMUVOffsets &offsets, const eUVWeldAlign tool)
static bool blender::uvedit_uv_straighten (Scene *scene, BMesh *bm, eUVWeldAlign tool)
static bool blender::uvedit_uv_islands_arrange (const Scene *scene, BMesh *bm, const UVAlignIslandAxis axis, const UVAlignIslandMode align, const UVAlignIslandOrder order, const float margin, float2 &position)
static wmOperatorStatus blender::uv_arrange_islands_exec (bContext *C, wmOperator *op)
static void blender::UV_OT_arrange_islands (wmOperatorType *ot)
static void blender::uv_weld (bContext *C)
static void blender::uv_align (bContext *C, eUVWeldAlign tool, UVAlignPositionMode position_mode)
static wmOperatorStatus blender::uv_align_exec (bContext *C, wmOperator *op)
static bool blender::uv_align_poll_property (const bContext *, wmOperator *op, const PropertyRNA *prop)
static void blender::UV_OT_align (wmOperatorType *ot)

Macro Definition Documentation

◆ UV_EDGE_SEL_TEST

#define UV_EDGE_SEL_TEST ( ts,
bm,
l,
bool_test )
Value:
(uvedit_edge_select_get_no_sync(ts, bm, l) == bool_test)

Definition at line 1805 of file uvedit_ops.cc.

Referenced by blender::bm_face_is_all_uv_sel(), blender::bm_face_is_any_edge_sel(), blender::bm_face_is_any_sel(), and blender::uv_mesh_hide_no_sync().

◆ UV_VERT_SEL_TEST

#define UV_VERT_SEL_TEST ( ts,
bm,
l,
bool_test )
Value:
(uvedit_vert_select_get_no_sync(ts, bm, l) == bool_test)

Definition at line 1802 of file uvedit_ops.cc.

Referenced by blender::bm_face_is_any_sel(), blender::bm_face_is_any_vert_sel(), and blender::uv_mesh_hide_no_sync().