Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_view3d/view3d_edit.c
| Show First 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | |||||
| #include "BLI_blenlib.h" | #include "BLI_blenlib.h" | ||||
| #include "BLI_math.h" | #include "BLI_math.h" | ||||
| #include "BLI_utildefines.h" | #include "BLI_utildefines.h" | ||||
| #include "BKE_armature.h" | #include "BKE_armature.h" | ||||
| #include "BKE_camera.h" | #include "BKE_camera.h" | ||||
| #include "BKE_context.h" | #include "BKE_context.h" | ||||
| #include "BKE_font.h" | #include "BKE_font.h" | ||||
| #include "BKE_gpencil.h" | |||||
| #include "BKE_layer.h" | #include "BKE_layer.h" | ||||
| #include "BKE_library.h" | #include "BKE_library.h" | ||||
| #include "BKE_main.h" | #include "BKE_main.h" | ||||
| #include "BKE_object.h" | #include "BKE_object.h" | ||||
| #include "BKE_paint.h" | #include "BKE_paint.h" | ||||
| #include "BKE_report.h" | #include "BKE_report.h" | ||||
| #include "BKE_scene.h" | #include "BKE_scene.h" | ||||
| #include "BKE_screen.h" | #include "BKE_screen.h" | ||||
| Show All 9 Lines | |||||
| #include "RNA_access.h" | #include "RNA_access.h" | ||||
| #include "RNA_define.h" | #include "RNA_define.h" | ||||
| #include "ED_armature.h" | #include "ED_armature.h" | ||||
| #include "ED_particle.h" | #include "ED_particle.h" | ||||
| #include "ED_screen.h" | #include "ED_screen.h" | ||||
| #include "ED_transform.h" | #include "ED_transform.h" | ||||
| #include "ED_mesh.h" | #include "ED_mesh.h" | ||||
| #include "ED_gpencil.h" | |||||
| #include "ED_view3d.h" | #include "ED_view3d.h" | ||||
| #include "ED_transform_snap_object_context.h" | #include "ED_transform_snap_object_context.h" | ||||
| #include "UI_resources.h" | #include "UI_resources.h" | ||||
| #include "PIL_time.h" | #include "PIL_time.h" | ||||
| #include "view3d_intern.h" /* own include */ | #include "view3d_intern.h" /* own include */ | ||||
| ▲ Show 20 Lines • Show All 2,718 Lines • ▼ Show 20 Lines | |||||
| static int viewselected_exec(bContext *C, wmOperator *op) | static int viewselected_exec(bContext *C, wmOperator *op) | ||||
| { | { | ||||
| ARegion *ar = CTX_wm_region(C); | ARegion *ar = CTX_wm_region(C); | ||||
| View3D *v3d = CTX_wm_view3d(C); | View3D *v3d = CTX_wm_view3d(C); | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| Depsgraph *depsgraph = CTX_data_depsgraph(C); | Depsgraph *depsgraph = CTX_data_depsgraph(C); | ||||
| ViewLayer *view_layer_eval = DEG_get_evaluated_view_layer(depsgraph); | ViewLayer *view_layer_eval = DEG_get_evaluated_view_layer(depsgraph); | ||||
| bGPdata *gpd = CTX_data_gpencil_data(C); | bGPdata *gpd = CTX_data_gpencil_data(C); | ||||
| const bool is_gp_edit = ((gpd) && (gpd->flag & GP_DATA_STROKE_EDITMODE)); | const bool is_gp_edit = GPENCIL_ANY_MODE(gpd); | ||||
| const bool is_face_map = ((is_gp_edit == false) && ar->manipulator_map && | const bool is_face_map = ((is_gp_edit == false) && ar->manipulator_map && | ||||
| WM_manipulatormap_is_any_selected(ar->manipulator_map)); | WM_manipulatormap_is_any_selected(ar->manipulator_map)); | ||||
| Object *ob_eval = OBACT(view_layer_eval); | Object *ob_eval = OBACT(view_layer_eval); | ||||
| Object *obedit = CTX_data_edit_object(C); | Object *obedit = CTX_data_edit_object(C); | ||||
| float min[3], max[3]; | float min[3], max[3]; | ||||
| bool ok = false, ok_dist = true; | bool ok = false, ok_dist = true; | ||||
| const bool use_all_regions = RNA_boolean_get(op->ptr, "use_all_regions"); | const bool use_all_regions = RNA_boolean_get(op->ptr, "use_all_regions"); | ||||
| const bool skip_camera = (ED_view3d_camera_lock_check(v3d, ar->regiondata) || | const bool skip_camera = (ED_view3d_camera_lock_check(v3d, ar->regiondata) || | ||||
| Show All 22 Lines | static int viewselected_exec(bContext *C, wmOperator *op) | ||||
| } | } | ||||
| if (is_gp_edit) { | if (is_gp_edit) { | ||||
| /* TODO(sergey): Check on this after gpencil merge. */ | /* TODO(sergey): Check on this after gpencil merge. */ | ||||
| CTX_DATA_BEGIN(C, bGPDstroke *, gps, editable_gpencil_strokes) | CTX_DATA_BEGIN(C, bGPDstroke *, gps, editable_gpencil_strokes) | ||||
| { | { | ||||
| /* we're only interested in selected points here... */ | /* we're only interested in selected points here... */ | ||||
| if ((gps->flag & GP_STROKE_SELECT) && (gps->flag & GP_STROKE_3DSPACE)) { | if ((gps->flag & GP_STROKE_SELECT) && (gps->flag & GP_STROKE_3DSPACE)) { | ||||
| if (ED_gpencil_stroke_minmax(gps, true, min, max)) { | ok |= BKE_gpencil_stroke_minmax(gps, true, min, max); | ||||
| ok = true; | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
| CTX_DATA_END; | CTX_DATA_END; | ||||
| } | } | ||||
| else if (is_face_map) { | else if (is_face_map) { | ||||
| ok = WM_manipulatormap_minmax(ar->manipulator_map, true, true, min, max); | ok = WM_manipulatormap_minmax(ar->manipulator_map, true, true, min, max); | ||||
| } | } | ||||
| else if (obedit) { | else if (obedit) { | ||||
| ▲ Show 20 Lines • Show All 1,886 Lines • Show Last 20 Lines | |||||