Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_view3d/view3d_navigate.c
| Show First 20 Lines • Show All 168 Lines • ▼ Show 20 Lines | bool view3d_orbit_calc_center(bContext *C, float r_dyn_ofs[3]) | ||||
| View3D *v3d = CTX_wm_view3d(C); | View3D *v3d = CTX_wm_view3d(C); | ||||
| BKE_view_layer_synced_ensure(scene_eval, view_layer_eval); | BKE_view_layer_synced_ensure(scene_eval, view_layer_eval); | ||||
| Object *ob_act_eval = BKE_view_layer_active_object_get(view_layer_eval); | Object *ob_act_eval = BKE_view_layer_active_object_get(view_layer_eval); | ||||
| Object *ob_act = DEG_get_original_object(ob_act_eval); | Object *ob_act = DEG_get_original_object(ob_act_eval); | ||||
| if (ob_act && (ob_act->mode & OB_MODE_ALL_PAINT) && | if (ob_act && (ob_act->mode & OB_MODE_ALL_PAINT) && | ||||
| /* with weight-paint + pose-mode, fall through to using calculateTransformCenter */ | /* with weight-paint + pose-mode, fall through to using calculateTransformCenter */ | ||||
| ((ob_act->mode & OB_MODE_WEIGHT_PAINT) && BKE_object_pose_armature_get(ob_act)) == 0) { | ((ob_act->mode & OB_MODE_WEIGHT_PAINT) && BKE_object_pose_armature_get(ob_act)) == 0) { | ||||
| /* in case of sculpting use last average stroke position as a rotation | |||||
| * center, in other cases it's not clear what rotation center shall be | |||||
| * so just rotate around object origin | |||||
| */ | |||||
| if (ob_act->mode & | |||||
| (OB_MODE_SCULPT | OB_MODE_TEXTURE_PAINT | OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT)) { | |||||
| float stroke[3]; | float stroke[3]; | ||||
| BKE_paint_stroke_get_average(scene, ob_act_eval, stroke); | BKE_paint_stroke_get_average(scene, ob_act_eval, stroke); | ||||
campbellbarton: This could just pass in `lastofs`. | |||||
| copy_v3_v3(lastofs, stroke); | copy_v3_v3(lastofs, stroke); | ||||
| } | |||||
| else { | |||||
| copy_v3_v3(lastofs, ob_act_eval->object_to_world[3]); | |||||
| } | |||||
| is_set = true; | is_set = true; | ||||
| } | } | ||||
| else if (ob_act && (ob_act->mode & OB_MODE_EDIT) && (ob_act->type == OB_FONT)) { | else if (ob_act && (ob_act->mode & OB_MODE_EDIT) && (ob_act->type == OB_FONT)) { | ||||
| Curve *cu = ob_act_eval->data; | Curve *cu = ob_act_eval->data; | ||||
| EditFont *ef = cu->editfont; | EditFont *ef = cu->editfont; | ||||
| zero_v3(lastofs); | zero_v3(lastofs); | ||||
| for (int i = 0; i < 4; i++) { | for (int i = 0; i < 4; i++) { | ||||
| ▲ Show 20 Lines • Show All 1,460 Lines • Show Last 20 Lines | |||||
This could just pass in lastofs.