[Bf-blender-cvs] [ba75af3] PSketch: PSculpt: Trackball tweaks
Joshua Leung
noreply at git.blender.org
Sun Jan 31 14:28:54 CET 2016
Commit: ba75af31c13c10d2eec52f767e87ca269e6272d4
Author: Joshua Leung
Date: Wed Jan 13 21:46:46 2016 +1300
Branches: PSketch
https://developer.blender.org/rBba75af31c13c10d2eec52f767e87ca269e6272d4
PSculpt: Trackball tweaks
* Respect locks for location
* Stub in the proper logic for handling transform centers
===================================================================
M source/blender/editors/armature/pose_sculpt.c
===================================================================
diff --git a/source/blender/editors/armature/pose_sculpt.c b/source/blender/editors/armature/pose_sculpt.c
index ffc2360..f9af94a 100644
--- a/source/blender/editors/armature/pose_sculpt.c
+++ b/source/blender/editors/armature/pose_sculpt.c
@@ -345,6 +345,7 @@ static void pchan_do_trackball_rotate(Object *ob, bPoseChannel *pchan, float mat
{
float mtx[3][3], smtx[3][3], r_mtx[3][3], r_smtx[3][3], l_smtx[3][3];
//float center[3] = {0}, td_center[3] = {0};
+ short locks = pchan->protectflag;
short td_flag = 0;
float pmtx[3][3], imtx[3][3];
@@ -352,8 +353,11 @@ static void pchan_do_trackball_rotate(Object *ob, bPoseChannel *pchan, float mat
/* ...... transform_conversions.c stuff here ........ */
// TODO: maybe this stuff can (or maybe should - to prevent errors) be saved off?
- // xxx: refactor this out
- //copy_v3_v3(td_center, pchan->pose_mat[3]);
+ // copy_v3_v3(td_center, pchan->pose_mat[3]);
+ // if (localspace)
+ // copy_v3_v3(center, td_center);
+ // else
+ // copy_v3_v3(center, bones.center);
/* Compute the transform matrices needed */
/* New code, using "generic" BKE_pchan_to_pose_mat(). */
@@ -437,7 +441,9 @@ static void pchan_do_trackball_rotate(Object *ob, bPoseChannel *pchan, float mat
mul_m3_v3(smtx, vec); /* To Pose space */
}
- //protectedTransBits(td->protectflag, vec);
+ if (locks & OB_LOCK_LOCX) vec[0] = 0.0f;
+ if (locks & OB_LOCK_LOCY) vec[1] = 0.0f;
+ if (locks & OB_LOCK_LOCZ) vec[2] = 0.0f;
//add_v3_v3v3(td->loc, td->iloc, vec);
add_v3_v3(pchan->loc, vec);
More information about the Bf-blender-cvs
mailing list