Commit: 366663a7e07762b764aeabafb4ac95dfd0c39c60
Author: Antony Riakiotakis
Date:   Thu Feb 26 16:20:10 2015 +0100
Branches: vertex_paint_pbvh
https://developer.blender.org/rB366663a7e07762b764aeabafb4ac95dfd0c39c60

Merge branch 'master' into vertex_paint_pbvh

Conflicts:
        source/blender/editors/sculpt_paint/sculpt.c

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



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

diff --cc source/blender/editors/object/object_edit.c
index 9724ed2,458feeb..d61ef13
--- a/source/blender/editors/object/object_edit.c
+++ b/source/blender/editors/object/object_edit.c
@@@ -1997,3 -2000,67 +2000,67 @@@ void OBJECT_OT_game_physics_copy(struc
        /* flags */
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
  }
+ 
+ /* generic utility function */
+ 
+ bool ED_object_editmode_calc_active_center(Object *obedit, const bool 
select_only, float r_center[3])
+ {
+       switch (obedit->type) {
+               case OB_MESH:
+               {
+                       BMEditMesh *em = BKE_editmesh_from_object(obedit);
+                       BMEditSelection ese;
+ 
+                       if (BM_select_history_active_get(em->bm, &ese)) {
+                               BM_editselection_center(&ese, r_center);
+                               return true;
+                       }
+                       break;
+               }
+               case OB_ARMATURE:
+               {
+                       bArmature *arm = obedit->data;
+                       EditBone *ebo = arm->act_edbone;
+ 
+                       if (ebo && (!select_only || (ebo->flag & (BONE_SELECTED 
| BONE_ROOTSEL)))) {
+                               copy_v3_v3(r_center, ebo->head);
+                               return true;
+                       }
+ 
+                       break;
+               }
+               case OB_CURVE:
+               case OB_SURF:
+               {
+                       Curve *cu = obedit->data;
+ 
+                       if (ED_curve_active_center(cu, r_center)) {
+                               return true;
+                       }
+                       break;
+               }
+               case OB_MBALL:
+               {
+                       MetaBall *mb = obedit->data;
+                       MetaElem *ml_act = mb->lastelem;
+ 
+                       if (ml_act && (!select_only || (ml_act->flag & 
SELECT))) {
+                               copy_v3_v3(r_center, &ml_act->x);
+                               return true;
+                       }
+                       break;
+               }
+               case OB_LATTICE:
+               {
+                       BPoint *actbp = 
BKE_lattice_active_point_get(obedit->data);
+ 
+                       if (actbp) {
+                               copy_v3_v3(r_center, actbp->vec);
+                               return true;
+                       }
+                       break;
+               }
+       }
+ 
+       return false;
 -}
++}
diff --cc source/blender/editors/sculpt_paint/paint_utils.c
index ecdfffe,c0ed500..439009d
--- a/source/blender/editors/sculpt_paint/paint_utils.c
+++ b/source/blender/editors/sculpt_paint/paint_utils.c
@@@ -52,8 -52,8 +52,9 @@@
  #include "BKE_context.h"
  #include "BKE_DerivedMesh.h"
  #include "BKE_image.h"
+ #include "BKE_material.h"
  #include "BKE_paint.h"
 +#include "BKE_pbvh.h"
  #include "BKE_report.h"
  
  #include "RNA_access.h"
diff --cc source/blender/editors/sculpt_paint/sculpt.c
index ef7a65a,69428c0..1d103c6
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@@ -4264,17 -4248,17 +4264,17 @@@ static void sculpt_stroke_update_step(b
        sculpt_restore_mesh(sd, ob);
  
        if (sd->flags & SCULPT_DYNTOPO_DETAIL_CONSTANT) {
-               BKE_pbvh_bmesh_detail_size_set(psession->pbvh,
-                       sd->constant_detail / 100.0f);
 -              BKE_pbvh_bmesh_detail_size_set(ss->pbvh, sd->constant_detail / 
100.0f);
++              BKE_pbvh_bmesh_detail_size_set(psession->pbvh, 
sd->constant_detail / 100.0f);
        }
        else {
-               BKE_pbvh_bmesh_detail_size_set(psession->pbvh,
-                                              (ss->cache->radius /
-                                               (float)ups->pixel_radius) *
-                                              (float)sd->detail_size / 0.4f);
+               BKE_pbvh_bmesh_detail_size_set(
 -                      ss->pbvh,
++                      psession->pbvh,
+                       (ss->cache->radius /
+                       (float)ups->pixel_radius) *
 -                      (float)(sd->detail_size * U.pixelsize) / 0.4f);
++                      (float)(psession->detail_size * U.pixelsize) / 0.4f);
        }
  
 -      if (sculpt_stroke_dynamic_topology(ss, brush)) {
 +      if (sculpt_stroke_dynamic_topology(ss, psession, brush)) {
                do_symmetrical_brush_actions(sd, ob, sculpt_topology_update, 
ups);
        }

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

Reply via email to