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:
authorBastien Montagne <montagne29@wanadoo.fr>2015-06-17 13:30:30 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2015-06-17 13:30:30 +0300
commit3b57f075a8031d2fc0e58f4f28ed060832065b0b (patch)
tree38afbc37c5e2b442b79123b911601faced3be8b7 /source/blender/editors/transform/transform.c
parente0ae59f5d892a2c69cb9f7740be589c9521c2a6d (diff)
Fix (unreported) redo of 'bone envelope distance resize' transform op not working
(it would behave like 'bone envelope resize' instead). Issue comes from the fact this transform op shares some common points with both BoneResize and BoneEnvelope operations. However, trying to re-use `TFM_BONE_ENVELOPE` itself in this case is bad idea, since this mode gets stored in transform op and is directly re-used for redo, by-passing the whole init phase that shall be done in `TFM_BONESIZE` mode... So now, we add a real new mode, `TFM_BONE_ENVELOPE_DIST`, while keeping most of existing code and all existing behavior. This is slightly hackish - but was already anyway, and avoids creating a full new set of function for pretty much the same thing. As a side note, also makes it possible to resize envelope distance outside of envelope viewing mode (from py or by adding a custom shortcut).
Diffstat (limited to 'source/blender/editors/transform/transform.c')
-rw-r--r--source/blender/editors/transform/transform.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index 193969ffb72..3a8e7cfa91a 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -2220,15 +2220,22 @@ bool initTransform(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve
case TFM_BONESIZE:
{ /* used for both B-Bone width (bonesize) as for deform-dist (envelope) */
bArmature *arm = t->poseobj->data;
- if (arm->drawtype == ARM_ENVELOPE)
+ if (arm->drawtype == ARM_ENVELOPE) {
initBoneEnvelope(t);
- else
+ t->mode = TFM_BONE_ENVELOPE_DIST;
+ }
+ else {
initBoneSize(t);
+ }
break;
}
case TFM_BONE_ENVELOPE:
initBoneEnvelope(t);
break;
+ case TFM_BONE_ENVELOPE_DIST:
+ initBoneEnvelope(t);
+ t->mode = TFM_BONE_ENVELOPE_DIST;
+ break;
case TFM_EDGE_SLIDE:
{
const bool use_double_side = (op ? !RNA_boolean_get(op->ptr, "single_side") : true);