Commit: c3ce0d56a6fe7585edfdfb59c19d4d2a15062d54
Author: Nathan Vollmer
Date:   Thu Aug 11 15:47:31 2016 -0600
Branches: soc-2016-pbvh-painting
https://developer.blender.org/rBc3ce0d56a6fe7585edfdfb59c19d4d2a15062d54

Got texture paint working with PBVH painting.

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

M       release/scripts/startup/bl_ui/space_view3d_toolbar.py
M       source/blender/blenkernel/BKE_paint.h
M       source/blender/blenkernel/intern/paint.c
M       source/blender/blenloader/intern/versioning_defaults.c
M       source/blender/editors/sculpt_paint/paint_intern.h
M       source/blender/editors/sculpt_paint/paint_vertex.c
M       source/blender/editors/sculpt_paint/sculpt.c
M       source/blender/editors/sculpt_paint/sculpt_intern.h
M       source/blender/makesdna/DNA_brush_types.h
M       source/blender/makesdna/DNA_scene_types.h

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

diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py 
b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index 07bf434..6ff0364 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -1715,7 +1715,7 @@ class VIEW3D_PT_weightpaint_symmetry(Panel, 
View3DPaintPanel):
     bl_category = "Tools"
     bl_context = "weightpaint"
     bl_options = {'DEFAULT_CLOSED'}
-    bl_label = "Symmetry / Lock"
+    bl_label = "Symmetry"
 
     def draw(self, context):
         layout = self.layout
@@ -1765,6 +1765,7 @@ class VIEW3D_PT_tools_weightpaint_options(Panel, 
View3DPaintPanel):
 
 # ********** default tools for vertex-paint ****************
 
+
 class VIEW3D_PT_tools_vertexpaint(Panel, View3DPaintPanel):
     bl_category = "Options"
     bl_context = "vertexpaint"
@@ -1783,12 +1784,18 @@ class VIEW3D_PT_tools_vertexpaint(Panel, 
View3DPaintPanel):
         col.prop(vpaint, "use_spray")
 
         self.unified_paint_settings(col, context)
-        
+# Commented out because the Apply button isn't an operator yet, making these 
settings useless
+#~         col.label(text="Gamma:")
+#~         col.prop(vpaint, "gamma", text="")
+#~         col.label(text="Multiply:")
+#~         col.prop(vpaint, "mul", text="")
+
+
 class VIEW3D_PT_vertexpaint_symmetry(Panel, View3DPaintPanel):
     bl_category = "Tools"
     bl_context = "vertexpaint"
     bl_options = {'DEFAULT_CLOSED'}
-    bl_label = "Symmetry / Lock"
+    bl_label = "Symmetry"
     
     def draw(self, context):
         layout = self.layout
@@ -1804,11 +1811,6 @@ class VIEW3D_PT_vertexpaint_symmetry(Panel, 
View3DPaintPanel):
         row.prop(vpaint, "use_symmetry_z", text="Z", toggle=True)
         
         layout.column().prop(vpaint, "radial_symmetry", text="Radial")
-# Commented out because the Apply button isn't an operator yet, making these 
settings useless
-#~         col.label(text="Gamma:")
-#~         col.prop(vpaint, "gamma", text="")
-#~         col.label(text="Multiply:")
-#~         col.prop(vpaint, "mul", text="")
 
 # ********** default tools for texture-paint ****************
 
diff --git a/source/blender/blenkernel/BKE_paint.h 
b/source/blender/blenkernel/BKE_paint.h
index 237add5..2e65c72 100644
--- a/source/blender/blenkernel/BKE_paint.h
+++ b/source/blender/blenkernel/BKE_paint.h
@@ -209,13 +209,13 @@ typedef struct SculptSession {
        int *poly_map_mem;
        MeshElemMap* vert_to_poly;
 
-  unsigned long* totalRed;
-  unsigned long* totalGreen;
-  unsigned long* totalBlue;
-  unsigned long* totalAlpha;
-  double* totalWeight;
-  unsigned int *totloopsHit;
-  float *maxWeight;
+       unsigned long* totalRed;
+       unsigned long* totalGreen;
+       unsigned long* totalBlue;
+       unsigned long* totalAlpha;
+       double* totalWeight;
+       unsigned int *totloopsHit;
+       float *maxWeight;
 } SculptSession;
 
 void BKE_sculptsession_free(struct Object *ob);
