Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/uvedit/uvedit_ops.c
| Show First 20 Lines • Show All 2,370 Lines • ▼ Show 20 Lines | static void uv_select_all_perform_multi( | ||||
| for (uint ob_index = 0; ob_index < objects_len; ob_index++) { | for (uint ob_index = 0; ob_index < objects_len; ob_index++) { | ||||
| Object *obedit = objects[ob_index]; | Object *obedit = objects[ob_index]; | ||||
| uv_select_all_perform(scene, ima, obedit, action); | uv_select_all_perform(scene, ima, obedit, action); | ||||
| } | } | ||||
| } | } | ||||
| static int uv_select_all_exec(bContext *C, wmOperator *op) | static int uv_select_all_exec(bContext *C, wmOperator *op) | ||||
| { | { | ||||
| Depsgraph *depsgraph = CTX_data_depsgraph(C); | Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| ToolSettings *ts = scene->toolsettings; | ToolSettings *ts = scene->toolsettings; | ||||
| Image *ima = CTX_data_edit_image(C); | Image *ima = CTX_data_edit_image(C); | ||||
| ViewLayer *view_layer = CTX_data_view_layer(C); | ViewLayer *view_layer = CTX_data_view_layer(C); | ||||
| int action = RNA_enum_get(op->ptr, "action"); | int action = RNA_enum_get(op->ptr, "action"); | ||||
| uint objects_len = 0; | uint objects_len = 0; | ||||
| ▲ Show 20 Lines • Show All 63 Lines • ▼ Show 20 Lines | |||||
| static int uv_mouse_select_multi(bContext *C, | static int uv_mouse_select_multi(bContext *C, | ||||
| Object **objects, | Object **objects, | ||||
| uint objects_len, | uint objects_len, | ||||
| const float co[2], | const float co[2], | ||||
| const bool extend, | const bool extend, | ||||
| const bool deselect_all, | const bool deselect_all, | ||||
| const bool loop) | const bool loop) | ||||
| { | { | ||||
| Depsgraph *depsgraph = CTX_data_depsgraph(C); | Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); | ||||
| SpaceImage *sima = CTX_wm_space_image(C); | SpaceImage *sima = CTX_wm_space_image(C); | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| ToolSettings *ts = scene->toolsettings; | ToolSettings *ts = scene->toolsettings; | ||||
| Image *ima = CTX_data_edit_image(C); | Image *ima = CTX_data_edit_image(C); | ||||
| BMFace *efa; | BMFace *efa; | ||||
| BMLoop *l; | BMLoop *l; | ||||
| BMIter iter, liter; | BMIter iter, liter; | ||||
| MLoopUV *luv; | MLoopUV *luv; | ||||
| ▲ Show 20 Lines • Show All 956 Lines • ▼ Show 20 Lines | |||||
| /** \} */ | /** \} */ | ||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
| /** \name Box Select Operator | /** \name Box Select Operator | ||||
| * \{ */ | * \{ */ | ||||
| static int uv_box_select_exec(bContext *C, wmOperator *op) | static int uv_box_select_exec(bContext *C, wmOperator *op) | ||||
| { | { | ||||
| Depsgraph *depsgraph = CTX_data_depsgraph(C); | Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); | ||||
| SpaceImage *sima = CTX_wm_space_image(C); | SpaceImage *sima = CTX_wm_space_image(C); | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| ToolSettings *ts = scene->toolsettings; | ToolSettings *ts = scene->toolsettings; | ||||
| ViewLayer *view_layer = CTX_data_view_layer(C); | ViewLayer *view_layer = CTX_data_view_layer(C); | ||||
| Image *ima = CTX_data_edit_image(C); | Image *ima = CTX_data_edit_image(C); | ||||
| ARegion *ar = CTX_wm_region(C); | ARegion *ar = CTX_wm_region(C); | ||||
| BMFace *efa; | BMFace *efa; | ||||
| BMLoop *l; | BMLoop *l; | ||||
| ▲ Show 20 Lines • Show All 141 Lines • ▼ Show 20 Lines | static int uv_inside_circle(const float uv[2], const float offset[2], const float ellipse[2]) | ||||
| float x, y; | float x, y; | ||||
| x = (uv[0] - offset[0]) * ellipse[0]; | x = (uv[0] - offset[0]) * ellipse[0]; | ||||
| y = (uv[1] - offset[1]) * ellipse[1]; | y = (uv[1] - offset[1]) * ellipse[1]; | ||||
| return ((x * x + y * y) < 1.0f); | return ((x * x + y * y) < 1.0f); | ||||
| } | } | ||||
| static int uv_circle_select_exec(bContext *C, wmOperator *op) | static int uv_circle_select_exec(bContext *C, wmOperator *op) | ||||
| { | { | ||||
| Depsgraph *depsgraph = CTX_data_depsgraph(C); | Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); | ||||
| SpaceImage *sima = CTX_wm_space_image(C); | SpaceImage *sima = CTX_wm_space_image(C); | ||||
| Image *ima = CTX_data_edit_image(C); | Image *ima = CTX_data_edit_image(C); | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| ViewLayer *view_layer = CTX_data_view_layer(C); | ViewLayer *view_layer = CTX_data_view_layer(C); | ||||
| ToolSettings *ts = scene->toolsettings; | ToolSettings *ts = scene->toolsettings; | ||||
| ARegion *ar = CTX_wm_region(C); | ARegion *ar = CTX_wm_region(C); | ||||
| BMFace *efa; | BMFace *efa; | ||||
| BMLoop *l; | BMLoop *l; | ||||
| ▲ Show 20 Lines • Show All 123 Lines • ▼ Show 20 Lines | |||||
| /** \name Lasso Select Operator | /** \name Lasso Select Operator | ||||
| * \{ */ | * \{ */ | ||||
| static bool do_lasso_select_mesh_uv(bContext *C, | static bool do_lasso_select_mesh_uv(bContext *C, | ||||
| const int mcords[][2], | const int mcords[][2], | ||||
| short moves, | short moves, | ||||
| const eSelectOp sel_op) | const eSelectOp sel_op) | ||||
| { | { | ||||
| Depsgraph *depsgraph = CTX_data_depsgraph(C); | Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); | ||||
| SpaceImage *sima = CTX_wm_space_image(C); | SpaceImage *sima = CTX_wm_space_image(C); | ||||
| Image *ima = CTX_data_edit_image(C); | Image *ima = CTX_data_edit_image(C); | ||||
| ARegion *ar = CTX_wm_region(C); | ARegion *ar = CTX_wm_region(C); | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| ToolSettings *ts = scene->toolsettings; | ToolSettings *ts = scene->toolsettings; | ||||
| ViewLayer *view_layer = CTX_data_view_layer(C); | ViewLayer *view_layer = CTX_data_view_layer(C); | ||||
| const bool use_face_center = ((ts->uv_flag & UV_SYNC_SELECTION) ? | const bool use_face_center = ((ts->uv_flag & UV_SYNC_SELECTION) ? | ||||
| (ts->selectmode == SCE_SELECT_FACE) : | (ts->selectmode == SCE_SELECT_FACE) : | ||||
| ▲ Show 20 Lines • Show All 534 Lines • ▼ Show 20 Lines | |||||
| /** \} */ | /** \} */ | ||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
| /** \name Select Pinned UV's Operator | /** \name Select Pinned UV's Operator | ||||
| * \{ */ | * \{ */ | ||||
| static int uv_select_pinned_exec(bContext *C, wmOperator *UNUSED(op)) | static int uv_select_pinned_exec(bContext *C, wmOperator *UNUSED(op)) | ||||
| { | { | ||||
| Depsgraph *depsgraph = CTX_data_depsgraph(C); | Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| ToolSettings *ts = scene->toolsettings; | ToolSettings *ts = scene->toolsettings; | ||||
| ViewLayer *view_layer = CTX_data_view_layer(C); | ViewLayer *view_layer = CTX_data_view_layer(C); | ||||
| Image *ima = CTX_data_edit_image(C); | Image *ima = CTX_data_edit_image(C); | ||||
| BMFace *efa; | BMFace *efa; | ||||
| BMLoop *l; | BMLoop *l; | ||||
| BMIter iter, liter; | BMIter iter, liter; | ||||
| MLoopUV *luv; | MLoopUV *luv; | ||||
| ▲ Show 20 Lines • Show All 723 Lines • Show Last 20 Lines | |||||