|
Blender V4.3
|
#include "MEM_guardedalloc.h"#include "BLI_ghash.h"#include "BLI_math_base_safe.h"#include "BLI_math_geom.h"#include "BLI_math_vector.h"#include "BLI_utildefines.h"#include "DNA_brush_types.h"#include "DNA_object_types.h"#include "DNA_scene_types.h"#include "BKE_brush.hh"#include "BKE_colortools.hh"#include "BKE_context.hh"#include "BKE_customdata.hh"#include "BKE_editmesh.hh"#include "BKE_image.hh"#include "BKE_mesh_mapping.hh"#include "BKE_paint.hh"#include "DEG_depsgraph.hh"#include "ED_image.hh"#include "ED_mesh.hh"#include "ED_screen.hh"#include "ED_uvedit.hh"#include "WM_api.hh"#include "WM_types.hh"#include "RNA_access.hh"#include "RNA_define.hh"#include "RNA_enum_types.hh"#include "paint_intern.hh"#include "uvedit_intern.hh"#include "UI_view2d.hh"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 enum eBrushUVSculptTool | eBrushUVSculptTool |
Enumerations | |
| enum | eBrushUVSculptTool { UV_SCULPT_BRUSH_TYPE_GRAB = 0 , UV_SCULPT_BRUSH_TYPE_RELAX = 1 , UV_SCULPT_BRUSH_TYPE_PINCH = 2 } |
| enum | { UV_SCULPT_BRUSH_TYPE_RELAX_LAPLACIAN = 0 , UV_SCULPT_BRUSH_TYPE_RELAX_HC = 1 , UV_SCULPT_BRUSH_TYPE_RELAX_COTAN = 2 } |
Functions | |
| static void | apply_sculpt_data_constraints (UvSculptData *sculptdata, float uv[2]) |
| static float | calc_strength (const UvSculptData *sculptdata, float p, const float len) |
| static void | HC_relaxation_iteration_uv (UvSculptData *sculptdata, const int cd_loop_uv_offset, const float mouse_coord[2], const float alpha, const float radius_sq, const float aspectRatio) |
| static void | laplacian_relaxation_iteration_uv (UvSculptData *sculptdata, const int cd_loop_uv_offset, const float mouse_coord[2], const float alpha, const float radius_sq, const float aspectRatio) |
| static void | add_weighted_edge (float(*delta_buf)[3], const UvElement *storage, const UvElement *ele_next, const UvElement *ele_prev, const float luv_next[2], const float luv_prev[2], const float weight) |
| static float | tri_weight_v3 (int method, const float *v1, const float *v2, const float *v3) |
| static void | relaxation_iteration_uv (UvSculptData *sculptdata, const int cd_loop_uv_offset, const float mouse_coord[2], const float alpha, const float radius_sq, const float aspect_ratio, const int method) |
| 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, BMLoop *l, int island_index, const bool do_islands) |
| static uint | uv_edge_hash (const void *key) |
| static bool | uv_edge_compare (const void *a, const void *b) |
| static void | set_element_flag (UvElement *element, const int flag) |
| static UvSculptData * | uv_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 void | register_common_props (wmOperatorType *ot) |
| void | SCULPT_OT_uv_sculpt_grab (wmOperatorType *ot) |
| void | SCULPT_OT_uv_sculpt_relax (wmOperatorType *ot) |
| void | SCULPT_OT_uv_sculpt_pinch (wmOperatorType *ot) |
UV Sculpt tools.
Definition in file sculpt_uv.cc.
| #define MARK_BOUNDARY 1 |
Definition at line 65 of file sculpt_uv.cc.
Referenced by add_weighted_edge(), and uv_sculpt_stroke_init().
| typedef enum eBrushUVSculptTool eBrushUVSculptTool |
| anonymous enum |
| Enumerator | |
|---|---|
| UV_SCULPT_BRUSH_TYPE_RELAX_LAPLACIAN | |
| UV_SCULPT_BRUSH_TYPE_RELAX_HC | |
| UV_SCULPT_BRUSH_TYPE_RELAX_COTAN | |
Definition at line 56 of file sculpt_uv.cc.
| enum eBrushUVSculptTool |
| Enumerator | |
|---|---|
| UV_SCULPT_BRUSH_TYPE_GRAB | |
| UV_SCULPT_BRUSH_TYPE_RELAX | |
| UV_SCULPT_BRUSH_TYPE_PINCH | |
Definition at line 50 of file sculpt_uv.cc.
|
static |
Definition at line 337 of file sculpt_uv.cc.
References fabsf, UvElement::flag, MARK_BOUNDARY, and sub_v2_v2v2().
Referenced by relaxation_iteration_uv().
|
static |
Definition at line 149 of file sculpt_uv.cc.
References clamp_f(), UvSculptData::constrain_to_bounds, UvSculptData::uv_base_offset, and v.
Referenced by HC_relaxation_iteration_uv(), laplacian_relaxation_iteration_uv(), relaxation_iteration_uv(), and uv_sculpt_stroke_apply().
|
static |
Definition at line 160 of file sculpt_uv.cc.
References BKE_brush_curve_strength(), CLAMP, UvSculpt::curve_preset, len, UvSculpt::strength_curve, and UvSculptData::uvsculpt.
Referenced by HC_relaxation_iteration_uv(), laplacian_relaxation_iteration_uv(), relaxation_iteration_uv(), uv_sculpt_stroke_apply(), and uv_sculpt_stroke_init().
|
static |
Definition at line 182 of file sculpt_uv.cc.
References add_v2_v2(), apply_sculpt_data_constraints(), Temp_UVData::b, BM_ELEM_CD_GET_FLOAT2_P, calc_strength(), copy_v2_v2(), diff(), dot_v2v2(), element, UvAdjacencyElement::element, float, UvAdjacencyElement::is_locked, MEM_callocN, MEM_SAFE_FREE, mul_v2_fl(), Temp_UVData::ncounter, Temp_UVData::p, sqrtf, sub_v2_v2v2(), Temp_UVData::sum_b, Temp_UVData::sum_co, UvSculptData::totalUniqueUvs, UvSculptData::totalUvEdges, UvAdjacencyElement::uv, UvSculptData::uv, UvEdge::uv1, UvEdge::uv2, and UvSculptData::uvedges.
Referenced by relaxation_iteration_uv().
|
static |
Definition at line 267 of file sculpt_uv.cc.
References add_v2_v2(), apply_sculpt_data_constraints(), BM_ELEM_CD_GET_FLOAT2_P, calc_strength(), copy_v2_v2(), diff(), dot_v2v2(), element, UvAdjacencyElement::element, float, UvAdjacencyElement::is_boundary, UvAdjacencyElement::is_locked, MEM_callocN, MEM_SAFE_FREE, mul_v2_fl(), Temp_UVData::ncounter, Temp_UVData::p, sqrtf, sub_v2_v2v2(), Temp_UVData::sum_co, UvSculptData::totalUniqueUvs, UvSculptData::totalUvEdges, UvAdjacencyElement::uv, UvSculptData::uv, UvEdge::uv1, UvEdge::uv2, and UvSculptData::uvedges.
Referenced by relaxation_iteration_uv().
|
static |
Definition at line 969 of file sculpt_uv.cc.
References ot, PROP_SKIP_SAVE, RNA_def_boolean(), RNA_def_property_flag(), and wmOperatorType::srna.
Referenced by SCULPT_OT_uv_sculpt_grab(), SCULPT_OT_uv_sculpt_pinch(), and SCULPT_OT_uv_sculpt_relax().
|
static |
Definition at line 378 of file sculpt_uv.cc.
References add_weighted_edge(), apply_sculpt_data_constraints(), BLI_assert, BM_ELEM_CD_GET_FLOAT2_P, BM_uv_element_get(), BM_uv_element_map_ensure_head_table(), calc_strength(), BMVert::co, copy_v2_v2(), diff(), UvAdjacencyElement::element, UvSculptData::elementMap, float, HC_relaxation_iteration_uv(), UvAdjacencyElement::is_locked, UvElement::l, laplacian_relaxation_iteration_uv(), len_squared_v2(), MEM_callocN, MEM_SAFE_FREE, BMLoop::next, UvElement::next, BMLoop::prev, safe_divide(), UvElement::separate, sqrtf, UvElementMap::storage, sub_v2_v2v2(), UvElementMap::total_uvs, UvSculptData::totalUniqueUvs, tri_weight_v3(), UvAdjacencyElement::uv, UvSculptData::uv, UV_SCULPT_BRUSH_TYPE_RELAX_HC, UV_SCULPT_BRUSH_TYPE_RELAX_LAPLACIAN, and BMLoop::v.
Referenced by uv_sculpt_stroke_apply().
| void SCULPT_OT_uv_sculpt_grab | ( | wmOperatorType * | ot | ) |
Definition at line 978 of file sculpt_uv.cc.
References wmOperatorType::description, ED_operator_uvedit_space_image(), wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::modal, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, register_common_props(), uv_sculpt_stroke_invoke(), and uv_sculpt_stroke_modal().
Referenced by ED_operatortypes_paint().
| void SCULPT_OT_uv_sculpt_pinch | ( | wmOperatorType * | ot | ) |
Definition at line 1030 of file sculpt_uv.cc.
References wmOperatorType::description, ED_operator_uvedit_space_image(), wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::modal, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, register_common_props(), uv_sculpt_stroke_invoke(), and uv_sculpt_stroke_modal().
Referenced by ED_operatortypes_paint().
| void SCULPT_OT_uv_sculpt_relax | ( | wmOperatorType * | ot | ) |
Definition at line 993 of file sculpt_uv.cc.
References CURVE_PRESET_SMOOTH, wmOperatorType::description, ED_operator_uvedit_space_image(), wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::modal, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, register_common_props(), RNA_def_enum(), wmOperatorType::srna, UV_SCULPT_BRUSH_TYPE_RELAX_COTAN, UV_SCULPT_BRUSH_TYPE_RELAX_HC, UV_SCULPT_BRUSH_TYPE_RELAX_LAPLACIAN, uv_sculpt_stroke_invoke(), and uv_sculpt_stroke_modal().
Referenced by ED_operatortypes_paint().
Definition at line 639 of file sculpt_uv.cc.
References flag, and UvEdge::flag.
Referenced by uv_sculpt_stroke_init().
|
static |
Definition at line 364 of file sculpt_uv.cc.
References BLI_assert_unreachable, cotangent_tri_weight_v3(), UV_SCULPT_BRUSH_TYPE_RELAX_COTAN, UV_SCULPT_BRUSH_TYPE_RELAX_HC, UV_SCULPT_BRUSH_TYPE_RELAX_LAPLACIAN, and v2.
Referenced by relaxation_iteration_uv().
|
static |
Definition at line 628 of file sculpt_uv.cc.
References b, UvEdge::uv1, and UvEdge::uv2.
Referenced by uv_sculpt_stroke_init().
|
static |
Definition at line 622 of file sculpt_uv.cc.
References BLI_ghashutil_uinthash().
Referenced by uv_sculpt_stroke_init().
|
static |
Definition at line 610 of file sculpt_uv.cc.
References BM_uv_element_get(), and l.
Referenced by uv_sculpt_stroke_init().
|
static |
Definition at line 479 of file sculpt_uv.cc.
References apply_sculpt_data_constraints(), BKE_editmesh_from_object(), BMEditMesh::bm, BM_ELEM_CD_GET_FLOAT2_P, calc_strength(), CD_PROP_FLOAT2, copy_v2_v2(), CTX_wm_region(), CTX_wm_space_image(), wmOperator::customdata, CustomData_get_offset(), diff(), dot_v2v2(), ED_space_image_get_size(), ED_space_image_get_zoom(), ED_uvedit_live_unwrap_re_solve(), element, UvAdjacencyElement::element, SpaceImage::flag, float, UVInitialStroke::init_coord, UvSculptData::initial_stroke, UVInitialStrokeElement::initial_uv, UVInitialStroke::initialSelection, invert(), UvSculptData::invert, UvAdjacencyElement::is_locked, BMesh::ldata, wmEvent::mval, normalize_v2(), wmOperator::ptr, relaxation_iteration_uv(), RNA_enum_get(), SI_LIVE_UNWRAP, UvSculpt::size, sqrtf, UVInitialStrokeElement::strength, UvSculpt::strength, sub_v2_v2v2(), UvSculptData::tool, UVInitialStroke::totalInitialSelected, UvSculptData::totalUniqueUvs, UI_view2d_region_to_view(), UvAdjacencyElement::uv, UVInitialStrokeElement::uv, UvSculptData::uv, UV_SCULPT_BRUSH_TYPE_GRAB, UV_SCULPT_BRUSH_TYPE_PINCH, UV_SCULPT_BRUSH_TYPE_RELAX, and UvSculptData::uvsculpt.
Referenced by uv_sculpt_stroke_invoke(), and uv_sculpt_stroke_modal().
|
static |
Definition at line 587 of file sculpt_uv.cc.
References BM_uv_element_map_free(), CTX_wm_manager(), CTX_wm_space_image(), CTX_wm_window(), wmOperator::customdata, ED_uvedit_live_unwrap_end(), SpaceImage::flag, MEM_SAFE_FREE, SI_LIVE_UNWRAP, and WM_event_timer_remove().
Referenced by uv_sculpt_stroke_init(), uv_sculpt_stroke_invoke(), and uv_sculpt_stroke_modal().
|
static |
Definition at line 650 of file sculpt_uv.cc.
References BKE_curvemapping_init(), BKE_editmesh_from_object(), BKE_image_find_nearest_tile_with_offset(), BLI_assert, BLI_ghash_free(), BLI_ghash_insert(), BLI_ghash_len(), BLI_ghash_lookup(), BLI_ghash_new(), BLI_ghashIterator_getKey(), bm, BMEditMesh::bm, BM_ELEM_CD_GET_BOOL, BM_ELEM_CD_GET_FLOAT2_P, BM_FACES_OF_MESH, BM_ITER_ELEM, BM_ITER_MESH, BM_LOOPS_OF_FACE, BM_uv_element_get(), BM_uv_element_map_create(), BM_uv_map_get_offsets(), calc_strength(), copy_v2_v2(), CTX_data_edit_object(), CTX_data_scene(), CTX_wm_region(), CTX_wm_space_image(), CTX_wm_window(), wmOperator::customdata, data, diff(), dot_v2v2(), ED_space_image_get_size(), ED_space_image_get_zoom(), ED_uvedit_live_unwrap_begin(), element, SpaceImage::flag, float, GHASH_ITER, wmOperatorType::idname, SpaceImage::image, UvEdge::is_interior, l, MARK_BOUNDARY, MEM_mallocN, MEM_SAFE_FREE, wmEvent::mval, BMLoop::next, BMUVOffsets::pin, wmOperator::ptr, RNA_boolean_get(), set_element_flag(), SI_CLIP_UV, SI_LIVE_UNWRAP, sqrtf, UvSculpt::strength_curve, STREQ, sub_v2_v2v2(), BMesh::totvert, wmOperator::type, UI_view2d_region_to_view(), BMUVOffsets::uv, 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_BRUSH_TYPE_GRAB, UV_SCULPT_BRUSH_TYPE_PINCH, UV_SCULPT_BRUSH_TYPE_RELAX, UV_SCULPT_LOCK_BORDERS, ToolSettings::uv_sculpt_settings, uv_sculpt_stroke_exit(), and ToolSettings::uvsculpt.
Referenced by uv_sculpt_stroke_invoke().
|
static |
Definition at line 916 of file sculpt_uv.cc.
References CTX_data_edit_object(), CTX_wm_manager(), CTX_wm_window(), data, OPERATOR_CANCELLED, OPERATOR_RUNNING_MODAL, TIMER, uv_sculpt_stroke_apply(), uv_sculpt_stroke_exit(), uv_sculpt_stroke_init(), WM_event_add_modal_handler(), and WM_event_timer_add().
Referenced by SCULPT_OT_uv_sculpt_grab(), SCULPT_OT_uv_sculpt_pinch(), and SCULPT_OT_uv_sculpt_relax().
|
static |
Definition at line 938 of file sculpt_uv.cc.
References CTX_data_edit_object(), CTX_wm_region(), wmEvent::customdata, wmOperator::customdata, Object::data, DEG_id_tag_update(), ED_region_tag_redraw(), INBETWEEN_MOUSEMOVE, LEFTMOUSE, MIDDLEMOUSE, MOUSEMOVE, NC_GEOM, ND_DATA, OPERATOR_FINISHED, OPERATOR_RUNNING_MODAL, RIGHTMOUSE, TIMER, wmEvent::type, uv_sculpt_stroke_apply(), uv_sculpt_stroke_exit(), and WM_event_add_notifier().
Referenced by SCULPT_OT_uv_sculpt_grab(), SCULPT_OT_uv_sculpt_pinch(), and SCULPT_OT_uv_sculpt_relax().