Blender  V3.3
Classes | Macros | Typedefs | Functions
sculpt_uv.c File Reference
#include "MEM_guardedalloc.h"
#include "BLI_ghash.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "DNA_brush_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "BKE_brush.h"
#include "BKE_colortools.h"
#include "BKE_context.h"
#include "BKE_customdata.h"
#include "BKE_editmesh.h"
#include "BKE_mesh_mapping.h"
#include "BKE_paint.h"
#include "DEG_depsgraph.h"
#include "ED_image.h"
#include "ED_mesh.h"
#include "ED_screen.h"
#include "WM_api.h"
#include "WM_types.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "paint_intern.h"
#include "uvedit_intern.h"
#include "UI_view2d.h"

Go to the source code of this file.

Classes

struct  UvAdjacencyElement
 
struct  UvEdge
 
struct  UVInitialStrokeElement
 
struct  UVInitialStroke
 
struct  UvSculptData
 
struct  Temp_UvData
 

Macros

#define MARK_BOUNDARY   1
 

Typedefs

typedef struct UvAdjacencyElement UvAdjacencyElement
 
typedef struct UvEdge UvEdge
 
typedef struct UVInitialStrokeElement UVInitialStrokeElement
 
typedef struct UVInitialStroke UVInitialStroke
 
typedef struct UvSculptData UvSculptData
 
typedef struct Temp_UvData Temp_UVData
 

Functions

static void HC_relaxation_iteration_uv (BMEditMesh *em, UvSculptData *sculptdata, const float mouse_coord[2], float alpha, float radius, float aspectRatio)
 
static void laplacian_relaxation_iteration_uv (BMEditMesh *em, UvSculptData *sculptdata, const float mouse_coord[2], float alpha, float radius, float aspectRatio)
 
static void uv_sculpt_stroke_apply (bContext *C, wmOperator *op, const wmEvent *event, Object *obedit)
 
static void uv_sculpt_stroke_exit (bContext *C, wmOperator *op)
 
static int uv_element_offset_from_face_get (UvElementMap *map, BMFace *efa, BMLoop *l, int island_index, const bool doIslands)
 
static uint uv_edge_hash (const void *key)
 
static bool uv_edge_compare (const void *a, const void *b)
 
static UvSculptDatauv_sculpt_stroke_init (bContext *C, wmOperator *op, const wmEvent *event)
 
static int uv_sculpt_stroke_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
static int uv_sculpt_stroke_modal (bContext *C, wmOperator *op, const wmEvent *event)
 
static bool uv_sculpt_stroke_poll (bContext *C)
 
void SCULPT_OT_uv_sculpt_stroke (wmOperatorType *ot)
 

Detailed Description

UV Sculpt tools.

Definition in file sculpt_uv.c.

Macro Definition Documentation

◆ MARK_BOUNDARY

#define MARK_BOUNDARY   1

Definition at line 45 of file sculpt_uv.c.

Typedef Documentation

◆ Temp_UVData

typedef struct Temp_UvData Temp_UVData

◆ UvAdjacencyElement

◆ UvEdge

typedef struct UvEdge UvEdge

◆ UVInitialStroke

◆ UVInitialStrokeElement

◆ UvSculptData

typedef struct UvSculptData UvSculptData

Function Documentation

◆ HC_relaxation_iteration_uv()

static void HC_relaxation_iteration_uv ( BMEditMesh em,
UvSculptData sculptdata,
const float  mouse_coord[2],
float  alpha,
float  radius,
float  aspectRatio 
)
static

◆ laplacian_relaxation_iteration_uv()

static void laplacian_relaxation_iteration_uv ( BMEditMesh em,
UvSculptData sculptdata,
const float  mouse_coord[2],
float  alpha,
float  radius,
float  aspectRatio 
)
static

◆ SCULPT_OT_uv_sculpt_stroke()

void SCULPT_OT_uv_sculpt_stroke ( wmOperatorType ot)

◆ uv_edge_compare()

static bool uv_edge_compare ( const void a,
const void b 
)
static

Definition at line 447 of file sculpt_uv.c.

