[Bf-blender-cvs] [38430c384a2] blender-v3.4-release: Fix: Curves sculptmode: paintcurve stroke points cannot be transformed

Philipp Oeser noreply at git.blender.org
Fri Nov 11 13:26:57 CET 2022


Commit: 38430c384a29b8fc900eef839c2dd307d0d96ea4
Author: Philipp Oeser
Date:   Fri Nov 11 13:05:47 2022 +0100
Branches: blender-v3.4-release
https://developer.blender.org/rB38430c384a29b8fc900eef839c2dd307d0d96ea4

Fix: Curves sculptmode: paintcurve stroke points cannot be transformed

As part of rB3f91540cef7e, we already made `OB_MODE_SCULPT_CURVES` to be
allowed in `paint_curve_poll` (alongside `OB_MODE_ALL_PAINT`).
Now, to get the paintcurves transform systems to work with curves
sculptmode as well, we introduce this "additional case" in the
appropriate place in the transform system as well.

NOTE: as a next step, considering `OB_MODE_SCULPT_CURVES` to be
generally part of `OB_MODE_ALL_PAINT` is to be done (this might fix
another couple of bugs, but also has to be carefully checked in many
places, so this patch is just fixing this very specific case)

Fixes T102204.

Maniphest Tasks: T102204

Differential Revision: https://developer.blender.org/D16466

===================================================================

M	source/blender/editors/transform/transform_convert.c
M	source/blender/editors/transform/transform_generics.c

===================================================================

diff --git a/source/blender/editors/transform/transform_convert.c b/source/blender/editors/transform/transform_convert.c
index a5b2442f11c..d71a3897cbc 100644
--- a/source/blender/editors/transform/transform_convert.c
+++ b/source/blender/editors/transform/transform_convert.c
@@ -1109,7 +1109,7 @@ static TransConvertTypeInfo *convert_type_get(const TransInfo *t, Object **r_obj
       PE_start_edit(PE_get_current(t->depsgraph, t->scene, ob))) {
     return &TransConvertType_Particle;
   }
-  if (ob && (ob->mode & OB_MODE_ALL_PAINT)) {
+  if (ob && ((ob->mode & OB_MODE_ALL_PAINT) || (ob->mode & OB_MODE_SCULPT_CURVES))) {
     if ((t->options & CTX_PAINT_CURVE) && !ELEM(t->mode, TFM_SHEAR, TFM_SHRINKFATTEN)) {
       return &TransConvertType_PaintCurve;
     }
diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c
index e1f93bf881b..e7ef408b848 100644
--- a/source/blender/editors/transform/transform_generics.c
+++ b/source/blender/editors/transform/transform_generics.c
@@ -309,7 +309,7 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve
       t->flag |= T_V3D_ALIGN;
     }
 
-    if (object_mode & OB_MODE_ALL_PAINT) {
+    if ((object_mode & OB_MODE_ALL_PAINT) || (object_mode & OB_MODE_SCULPT_CURVES)) {
       Paint *p = BKE_paint_get_active_from_context(C);
       if (p && p->brush && (p->brush->flag & BRUSH_CURVE)) {
         t->options |= CTX_PAINT_CURVE;



More information about the Bf-blender-cvs mailing list