[Bf-blender-cvs] [b253ed3] vertex_paint_pbvh: Merge branch 'master' into vertex_paint_pbvh

Antony Riakiotakis noreply at git.blender.org
Mon Dec 29 12:58:07 CET 2014


Commit: b253ed3b0f3a25eb780348625e508d61ac8b017b
Author: Antony Riakiotakis
Date:   Mon Dec 29 12:45:09 2014 +0100
Branches: vertex_paint_pbvh
https://developer.blender.org/rBb253ed3b0f3a25eb780348625e508d61ac8b017b

Merge branch 'master' into vertex_paint_pbvh

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

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



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

diff --cc source/blender/blenkernel/BKE_paint.h
index 24a485a,9ad99f7..fcba5c0
--- a/source/blender/blenkernel/BKE_paint.h
+++ b/source/blender/blenkernel/BKE_paint.h
@@@ -143,9 -143,10 +143,11 @@@ float paint_grid_paint_mask(const struc
                              unsigned x, unsigned y);
  
  /* stroke related */
- void paint_calculate_rake_rotation(struct UnifiedPaintSettings *ups, const float mouse_pos[2]);
+ void paint_calculate_rake_rotation(struct UnifiedPaintSettings *ups, struct Brush *brush, const float mouse_pos[2]);
+ 
+ void BKE_paint_stroke_get_average(struct Scene *scene, struct Object *ob, float stroke[3]);
  
 +
  /* Session data (mode-specific) */
  
  typedef struct SculptSession {
@@@ -183,33 -193,8 +185,26 @@@
  
  	struct SculptStroke *stroke;
  	struct StrokeCache *cache;
- 
- 	/* last paint/sculpt stroke location */
- 	bool last_stroke_valid;
- 	float last_stroke[3];
- 
- 	float average_stroke_accum[3];
- 	int average_stroke_counter;
  } SculptSession;
  
 +/* Session data (common) */
 +typedef struct PaintSession {
 +	/* PBVH acceleration structure */
 +	struct PBVH *pbvh;
 +
 +	/* Used to cache the render of the active texture */
 +	unsigned int texcache_side, *texcache, texcache_actual;
 +	struct ImagePool *tex_pool;
 +
 +	/* Partial redraw */
 +	bool partial_redraw;
 +	
 +	/* mode specific stuff */
 +	SculptSession *sculpt;
 +} PaintSession;
 +
 +void BKE_free_paintsession(struct Object *ob);
 +
  void BKE_free_sculptsession(struct Object *ob);
  void BKE_free_sculptsession_deformMats(struct SculptSession *ss);
  void BKE_sculptsession_bm_to_me(struct Object *ob, bool reorder);
diff --cc source/blender/editors/sculpt_paint/sculpt.c
index 4f9b1b0,dbb2999..16eda3f
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@@ -115,36 -115,6 +115,7 @@@ static int system_physical_thread_count
  }
  #endif  /* __APPLE__ */
  
- void ED_sculpt_stroke_get_average(Object *ob, float stroke[3])
- {
- 	SculptSession *ss = ob->paint->sculpt;
- 
- 	if (ss->last_stroke_valid && ss->average_stroke_counter > 0) {
- 		float fac = 1.0f / ss->average_stroke_counter;
- 		mul_v3_v3fl(stroke, ss->average_stroke_accum, fac);
- 	}
- 	else {
- 		copy_v3_v3(stroke, ob->obmat[3]);
- 	}
- }
- 
- bool ED_sculpt_minmax(bContext *C, float min[3], float max[3])
- {
- 	Object *ob = CTX_data_active_object(C);
- 	SculptSession *ss = (ob && ob->paint) ? ob->paint->sculpt : NULL;
- 
- 	if (ss && ss->last_stroke_valid) {
- 		copy_v3_v3(min, ss->last_stroke);
- 		copy_v3_v3(max, ss->last_stroke);
- 
- 		return 1;
- 	}
- 	else {
- 		return 0;
- 	}
- }
- 
 +
  /* Check if there are any active modifiers in stack (used for flushing updates at enter/exit sculpt mode) */
  static bool sculpt_has_active_modifiers(Scene *scene, Object *ob)
  {
@@@ -2987,10 -2929,9 +2958,10 @@@ void sculpt_vertcos_to_key(Object *ob, 
  /* Note: we do the topology update before any brush actions to avoid
   * issues with the proxies. The size of the proxy can't change, so
   * topology must be updated first. */
- static void sculpt_topology_update(Sculpt *sd, Object *ob, Brush *brush)
+ static void sculpt_topology_update(Sculpt *sd, Object *ob, Brush *brush, UnifiedPaintSettings *UNUSED(ups))
  {
 -	SculptSession *ss = ob->sculpt;
 +	PaintSession *psession = ob->paint;
 +	SculptSession *ss = psession->sculpt;
  	SculptSearchSphereData data;
  	PBVHNode **nodes = NULL;
  	float radius;
@@@ -3052,13 -2993,9 +3023,10 @@@
  	}
  }
  
- static void do_brush_action(Sculpt *sd, Object *ob, Brush *brush)
+ static void do_brush_action(Sculpt *sd, Object *ob, Brush *brush, UnifiedPaintSettings *ups)
  {
 -	SculptSession *ss = ob->sculpt;
 +	PaintSession *psession = ob->paint;
 +	SculptSession *ss = psession->sculpt;
  	SculptSearchSphereData data;
  	PBVHNode **nodes = NULL;
  	int n, totnode;




More information about the Bf-blender-cvs mailing list