[Bf-blender-cvs] [486627215cb] sculpt-dev: Fix macro problem with clang/gcc

Joseph Eagar noreply at git.blender.org
Tue Sep 28 20:36:13 CEST 2021


Commit: 486627215cb18e22b3c65f9f370f2c1bf1adbd35
Author: Joseph Eagar
Date:   Tue Sep 28 11:35:51 2021 -0700
Branches: sculpt-dev
https://developer.blender.org/rB486627215cb18e22b3c65f9f370f2c1bf1adbd35

Fix macro problem with clang/gcc

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

M	source/blender/blenkernel/BKE_brush_engine.h
M	source/blender/blenkernel/intern/brush_channel_define.h
M	source/blender/blenkernel/intern/brush_engine_presets.c

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

diff --git a/source/blender/blenkernel/BKE_brush_engine.h b/source/blender/blenkernel/BKE_brush_engine.h
index bf7a38ee14e..d0e833673f1 100644
--- a/source/blender/blenkernel/BKE_brush_engine.h
+++ b/source/blender/blenkernel/BKE_brush_engine.h
@@ -162,7 +162,7 @@ void BKE_brush_tex_patch_channels(BrushTex *btex);
 void BKE_brush_tex_from_mtex(BrushTex *btex, MTex *mtex);
 
 // initializes the internal mtex struct
-void BKE_brush_tex_start(BrushTex *btex, BrushChannelSet *chset);
+void BKE_brush_tex_start(BrushTex *btex, BrushChannelSet *chset, BrushMappingData *mapdata);
 
 #define MAKE_BRUSHTEX_SLOTS 5
 
diff --git a/source/blender/blenkernel/intern/brush_channel_define.h b/source/blender/blenkernel/intern/brush_channel_define.h
index 88b287b8175..c89c63e1b03 100644
--- a/source/blender/blenkernel/intern/brush_channel_define.h
+++ b/source/blender/blenkernel/intern/brush_channel_define.h
@@ -102,19 +102,16 @@ places in rna_engine_codebase are relevent:
 #  define MAKE_FLOAT3(idname, name, tooltip, x, y, z, min, max) MAKE_BUILTIN_CH_DEF(idname);
 #  define MAKE_FLOAT3_EX(idname, name, tooltip, x, y, z, min, max, smin, smax, flag) \
     MAKE_BUILTIN_CH_DEF(idname);
-#  define MAKE_ENUM(idname1, name1, tooltip1, value1, enumdef1) MAKE_BUILTIN_CH_DEF(idname1);
-#  define MAKE_ENUM_EX(idname1, name1, tooltip1, value1, enumdef1, flag) \
+#  define MAKE_ENUM(idname1, name1, tooltip1, value1, enumdef1, ...) MAKE_BUILTIN_CH_DEF(idname1);
+#  define MAKE_ENUM_EX(idname1, name1, tooltip1, value1, flag1, enumdef1, ...) \
     MAKE_BUILTIN_CH_DEF(idname1);
-#  define MAKE_FLAGS(idname1, name1, tooltip1, value1, enumdef1) MAKE_BUILTIN_CH_DEF(idname1);
-#  define MAKE_FLAGS_EX(idname1, name1, tooltip1, value1, enumdef1, flag1) \
+#  define MAKE_FLAGS(idname1, name1, tooltip1, value1, enumdef1, ...) MAKE_BUILTIN_CH_DEF(idname1);
+#  define MAKE_FLAGS_EX(idname1, name1, tooltip1, value1, flag1, enumdef1, ...) \
     MAKE_BUILTIN_CH_DEF(idname1);
 #  define MAKE_CURVE(idname1, name1, tooltip1, preset1) MAKE_BUILTIN_CH_DEF(idname1);
 #else
 #endif
 
-// annoying trick to pass array initializers through macro arguments
-#define _(...) __VA_ARGS__
-
 /* clang-format off */
   MAKE_FLOAT_EX(radius, "Radius", "Radius of the brush in pixels", 50.0f, 0.5f, MAX_BRUSH_PIXEL_RADIUS*10, 0.5, MAX_BRUSH_PIXEL_RADIUS, false)
   MAKE_FLOAT_EX(strength, "Strength", "How powerful the effect of the brush is when applied", 0.5f, 0.0f, 10.0f, 0.0f, 1.0f, false)