diff --git a/source/blender/blenkernel/intern/paint.c 
b/source/blender/blenkernel/intern/paint.c
index 19c1090..bcb4ad9 100644
--- a/source/blender/blenkernel/intern/paint.c
+++ b/source/blender/blenkernel/intern/paint.c
@@ -757,21 +757,21 @@ void BKE_sculptsession_free(Object *ob)
                if (ss->poly_map_mem)
                        MEM_freeN(ss->poly_map_mem);
 
-    /* Free average brush arrays */
-    if (ob->sculpt->totloopsHit)
-    MEM_freeN(ob->sculpt->totloopsHit);
-    if (ob->sculpt->totalRed)
-      MEM_freeN(ob->sculpt->totalRed);
-    if (ob->sculpt->totalGreen)
-      MEM_freeN(ob->sculpt->totalGreen);
-    if (ob->sculpt->totalBlue)
-      MEM_freeN(ob->sculpt->totalBlue);
-    if (ob->sculpt->totalAlpha)
-      MEM_freeN(ob->sculpt->totalAlpha);
-    if (ob->sculpt->totalWeight)
-      MEM_freeN(ob->sculpt->totalWeight);
-    if (ob->sculpt->maxWeight)
-      MEM_freeN(ob->sculpt->maxWeight);
+               /* Free average brush arrays */
+               if (ob->sculpt->totloopsHit)
+                       MEM_freeN(ob->sculpt->totloopsHit);
+               if (ob->sculpt->totalRed)
+                       MEM_freeN(ob->sculpt->totalRed);
+               if (ob->sculpt->totalGreen)
+                       MEM_freeN(ob->sculpt->totalGreen);
+               if (ob->sculpt->totalBlue)
+                       MEM_freeN(ob->sculpt->totalBlue);
+               if (ob->sculpt->totalAlpha)
+                       MEM_freeN(ob->sculpt->totalAlpha);
+               if (ob->sculpt->totalWeight)
+                       MEM_freeN(ob->sculpt->totalWeight);
+               if (ob->sculpt->maxWeight)
+                       MEM_freeN(ob->sculpt->maxWeight);
 
                MEM_freeN(ss);
 
diff --git a/source/blender/blenloader/intern/versioning_defaults.c 
b/source/blender/blenloader/intern/versioning_defaults.c
index a860164..52769233 100644
--- a/source/blender/blenloader/intern/versioning_defaults.c
+++ b/source/blender/blenloader/intern/versioning_defaults.c
@@ -94,17 +94,17 @@ void BLO_update_defaults_startup_blend(Main *bmain)
                                sculpt->detail_size = 12;
                        }
                        
-      if (ts->vpaint)
-      {
-        VPaint *vp = ts->vpaint;
-        vp->radial_symm[0] = vp->radial_symm[1] = vp->radial_symm[2] = 1;
-      }
-
-      if (ts->wpaint)
-      {
-        VPaint *wp = ts->wpaint;
-        wp->radial_symm[0] = wp->radial_symm[1] = wp->radial_symm[2] = 1;
-      }
+                       if (ts->vpaint)
+                       {
+                               VPaint *vp = ts->vpaint;
+                               vp->radial_symm[0] = vp->radial_symm[1] = 
vp->radial_symm[2] = 1;
+                       }
+
+                       if (ts->wpaint)
+                       {
+                               VPaint *wp = ts->wpaint;
+                               wp->radial_symm[0] = wp->radial_symm[1] = 
wp->radial_symm[2] = 1;
+                       }
 
                        if (ts->gp_sculpt.brush[0].size == 0) {
                                GP_BrushEdit_Settings *gset = &ts->gp_sculpt;
@@ -286,12 +286,12 @@ void BLO_update_defaults_startup_blend(Main *bmain)
                    br->ob_mode = OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT;
                }
 
-    br = (Brush *)BKE_libblock_find_name_ex(bmain, ID_BR, "Smudge");
-    if (!br) {
-      br = BKE_brush_add(bmain, "Smudge", OB_MODE_VERTEX_PAINT | 
OB_MODE_WEIGHT_PAINT);
-      br->vertexpaint_tool = PAINT_BLEND_SMUDGE;
-      br->ob_mode = OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT;
-    }
+               br = (Brush *)BKE_libblock_find_name_ex(bmain, ID_BR, "Smudge");
+               if (!br) {
+                       br = BKE_brush_add(bmain, "Smudge", 
OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT);
+                       br->vertexpaint_tool = PAINT_BLEND_SMUDGE;
+                       br->ob_mode = OB_MODE_VERTEX_PAINT | 
OB_MODE_WEIGHT_PAINT;
+               }
        }
 }
 
