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:
authorGermano Cavalcante <germano.costa@ig.com.br>2020-12-28 22:19:23 +0300
committerGermano Cavalcante <germano.costa@ig.com.br>2020-12-28 22:19:37 +0300
commit1db27af38f6c9d2fb331954e29080bf3b902a531 (patch)
treeba3241c24ba2ba4822b53f6adc3b823348e7d805
parent6fbeb6e2e05408af448e9409f8e7e11470f82db6 (diff)
Fix T84200: Rotating a paintcurve [all paintmodes] doesn’t work correctly
The transform code did not provide a 2d context to be used in 3d space. The solution is to set all matrices for the screen space in these cases. This commit also removes the dial3d drawing in these cases. It was not correct anyway.
-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)