@@ -138,15 +135,15 @@ places in rna_engine_codebase are relevent:
   MAKE_BOOL(autosmooth_use_spacing, "Use Auto-Smooth Spacing", "Use custom spacing for autosmooth", false)
   MAKE_FLOAT_EX(topology_rake_spacing, "Rake Spacing", "Topology rake stroke spacing", 13.0f, 0.05f, 1000.0f, 0.1f, 300.0f, false)
   MAKE_FLOAT_EX(autosmooth_spacing, "Auto-Smooth Spacing", "Autosmooth stroke spacing", 13.0f, 0.05f, 1000.0f, 0.1f, 300.0f, false)
-  MAKE_ENUM(topology_rake_mode, "Topology Rake Mode", "", 1, _({
+  MAKE_ENUM(topology_rake_mode, "Topology Rake Mode", "", 1, {
       {0, "BRUSH_DIRECTION", ICON_NONE, "Stroke", "Stroke Direction"},
       {1, "CURVATURE", ICON_NONE, "Curvature", "Follow mesh curvature"},
-      {-1},
-  }))
+      {-1}
+  })
 
   MAKE_FLOAT_EX_EX(smooth_strength_factor, "Smooth Strength", "Factor to control the strength of shift-smooth", 0.1f, 0.0f, 10.0f, 0.0f, 2.0f, false, false, BRUSH_CHANNEL_INHERIT)
 
-  MAKE_FLAGS_EX(automasking, "Automasking", "", 0, _({
+  MAKE_FLAGS_EX(automasking, "Automasking", "", 0, BRUSH_CHANNEL_INHERIT_IF_UNSET, {\
          {BRUSH_AUTOMASKING_BOUNDARY_EDGES, "BOUNDARY_EDGE", ICON_NONE, "Boundary Edges", ""},
          {BRUSH_AUTOMASKING_BOUNDARY_FACE_SETS, "BOUNDARY_FACE_SETS", ICON_NONE, "Boundary Face Sets", ""},
          {BRUSH_AUTOMASKING_CONCAVITY, "CONCAVITY", ICON_NONE, "Cavity", ""},
@@ -154,33 +151,33 @@ places in rna_engine_codebase are relevent:
          {BRUSH_AUTOMASKING_FACE_SETS, "FACE_SETS", ICON_NONE, "Face Sets", ""},
          {BRUSH_AUTOMASKING_TOPOLOGY, "TOPOLOGY", ICON_NONE, "Topology", ""},
          {-1},
-    }), BRUSH_CHANNEL_INHERIT_IF_UNSET)
+    })
 
   MAKE_BOOL_EX(dyntopo_disabled, "Disable Dyntopo", "", false, BRUSH_CHANNEL_NO_MAPPINGS)
