Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2005-10-30 00:08:25 +0400
committerTon Roosendaal <ton@blender.org>2005-10-30 00:08:25 +0400
commit4ad59e30a05f10355cf88d8e94dfd51bfbc66ca5 (patch)
tree8d46097ebf547b82ac91be22370fa5799cd6c010 /source/blender/src/transform_conversions.c
parent872b2a03e3ec88016675c1f1fc06a273d387013b (diff)
New: Write Protection for transform values.
You now can set, in NKEY Transform Properties Panel, per XYZ rot/loc/size, a protection for Transform tools to not change these values anymore. This now works for Objects or for Bones in PoseMode. Usage is especially for character animation, to give Bones in a Pose defaults for rotation axes, so you don't have to worry about the correct limitations (or setup complex IK limits). Of course, this feature doesn't influence the animation system. As an extra also the Transform Widgets then draw less handles. Note this is based on the actual locked value, and depends still on Manipulator orientation whether it can be used really. Implementation warning: I had to remove the 'return' in the middle of the editobject.c compatible_eul() call. It now makes nice compatible eulers when they're simple (single axis rotations). Unfortunately there was no note in the code why it was ever removed... ALso: fix for crash in using Crease Transform and Mirror modifier.
Diffstat (limited to 'source/blender/src/transform_conversions.c')
-rwxr-xr-xsource/blender/src/transform_conversions.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/source/blender/src/transform_conversions.c b/source/blender/src/transform_conversions.c
index 529f2a7bc2b..1b79da4f703 100755
--- a/source/blender/src/transform_conversions.c
+++ b/source/blender/src/transform_conversions.c
@@ -411,6 +411,7 @@ static int add_pose_transdata(TransInfo *t, bPoseChannel *pchan, Object *ob, Tra
td->ob = ob;
td->flag= TD_SELECTED|TD_USEQUAT;
+ td->protectflag= pchan->protectflag;
td->loc = pchan->loc;
VECCOPY(td->iloc, pchan->loc);
@@ -547,7 +548,7 @@ static void createTransArmatureVerts(TransInfo *t)
Mat3CpyMat4(mtx, G.obedit->obmat);
Mat3Inv(smtx, mtx);
- td = t->data = MEM_mallocN(t->total*sizeof(TransData), "TransEditBone");
+ td = t->data = MEM_callocN(t->total*sizeof(TransData), "TransEditBone");
for (ebo=G.edbo.first;ebo;ebo=ebo->next){
@@ -677,8 +678,8 @@ static void createTransMBallVerts(TransInfo *t)
if(propmode) t->total = count;
else t->total = countsel;
- td = t->data= MEM_mallocN(t->total*sizeof(TransData), "TransObData(MBall EditMode)");
- tx = t->ext = MEM_mallocN(t->total*sizeof(TransDataExtension), "MetaElement_TransExtension");
+ td = t->data= MEM_callocN(t->total*sizeof(TransData), "TransObData(MBall EditMode)");
+ tx = t->ext = MEM_callocN(t->total*sizeof(TransDataExtension), "MetaElement_TransExtension");
Mat3CpyMat4(mtx, G.obedit->obmat);
Mat3Inv(smtx, mtx);
@@ -809,7 +810,7 @@ static void createTransCurveVerts(TransInfo *t)
if(propmode) t->total = count;
else t->total = countsel;
- t->data= MEM_mallocN(t->total*sizeof(TransData), "TransObData(Curve EditMode)");
+ t->data= MEM_callocN(t->total*sizeof(TransData), "TransObData(Curve EditMode)");
Mat3CpyMat4(mtx, G.obedit->obmat);
Mat3Inv(smtx, mtx);
@@ -942,7 +943,7 @@ static void createTransLatticeVerts(TransInfo *t)
if(propmode) t->total = count;
else t->total = countsel;
- t->data= MEM_mallocN(t->total*sizeof(TransData), "TransObData(Lattice EditMode)");
+ t->data= MEM_callocN(t->total*sizeof(TransData), "TransObData(Lattice EditMode)");
Mat3CpyMat4(mtx, G.obedit->obmat);
Mat3Inv(smtx, mtx);
@@ -1245,7 +1246,7 @@ static void createTransEditVerts(TransInfo *t)
nears = (EditVert**)MEM_mallocN(t->total * sizeof(EditVert*), "scratch nears");
}
else t->total = countsel;
- tob= t->data= MEM_mallocN(t->total*sizeof(TransData), "TransObData(Mesh EditMode)");
+ tob= t->data= MEM_callocN(t->total*sizeof(TransData), "TransObData(Mesh EditMode)");
Mat3CpyMat4(mtx, G.obedit->obmat);
Mat3Inv(smtx, mtx);
@@ -1382,7 +1383,7 @@ static void createTransUVs(TransInfo *t)
if (countsel==0) return;
t->total= (propmode)? count: countsel;
- t->data= MEM_mallocN(t->total*sizeof(TransData), "TransObData(UV Editing)");
+ t->data= MEM_callocN(t->total*sizeof(TransData), "TransObData(UV Editing)");
/* for each 2d uv coord a 3d vector is allocated, so that they can be
treated just as if they were 3d verts */
t->data2d= MEM_mallocN(t->total*sizeof(TransData2D), "TransObData2D(UV Editing)");
@@ -1877,6 +1878,7 @@ static void createTransObject(TransInfo *t)
ob= base->object;
td->flag= TD_SELECTED;
+ td->protectflag= ob->protectflag;
td->ext = tx;
/* store ipo keys? */