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:
authorMartin Poirier <theeth@yahoo.com>2011-03-28 02:15:37 +0400
committerMartin Poirier <theeth@yahoo.com>2011-03-28 02:15:37 +0400
commit84befe2056a8ae03d38ab539b26f1638bdcbd41c (patch)
treef7dad6d5ba71e7a726493b39af10032b7b1a88fa /source/blender/editors/transform/transform.c
parent3c67374f50ef5da6745ca78eaf3b6b20e658383a (diff)
[#26622] Blender crashes when calling transform operator
Add cancellation checks for time* transforms that only run in specific spaces. Hide Transform Mode operator property (it shouldn't be modified after the operator is run), made default mode Translate, not the useless Dummy.
Diffstat (limited to 'source/blender/editors/transform/transform.c')
-rw-r--r--source/blender/editors/transform/transform.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index 0a055358902..3ec7e6eec2c 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -1650,11 +1650,6 @@ int initTransform(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event, int
break;
case TFM_EDGE_SLIDE:
initEdgeSlide(t);
- if(t->state == TRANS_CANCEL)
- {
- postTrans(C, t);
- return 0;
- }
break;
case TFM_BONE_ROLL:
initBoneRoll(t);
@@ -1709,6 +1704,13 @@ int initTransform(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event, int
break;
}
+ if(t->state == TRANS_CANCEL)
+ {
+ postTrans(C, t);
+ return 0;
+ }
+
+
/* overwrite initial values if operator supplied a non-null vector */
if (RNA_property_is_set(op->ptr, "value"))
{
@@ -5515,6 +5517,11 @@ static void doAnimEdit_SnapFrame(TransInfo *t, TransData *td, TransData2D *td2d,
void initTimeTranslate(TransInfo *t)
{
+ /* this tool is only really available in the Action Editor... */
+ if (t->spacetype != SPACE_ACTION) {
+ t->state = TRANS_CANCEL;
+ }
+
t->mode = TFM_TIME_TRANSLATE;
t->transform = TimeTranslate;
@@ -5663,8 +5670,11 @@ void initTimeSlide(TransInfo *t)
/* set flag for drawing stuff */
saction->flag |= SACTION_MOVING;
+ } else {
+ t->state = TRANS_CANCEL;
}
+
t->mode = TFM_TIME_SLIDE;
t->transform = TimeSlide;
t->flag |= T_FREE_CUSTOMDATA;
@@ -5789,6 +5799,11 @@ void initTimeScale(TransInfo *t)
{
int center[2];
+ /* this tool is only really available in the Action Editor... */
+ if (t->spacetype != SPACE_ACTION) {
+ t->state = TRANS_CANCEL;
+ }
+
t->mode = TFM_TIME_SCALE;
t->transform = TimeScale;