-  MAKE_FLAGS_EX(dyntopo_mode, "Dyntopo Operators", "", DYNTOPO_COLLAPSE|DYNTOPO_CLEANUP|DYNTOPO_SUBDIVIDE, _({
+  MAKE_FLAGS_EX(dyntopo_mode, "Dyntopo Operators", "", DYNTOPO_COLLAPSE|DYNTOPO_CLEANUP|DYNTOPO_SUBDIVIDE, BRUSH_CHANNEL_INHERIT, {\
         {DYNTOPO_COLLAPSE, "COLLAPSE", ICON_NONE, "Collapse", ""},
         {DYNTOPO_SUBDIVIDE, "SUBDIVIDE", ICON_NONE, "Subdivide", ""},
         {DYNTOPO_CLEANUP, "CLEANUP", ICON_NONE, "Cleanup", ""},
         {DYNTOPO_LOCAL_COLLAPSE, "LOCAL_COLLAPSE", ICON_NONE, "Local Collapse", ""},
         {DYNTOPO_LOCAL_SUBDIVIDE, "LOCAL_SUBDIVIDE", ICON_NONE, "Local Subdivide", ""},
         {-1}
-      }), BRUSH_CHANNEL_INHERIT)
-  MAKE_ENUM(slide_deform_type, "Slide Deform Type", "", BRUSH_SLIDE_DEFORM_DRAG, _({
+      })
+  MAKE_ENUM(slide_deform_type, "Slide Deform Type", "", BRUSH_SLIDE_DEFORM_DRAG, {\
        {BRUSH_SLIDE_DEFORM_DRAG, "DRAG", ICON_NONE, "Drag", ""},
        {BRUSH_SLIDE_DEFORM_PINCH, "PINCH", ICON_NONE, "Pinch", ""},
        {BRUSH_SLIDE_DEFORM_EXPAND, "EXPAND", ICON_NONE, "Expand", ""},
        {-1}
-    }))
+    })
   MAKE_FLOAT(normal_radius_factor, "Normal Radius", "Ratio between the brush radius and the radius that is going to be "
                             "used to sample the normal", 0.5f, 0.0f, 1.0f)
   MAKE_FLOAT(hardness, "Hardness", "Brush falloff hardness", 0.0f, 0.0f, 1.0f)
   MAKE_FLOAT(tip_roundness, "Tip Roundness", "", 1.0f, 0.0f, 1.0f)
   MAKE_BOOL(accumulate, "Accumulate", "", false)
-  MAKE_ENUM(direction, "Direction", "", 0, _({
+  MAKE_ENUM(direction, "Direction", "", 0, {\
         {0, "ADD", "ADD", "Add", "Add effect of brush"},
         {1, "SUBTRACT", "REMOVE", "Subtract", "Subtract effect of brush"},
         {-1}
-     }))
+     })
 
 MAKE_FLOAT(normal_weight, "Normal Weight", "", 0.0f, 0.0f, 1.0f)
 MAKE_FLOAT(weight, "Weight", "", 0.5f, 0.0f, 1.0f)
