[Bf-blender-cvs] [3431f1844ff] temp-gpencil-bezier-stroke-type: Fix unreported: Flat Surface objects

Germano Cavalcante noreply at git.blender.org
Tue Apr 13 11:29:18 CEST 2021


Commit: 3431f1844ff51d83a1b38c7fa0290f3db5de3576
Author: Germano Cavalcante
Date:   Mon Apr 12 11:08:44 2021 -0300
Branches: temp-gpencil-bezier-stroke-type
https://developer.blender.org/rB3431f1844ff51d83a1b38c7fa0290f3db5de3576

Fix unreported: Flat Surface objects

Before rBf674976edd88, the flag indicating whether a curve was 2D or 3D was
ignored by Surfaces objects.

So it can be said that Surfaces objects were always 3D.

We could remove updates to 2D on Surface objects, so the behavior is
identical to what it was before.

But this would also cause the return of `data.dimensions` to be misleading,
complicate the code a bit and add a micro overhead.

So the solution here is just to init all Surface objects as 3D.

Surface objects can now be constrained to 2D with the command:
```
data.dimensions = '2D'
```

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

M	source/blender/blenkernel/intern/curve.c

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

diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c
index 95c242c31b2..f7eca689241 100644
--- a/source/blender/blenkernel/intern/curve.c
+++ b/source/blender/blenkernel/intern/curve.c
@@ -414,6 +414,7 @@ void BKE_curve_init(Curve *cu, const short curve_type)
     cu->tb[0].w = cu->tb[0].h = 0.0;
   }
   else if (cu->type == OB_SURF) {
+    cu->flag |= CU_3D;
     cu->resolv = 4;
   }
   cu->bevel_profile = NULL;



More information about the Bf-blender-cvs mailing list