diff --git a/source/blender/editors/sculpt_paint/paint_intern.h 
b/source/blender/editors/sculpt_paint/paint_intern.h
index e051569..7d0271d 100644
--- a/source/blender/editors/sculpt_paint/paint_intern.h
+++ b/source/blender/editors/sculpt_paint/paint_intern.h
@@ -98,79 +98,79 @@ void paint_cursor_delete_textures(void);
 * Variables stored both for 'active' and 'mirror' sides.
 */
 struct WeightPaintGroupData {
-  /** index of active group or its mirror
-  *
-  * - 'active' is always `ob->actdef`.
-  * - 'mirror' is -1 when 'ME_EDIT_MIRROR_X' flag id disabled,
-  *   otherwise this will be set to the mirror or the active group (if the 
group isn't mirrored).
-  */
-  int index;
-  /** lock that includes the 'index' as locked too
-  *
-  * - 'active' is set of locked or active/selected groups
-  * - 'mirror' is set of locked or mirror groups
-  */
-  const bool *lock;
+       /** index of active group or its mirror
+        *
+        * - 'active' is always `ob->actdef`.
+        * - 'mirror' is -1 when 'ME_EDIT_MIRROR_X' flag id disabled,
+        *   otherwise this will be set to the mirror or the active group (if 
the group isn't mirrored).
+        */
+       int index;
+       /** lock that includes the 'index' as locked too
+        *
+        * - 'active' is set of locked or active/selected groups
+        * - 'mirror' is set of locked or mirror groups
+        */
+       const bool *lock;
 };
 
 typedef struct WPaintData {
-  ViewContext vc;
-  int *indexar;
+       ViewContext vc;
+       int *indexar;
 
-  struct WeightPaintGroupData active, mirror;
+       struct WeightPaintGroupData active, mirror;
 
-  void *vp_handle;
-  DMCoNo *vertexcosnos;
+       void *vp_handle;
+       DMCoNo *vertexcosnos;
 
-  float wpimat[3][3];
+       float wpimat[3][3];
 
-  /* variables for auto normalize */
-  const bool *vgroup_validmap; /* stores if vgroups tie to deforming bones or 
not */
-  const bool *lock_flags;
+       /* variables for auto normalize */
+       const bool *vgroup_validmap; /* stores if vgroups tie to deforming 
bones or not */
+       const bool *lock_flags;
 
-  /* variables for multipaint */
-  const bool *defbase_sel;      /* set of selected groups */
-  int defbase_tot_sel;          /* number of selected groups */
-  bool do_multipaint;           /* true if multipaint enabled and multiple 
groups selected */
+       /* variables for multipaint */
+       const bool *defbase_sel;      /* set of selected groups */
+       int defbase_tot_sel;          /* number of selected groups */
+       bool do_multipaint;           /* true if multipaint enabled and 
multiple groups selected */
 
-  /* variables for blur */
-  struct {
-    MeshElemMap *vmap;
-    int *vmap_mem;
-  } blur_data;
+       /* variables for blur */
+       struct {
+               MeshElemMap *vmap;
+               int *vmap_mem;
+       } blur_data;
 
-  BLI_Stack *accumulate_stack;  /* for reuse (WPaintDefer) */
+       BLI_Stack *accumulate_stack;  /* for reuse (WPaintDefer) */
 
-  int defbase_tot;
+       int defbase_tot;
 } WPaintData;
 
 /* struct to avoid passing many args each call to do_weight_paint_vertex()
-* this _could_ be made a part of the operators 'WPaintData' struct, or at
-* least a member, but for now keep its own struct, initialized on every
-* paint stroke update - campbell */
+ * this _could_ be made a part of the operators 'WPaintData' struct, or at
+ * least a member, but for now keep its own struct, initialized on every
+ * paint stroke update - campbell */
 typedef struct WeightPaintInfo {
 
-  int defbase_tot;
+       int defbase_tot;
 
-  /* both must add up to 'defbase_tot' */
-  int defbase_tot_sel;
-  int defbase_tot_unsel;
+       /* both must add up to 'defbase_tot' */
+       int defbase_tot_sel;
+       int defbase_tot_unsel;
 
-  struct WeightPaintGroupData active, mirror;
+       struct WeightPaintGroupData active, mirror;
 
-  const bool *lock_flags;  /* boolean array for locked bones,
-                           * length of defbase_tot */
-  const bool *defbase_sel; /* boolean array for selected bones,
-                           * length of defbase_tot, cant be const because of 
how its passed */
+       const bool *lock_flags;  /* boolean array for locked bones,
+                                 * length of defbase_tot */
+       const bool *defbase_sel; /* 

@@ Diff output truncated at 10240 characters. @@

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to