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:
Diffstat (limited to 'source/blender/editors/transform/transform_orientations.c')
-rw-r--r--source/blender/editors/transform/transform_orientations.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c
index 6d5138ff11a..e5b8d59d515 100644
--- a/source/blender/editors/transform/transform_orientations.c
+++ b/source/blender/editors/transform/transform_orientations.c
@@ -915,9 +915,20 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3],
}
}
- VECCOPY(normal, ob->obmat[2]);
- VECCOPY(plane, ob->obmat[1]);
- result = ORIENTATION_NORMAL;
+ if (!ob) {
+ normal[0] = 0.0f;
+ normal[1] = 0.0f;
+ normal[2] = 1.0f;
+ plane[0] = 1.0f;
+ plane[1] = 0.0f;
+ plane[2] = 0.0f;
+
+ result = ORIENTATION_NORMAL;
+ } else {
+ VECCOPY(normal, ob->obmat[2]);
+ VECCOPY(plane, ob->obmat[1]);
+ result = ORIENTATION_NORMAL;
+ }
}
return result;