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:
authorCampbell Barton <campbell@blender.org>2022-06-24 10:45:07 +0300
committerCampbell Barton <campbell@blender.org>2022-06-24 15:16:47 +0300
commit77eadbede493cb2a02b82981ad71af3da86b2d0c (patch)
tree19a929e230816b7254d93d0723b01d7f514533f2 /source/blender/editors/transform/transform_mode_rotate.c
parent585d81ba2b77371bf7ada99e7d4bab8bfd7be52f (diff)
Fix T99037: bpy.ops.transform.rotate fails in background mode
This reverts commit c503c5f756aab850e8afe2513b2dc7b645cf84af, alternate fix for T82244. Scripts that run in background mode expected rotation to be usable, defaulting to the 3D viewport when there is no active windowing data. Also resolves T88610.
Diffstat (limited to 'source/blender/editors/transform/transform_mode_rotate.c')
-rw-r--r--source/blender/editors/transform/transform_mode_rotate.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/editors/transform/transform_mode_rotate.c b/source/blender/editors/transform/transform_mode_rotate.c
index 94caaa288e5..f75c65448df 100644
--- a/source/blender/editors/transform/transform_mode_rotate.c
+++ b/source/blender/editors/transform/transform_mode_rotate.c
@@ -11,6 +11,7 @@
#include "BLI_task.h"
#include "BKE_context.h"
+#include "BKE_report.h"
#include "BKE_unit.h"
#include "ED_screen.h"
@@ -343,6 +344,11 @@ static void applyRotationMatrix(TransInfo *t, float mat_xform[4][4])
void initRotation(TransInfo *t)
{
+ if (t->spacetype == SPACE_ACTION) {
+ BKE_report(t->reports, RPT_ERROR, "Rotation is not supported in the Dope Sheet Editor");
+ t->state = TRANS_CANCEL;
+ }
+
t->mode = TFM_ROTATION;
t->transform = applyRotation;
t->transform_matrix = applyRotationMatrix;