References Freestyle::a, usdtokens::b(), UvEdge::uv1, and UvEdge::uv2.

Referenced by uv_sculpt_stroke_init().

◆ uv_edge_hash()

static uint uv_edge_hash ( const void key)
static

Definition at line 441 of file sculpt_uv.c.

References BLI_ghashutil_uinthash().

Referenced by uv_sculpt_stroke_init().

◆ uv_element_offset_from_face_get()

static int uv_element_offset_from_face_get ( UvElementMap map,
BMFace efa,
BMLoop l,
int  island_index,
const bool  doIslands 
)
static

Definition at line 431 of file sculpt_uv.c.

References BM_uv_element_get(), element, l, and map.

Referenced by uv_sculpt_stroke_init().

◆ uv_sculpt_stroke_apply()

static void uv_sculpt_stroke_apply ( bContext C,
wmOperator op,
const wmEvent event,
Object obedit 
)
static

◆ uv_sculpt_stroke_exit()

static void uv_sculpt_stroke_exit ( bContext C,
wmOperator op 
)
static

◆ uv_sculpt_stroke_init()

static UvSculptData* uv_sculpt_stroke_init ( bContext C,
wmOperator op,
const wmEvent event 
)
static

Definition at line 458 of file sculpt_uv.c.

References BKE_brush_alpha_get(), BKE_brush_curve_strength_clamped(), BKE_brush_size_get(), BKE_curvemapping_init(), BKE_editmesh_from_object(), BKE_paint_brush(), BLI_ghash_free(), BLI_ghash_insert(), BLI_ghash_len(), BLI_ghash_lookup(), BLI_ghash_new(), BLI_ghashIterator_getKey(), BMEditMesh::bm, bm, BM_FACES_OF_MESH, BM_ITER_ELEM, BM_ITER_MESH, BM_LOOPS_OF_FACE, BM_uv_element_get(), BM_uv_element_map_create(), Paint::brush, BRUSH_STROKE_INVERT, BRUSH_STROKE_SMOOTH, C, CD_MLOOPUV, copy_v2_v2(), counter, CTX_data_edit_object(), CTX_data_scene(), CTX_wm_region(), CTX_wm_space_image(), Brush::curve, wmOperator::customdata, CustomData_bmesh_get(), BMHeader::data, data, KDL::diff(), dot_v2v2(), ED_space_image_get_size(), ED_space_image_get_zoom(), UvNearestHit::efa, element, UvEdge::flag, float(), GHASH_ITER, BMLoop::head, height, l, UvNearestHit::l, BMesh::ldata, MARK_BOUNDARY, MEM_callocN, MEM_mallocN, MEM_SAFE_FREE, wmEvent::mval, BMLoop::next, NULL, UvSculpt::paint, wmOperator::ptr, RNA_enum_get(), scene, sqrtf, sub_v2_v2v2(), Scene::toolsettings, BMesh::totvert, UI_view2d_region_to_view(), MLoopUV::uv, UvEdge::uv1, UvEdge::uv2, uv_edge_compare(), uv_edge_hash(), uv_element_offset_from_face_get(), uv_find_nearest_vert(), UV_NEAREST_HIT_INIT_MAX, UV_SCULPT_ALL_ISLANDS, UV_SCULPT_LOCK_BORDERS, ToolSettings::uv_sculpt_settings, uv_sculpt_stroke_exit(), Brush::uv_sculpt_tool, UV_SCULPT_TOOL_GRAB, UV_SCULPT_TOOL_RELAX, UvSculptData::uvsculpt, ToolSettings::uvsculpt, ARegion::v2d, and width.

Referenced by uv_sculpt_stroke_invoke().

◆ uv_sculpt_stroke_invoke()

static int uv_sculpt_stroke_invoke ( bContext C,
wmOperator op,
const wmEvent event 
)
static

◆ uv_sculpt_stroke_modal()

static int uv_sculpt_stroke_modal ( bContext C,
wmOperator op,
const wmEvent event 
)
static

◆ uv_sculpt_stroke_poll()

static bool uv_sculpt_stroke_poll ( bContext C)
static