Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/transform/transform_manipulator.c
| Show First 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | |||||
| #include "BKE_action.h" | #include "BKE_action.h" | ||||
| #include "BKE_context.h" | #include "BKE_context.h" | ||||
| #include "BKE_curve.h" | #include "BKE_curve.h" | ||||
| #include "BKE_global.h" | #include "BKE_global.h" | ||||
| #include "BKE_particle.h" | #include "BKE_particle.h" | ||||
| #include "BKE_pointcache.h" | #include "BKE_pointcache.h" | ||||
| #include "BKE_editmesh.h" | #include "BKE_editmesh.h" | ||||
| #include "BKE_lattice.h" | #include "BKE_lattice.h" | ||||
| #include "BKE_localview.h" | |||||
| #include "BKE_gpencil.h" | #include "BKE_gpencil.h" | ||||
| #include "BIF_gl.h" | #include "BIF_gl.h" | ||||
| #include "WM_api.h" | #include "WM_api.h" | ||||
| #include "WM_types.h" | #include "WM_types.h" | ||||
| #include "ED_armature.h" | #include "ED_armature.h" | ||||
| ▲ Show 20 Lines • Show All 266 Lines • ▼ Show 20 Lines | if (is_gp_edit) { | ||||
| /* selection center */ | /* selection center */ | ||||
| if (totsel) { | if (totsel) { | ||||
| mul_v3_fl(scene->twcent, 1.0f / (float)totsel); /* centroid! */ | mul_v3_fl(scene->twcent, 1.0f / (float)totsel); /* centroid! */ | ||||
| } | } | ||||
| } | } | ||||
| else if (obedit) { | else if (obedit) { | ||||
| ob = obedit; | ob = obedit; | ||||
| if ((ob->lay & v3d->lay) == 0) return 0; | if ((ob->lay & v3d->lay) == 0 || !BKE_localview_is_object_visible(v3d, ob)) | ||||
| return 0; | |||||
| if (obedit->type == OB_MESH) { | if (obedit->type == OB_MESH) { | ||||
| BMEditMesh *em = BKE_editmesh_from_object(obedit); | BMEditMesh *em = BKE_editmesh_from_object(obedit); | ||||
| BMEditSelection ese; | BMEditSelection ese; | ||||
| float vec[3] = {0, 0, 0}; | float vec[3] = {0, 0, 0}; | ||||
| /* USE LAST SELECTE WITH ACTIVE */ | /* USE LAST SELECTE WITH ACTIVE */ | ||||
| if ((v3d->around == V3D_AROUND_ACTIVE) && BM_select_history_active_get(em->bm, &ese)) { | if ((v3d->around == V3D_AROUND_ACTIVE) && BM_select_history_active_get(em->bm, &ese)) { | ||||
| ▲ Show 20 Lines • Show All 167 Lines • ▼ Show 20 Lines | if (totsel) { | ||||
| mul_m4_v3(obedit->obmat, scene->twmax); | mul_m4_v3(obedit->obmat, scene->twmax); | ||||
| } | } | ||||
| } | } | ||||
| else if (ob && (ob->mode & OB_MODE_POSE)) { | else if (ob && (ob->mode & OB_MODE_POSE)) { | ||||
| bPoseChannel *pchan; | bPoseChannel *pchan; | ||||
| int mode = TFM_ROTATION; // mislead counting bones... bah. We don't know the manipulator mode, could be mixed | int mode = TFM_ROTATION; // mislead counting bones... bah. We don't know the manipulator mode, could be mixed | ||||
| bool ok = false; | bool ok = false; | ||||
| if ((ob->lay & v3d->lay) == 0) return 0; | if ((ob->lay & v3d->lay) == 0 || !BKE_localview_is_object_visible(v3d, ob)) | ||||
| return 0; | |||||
| if ((v3d->around == V3D_AROUND_ACTIVE) && (pchan = BKE_pose_channel_active(ob))) { | if ((v3d->around == V3D_AROUND_ACTIVE) && (pchan = BKE_pose_channel_active(ob))) { | ||||
| /* doesn't check selection or visibility intentionally */ | /* doesn't check selection or visibility intentionally */ | ||||
| Bone *bone = pchan->bone; | Bone *bone = pchan->bone; | ||||
| if (bone) { | if (bone) { | ||||
| stats_pose(scene, rv3d, pchan); | stats_pose(scene, rv3d, pchan); | ||||
| totsel = 1; | totsel = 1; | ||||
| ok = true; | ok = true; | ||||
| ▲ Show 20 Lines • Show All 1,416 Lines • Show Last 20 Lines | |||||