@@ -207,13 +204,13 @@ MAKE_FLOAT_EX_FLAG(dyntopo_detail_range, "Detail Range", "Detail Range", 0.45f,
 MAKE_FLOAT_EX_FLAG(dyntopo_detail_size, "Detail Size", "Detail Size", 8.0f, 0.1f, 100.0f, 0.001f, 500.0f, false, BRUSH_CHANNEL_INHERIT)
 MAKE_FLOAT_EX_FLAG(dyntopo_constant_detail, "Constaint Detail", "", 3.0f, 0.001f, 1000.0f, 0.0001, FLT_MAX, false, BRUSH_CHANNEL_INHERIT)
 MAKE_FLOAT_EX_FLAG(dyntopo_spacing, "Spacing", "Dyntopo Spacing", 35.0f, 0.01f, 300.0f, 0.001f, 50000.0f, false, BRUSH_CHANNEL_INHERIT)
-MAKE_ENUM_EX(dyntopo_detail_mode, "Detail Mode", "", DYNTOPO_DETAIL_RELATIVE, _({
+MAKE_ENUM_EX(dyntopo_detail_mode, "Detail Mode", "", DYNTOPO_DETAIL_RELATIVE, BRUSH_CHANNEL_INHERIT, {\
     {DYNTOPO_DETAIL_RELATIVE, "RELATIVE", "NONE", "Relative", ""},
     {DYNTOPO_DETAIL_CONSTANT, "CONSTANT", "NONE", "Constant", ""},
     {DYNTOPO_DETAIL_MANUAL, "MANUAL", "NONE", "Manual", ""},
     {DYNTOPO_DETAIL_BRUSH, "BRUSH", "NONE", "Brush", ""},
     {-1}
-}), BRUSH_CHANNEL_INHERIT)
+})
 
 MAKE_FLOAT(concave_mask_factor, "Cavity Factor", "", 0.35f, 0.0f, 1.0f)
 MAKE_INT_EX(automasking_boundary_edges_propagation_steps, "Propagation Steps",
@@ -242,7 +239,7 @@ MAKE_BOOL(show_multiplane_scrape_planes_preview, "Show Cursor Preview", "Preview
 MAKE_FLOAT(multiplane_scrape_angle, "Plane Angle", "Angle between the planes of the crease", 60.0f, 0.0f, 160.0f)
 
 MAKE_BOOL(use_persistent, "Persistent", "Sculpt on a persistent layer of the mesh", false)
-MAKE_ENUM(cloth_deform_type, "Deformation", "Deformation type that is used in the brush", BRUSH_CLOTH_DEFORM_DRAG, _({
+MAKE_ENUM(cloth_deform_type, "Deformation", "Deformation type that is used in the brush", BRUSH_CLOTH_DEFORM_DRAG, {\
       {BRUSH_CLOTH_DEFORM_DRAG, "DRAG", "NONE", "Drag", ""},
       {BRUSH_CLOTH_DEFORM_PUSH, "PUSH", "NONE", "Push", ""},
       {BRUSH_CLOTH_DEFORM_PINCH_POINT, "PINCH_POINT", "NONE", "Pinch Point", ""},
@@ -253,9 +250,9 @@ MAKE_ENUM(cloth_deform_type, "Deformation", "Deformation type that is used in th
       {BRUSH_CLOTH_DEFORM_SNAKE_HOOK, "SNAKE_HOOK", "NONE", "Snake Hook", ""},
       {BRUSH_CLOTH_DEFORM_ELASTIC_DRAG, "ELASTIC", "NONE", "Elastic Drag", ""},
       {-1}
-}))
+})
 
-MAKE_ENUM(cloth_simulation_area_type, "Simulation Area", "Part of the mesh that is going to be simulated when the stroke is active", BRUSH_CLOTH_SIMULATION_AREA_DYNAMIC, _({
+MAKE_ENUM(cloth_simulation_area_type, "Simulation Area", "Part of the mesh that is going to be simulated when the stroke is active", BRUSH_CLOTH_SIMULATION_AREA_DYNAMIC, {\
   {BRUSH_CLOTH_SIMULATION_AREA_LOCAL,
     "LOCAL",
     "NONE",
@@ -268,14 +265,14 @@ MAKE_ENUM(cloth_simulation_area_type, "Simulation Area", "Part of the mesh that
     "Dynamic",
     "The active simulation area moves with the brush"},
   {-1}
-}))
+})
 
 MAKE_ENUM(cloth_force_falloff_type, "Force Falloff", "Shape used in the brush to apply force to the cloth",
-  BRUSH_CLOTH_FORCE_FALLOFF_RADIAL, _({
+  BRUSH_CLOTH_FORCE_FALLOFF_RADIAL, {\
       {BRUSH_CLOTH_FORCE_FALLOFF_RADIAL, "RADIAL", "NONE", "Radial", ""},
       {BRUSH_CLOTH_FORCE_FALLOFF_PLANE, "PLANE", "NONE", "Plane", ""},
       {-1}
-}))
+})
 
 MAKE_FLOAT(cloth_mass, "Cloth Mass", "Mass of each simulation particle", 1.0f, 0.0f, 2.0f)
 MAKE_FLOAT(cloth_damping, "Cloth Damping", "How much the applied forces are propagated through the cloth", 0.01f, 0.01f, 1.0f)
@@ -294,7 +291,7 @@ MAKE_BOOL(cloth_pin_simulation_boundary, "Pin Simulation Boundary",
 
 MAKE_FLOAT(boundary_offset, "Boundary Origin Offset",
                            "Offset of the boundary origin in relation to the brush radius", 0.05f, 0.0f, 10.0f)
-MAKE_ENUM(boundary_deform_type, "Deformation", "Deformation type that is used in the brush", BRUSH_BOUNDARY_DEFORM_BEND, _({
+MAKE_ENUM(boundary_deform_type, "Deformation", "Deformation type that is used in the brush", BRUSH_BOUNDARY_DEFORM_BEND, {\
       {BRUSH_BOUNDARY_DEFORM_BEND, "BEND", "NONE", "Bend", ""},
       {BRUSH_BOUNDARY_DEFORM_EXPAND, "EXPAND", "NONE", "Expand", ""},
       {BRUSH_BOUNDARY_DEFORM_INFLATE, "INFLATE", "NONE", "Inflate", ""},
@@ -303,9 +300,9 @@ MAKE_ENUM(boundary_defor

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list