Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/transform/transform.c
| Context not available. | |||||
| #include "DNA_movieclip_types.h" | #include "DNA_movieclip_types.h" | ||||
| #include "DNA_scene_types.h" /* PET modes */ | #include "DNA_scene_types.h" /* PET modes */ | ||||
| #include "DNA_workspace_types.h" | #include "DNA_workspace_types.h" | ||||
| #include "DNA_gpencil_types.h" | |||||
| #include "BLI_alloca.h" | #include "BLI_alloca.h" | ||||
| #include "BLI_utildefines.h" | #include "BLI_utildefines.h" | ||||
| Context not available. | |||||
| Object *ob = t->poseobj; | Object *ob = t->poseobj; | ||||
| if (ob) mul_m4_v3(ob->obmat, vecrot); | if (ob) mul_m4_v3(ob->obmat, vecrot); | ||||
| } | } | ||||
| else if ((t->flag & T_POINTS) && (t->options & CTX_GPENCIL_STROKES)) { | |||||
| Object *ob = t->obedit; | |||||
| if ((ob) && (ob->type == OB_GPENCIL)) { | |||||
| mul_m4_v3(ob->obmat, vecrot); | |||||
| } | |||||
| } | |||||
| projectFloatViewEx(t, vecrot, cent, V3D_PROJ_TEST_CLIP_ZERO); | projectFloatViewEx(t, vecrot, cent, V3D_PROJ_TEST_CLIP_ZERO); | ||||
| Context not available. | |||||
| else | else | ||||
| sub_v3_v3(vec, td->center); | sub_v3_v3(vec, td->center); | ||||
| mul_v3_fl(vec, td->factor); | /* grease pencil falloff */ | ||||
| if (t->options & CTX_GPENCIL_STROKES) { | |||||
| bGPDstroke *gps = (bGPDstroke *)td->extra; | |||||
| mul_v3_fl(vec, td->factor * gps->falloff); | |||||
| /* scale stroke thickness */ | |||||
| if (td->val) { | |||||
| float ratio = t->values[0]; | |||||
| snapGridIncrement(t, &ratio); | |||||
| applyNumInput(&t->num, &ratio); | |||||
| t->values[0] = ratio; | |||||
| *td->val = td->ival * ratio * gps->falloff; | |||||
| CLAMP_MIN(*td->val, 0.001f); | |||||
| } | |||||
| } | |||||
| else { | |||||
| mul_v3_fl(vec, td->factor); | |||||
| } | |||||
| if (t->flag & (T_OBJECT | T_POSE)) { | if (t->flag & (T_OBJECT | T_POSE)) { | ||||
| mul_m3_v3(td->smtx, vec); | mul_m3_v3(td->smtx, vec); | ||||
| Context not available. | |||||
| if (t->flag & T_POINTS) { | if (t->flag & T_POINTS) { | ||||
| mul_m3_m3m3(totmat, mat, td->mtx); | mul_m3_m3m3(totmat, mat, td->mtx); | ||||
| mul_m3_m3m3(smat, td->smtx, totmat); | mul_m3_m3m3(smat, td->smtx, totmat); | ||||
| /* apply gpencil falloff */ | |||||
| if (t->options & CTX_GPENCIL_STROKES) { | |||||
| bGPDstroke *gps = (bGPDstroke *)td->extra; | |||||
| float sx = smat[0][0]; | |||||
| float sy = smat[1][1]; | |||||
| float sz = smat[2][2]; | |||||
| mul_m3_fl(smat, gps->falloff); | |||||
| /* fix scale */ | |||||
| smat[0][0] = sx; | |||||
| smat[1][1] = sy; | |||||
| smat[2][2] = sz; | |||||
| } | |||||
| sub_v3_v3v3(vec, td->iloc, center); | sub_v3_v3v3(vec, td->iloc, center); | ||||
| mul_m3_v3(smat, vec); | mul_m3_v3(smat, vec); | ||||
| Context not available. | |||||
| } | } | ||||
| mul_m3_v3(td->smtx, tvec); | mul_m3_v3(td->smtx, tvec); | ||||
| mul_v3_fl(tvec, td->factor); | /* grease pencil falloff */ | ||||
| if (t->options & CTX_GPENCIL_STROKES) { | |||||
| bGPDstroke *gps = (bGPDstroke *)td->extra; | |||||
| mul_v3_fl(tvec, td->factor * gps->falloff); | |||||
| } | |||||
| else { | |||||
| mul_v3_fl(tvec, td->factor); | |||||
| } | |||||
| protectedTransBits(td->protectflag, tvec); | protectedTransBits(td->protectflag, tvec); | ||||
| Context not available. | |||||