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:
-rw-r--r--source/blender/editors/transform/transform.c3
-rw-r--r--source/blender/editors/transform/transform_gizmo_3d.c5
-rw-r--r--source/blender/editors/transform/transform_orientations.c36
3 files changed, 32 insertions, 12 deletions
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index 2b56b30be90..fa1b29ac540 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -85,7 +85,8 @@ bool transdata_check_local_islands(TransInfo *t, short around)
void setTransformViewMatrices(TransInfo *t)
{
- if (t->spacetype == SPACE_VIEW3D && t->region && t->region->regiontype == RGN_TYPE_WINDOW) {
+ if (!(t->options & CTX_PAINT_CURVE) && (t->spacetype == SPACE_VIEW3D) && t->region &&
+ (t->region->regiontype == RGN_TYPE_WINDOW)) {
RegionView3D *rv3d = t->region->regiondata;
copy_m4_m4(t->viewmat, rv3d->viewmat);
diff --git a/source/blender/editors/transform/transform_gizmo_3d.c b/source/blender/editors/transform/transform_gizmo_3d.c
index 37fd8bb63c1..3c82365fdb4 100644
--- a/source/blender/editors/transform/transform_gizmo_3d.c
+++ b/source/blender/editors/transform/transform_gizmo_3d.c
@@ -1298,6 +1298,11 @@ static void gizmo_xform_message_subscribe(wmGizmoGroup *gzgroup,
void drawDial3d(const TransInfo *t)
{
if (t->mode == TFM_ROTATION && t->spacetype == SPACE_VIEW3D) {
+ if (t->options & CTX_PAINT_CURVE) {
+ /* Matrices are in the screen space. Not supported. */
+ return;
+ }
+
wmGizmo *gz = wm_gizmomap_modal_get(t->region->gizmo_map);
if (gz == NULL) {
/* We only draw Dial3d if the operator has been called by a gizmo. */
diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c
index 031cff72095..606862f05aa 100644
--- a/source/blender/editors/transform/transform_orientations.c
+++ b/source/blender/editors/transform/transform_orientations.c
@@ -602,20 +602,34 @@ short transform_orientation_matrix_get(
orientation = V3D_ORIENT_CUSTOM;
}
- if ((t->spacetype == SPACE_VIEW3D) && (t->region->regiontype == RGN_TYPE_WINDOW)) {
+ if ((t->spacetype == SPACE_VIEW3D) && t->region && (t->region->regiontype == RGN_TYPE_WINDOW)) {
rv3d = t->region->regiondata;
}
- return ED_transform_calc_orientation_from_type_ex(C,
- r_spacemtx,
- /* extra args (can be accessed from context) */
- scene,
- rv3d,
- ob,
- obedit,
- orientation,
- orientation_index_custom,
- t->around);
+ short orient_type = ED_transform_calc_orientation_from_type_ex(
+ C,
+ r_spacemtx,
+ /* extra args (can be accessed from context) */
+ scene,
+ rv3d,
+ ob,
+ obedit,
+ orientation,
+ orientation_index_custom,
+ t->around);
+
+ if (rv3d && (t->options & CTX_PAINT_CURVE)) {
+ /* Screen space in the 3d region. */
+ if (orient_type == V3D_ORIENT_VIEW) {
+ unit_m3(r_spacemtx);
+ }
+ else {
+ mul_m3_m4m3(r_spacemtx, rv3d->viewmat, r_spacemtx);
+ normalize_m3(r_spacemtx);
+ }
+ }
+
+ return orient_type;
}
const char *transform_orientations_spacename_get(TransInfo *t, const short orient_type)