Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/transform/transform_manipulator.c
| Show First 20 Lines • Show All 53 Lines • ▼ Show 20 Lines | |||||
| #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_gpencil.h" | #include "BKE_gpencil.h" | ||||
| #include "BKE_armature.h" | |||||
| #include "BKE_object.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" | ||||
| #include "ED_curve.h" | #include "ED_curve.h" | ||||
| ▲ Show 20 Lines • Show All 581 Lines • ▼ Show 20 Lines | switch (v3d->twmode) { | ||||
| case V3D_MANIP_VIEW: | case V3D_MANIP_VIEW: | ||||
| { | { | ||||
| float mat[3][3]; | float mat[3][3]; | ||||
| copy_m3_m4(mat, rv3d->viewinv); | copy_m3_m4(mat, rv3d->viewinv); | ||||
| normalize_m3(mat); | normalize_m3(mat); | ||||
| copy_m4_m3(rv3d->twmat, mat); | copy_m4_m3(rv3d->twmat, mat); | ||||
| break; | break; | ||||
| } | } | ||||
| /* The axial orientation behaves like the local orientation if the object/pose bone | |||||
| * has no rotation or scale transformation. | |||||
| */ | |||||
| case V3D_MANIP_AXIAL: | |||||
| { | |||||
| // Checking that we are in pose mode - particularly important for rigs | |||||
| if (ob->mode & OB_MODE_POSE) { | |||||
| bPoseChannel *posebone = CTX_data_active_pose_bone(C); | |||||
| if (!(posebone)) { | |||||
| return; | |||||
swerner: This results in a compile error for me:
"Non-void function 'calc_manipulator_stats' should… | |||||
| } | |||||
| // For god node (bottom of hierarchy) | |||||
| if (!posebone->parent) | |||||
| { | |||||
| // Works like local | |||||
| copy_m4_m4(rv3d->twmat, ob->obmat); | |||||
| normalize_m4(rv3d->twmat); | |||||
| break; | |||||
| } | |||||
| float mat[3][3]; // Final matrix that will be put in twmat for the region view | |||||
| BKE_pose_computing_pchan_rest(posebone, mat); | |||||
| copy_m4_m3(rv3d->twmat, mat); | |||||
| break; | |||||
| } | |||||
| // This is for regular non-rig objects | |||||
| if (is_zero_v3(ob->rot)) { | |||||
| copy_m4_m4(rv3d->twmat, ob->obmat); | |||||
| } | |||||
| else { | |||||
| float mfm[4][4]; // My final Matrix | |||||
| BKE_object_computing_obmat_rest(ob, mfm); | |||||
| copy_m4_m4(rv3d->twmat, mfm); | |||||
| } | |||||
| normalize_m4(rv3d->twmat); | |||||
| break; | |||||
| } | |||||
| default: /* V3D_MANIP_CUSTOM */ | default: /* V3D_MANIP_CUSTOM */ | ||||
| { | { | ||||
| float mat[3][3]; | float mat[3][3]; | ||||
| if (applyTransformOrientation(C, mat, NULL, v3d->twmode - V3D_MANIP_CUSTOM)) { | if (applyTransformOrientation(C, mat, NULL, v3d->twmode - V3D_MANIP_CUSTOM)) { | ||||
| copy_m4_m3(rv3d->twmat, mat); | copy_m4_m3(rv3d->twmat, mat); | ||||
| } | } | ||||
| break; | break; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 1,312 Lines • Show Last 20 Lines | |||||
This results in a compile error for me:
"Non-void function 'calc_manipulator_stats' should return a value"