[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [37346] branches/soc-2011-onion: Revision: 30700
Jason Wilkins
Jason.A.Wilkins at gmail.com
Thu Jun 9 23:28:03 CEST 2011
Revision: 37346
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=37346
Author: jwilkins
Date: 2011-06-09 21:28:02 +0000 (Thu, 09 Jun 2011)
Log Message:
-----------
Revision: 30700
Author: nicholasbishop
Date: 4:23:15 PM, Saturday, July 24, 2010
Message:
== VPaint ==
Removed non-PBVH vpaint.
Modified Paths:
--------------
branches/soc-2011-onion/release/scripts/startup/bl_ui/space_view3d_toolbar.py
branches/soc-2011-onion/source/blender/blenkernel/intern/DerivedMesh.c
branches/soc-2011-onion/source/blender/editors/sculpt_paint/paint_vertex.c
branches/soc-2011-onion/source/blender/editors/space_view3d/drawobject.c
branches/soc-2011-onion/source/blender/makesdna/DNA_scene_types.h
branches/soc-2011-onion/source/blender/makesrna/intern/rna_sculpt_paint.c
Property Changed:
----------------
branches/soc-2011-onion/
Property changes on: branches/soc-2011-onion
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/soc-2010-jwilkins:28499-37009
/branches/soc-2010-nicolasbishop:28448-30676,30692-30693,30696,30699,30742
/trunk/blender:36833-37206
+ /branches/soc-2010-jwilkins:28499-37009
/branches/soc-2010-nicolasbishop:28448-30676,30692-30693,30696,30699-30700,30742
/trunk/blender:36833-37206
Modified: branches/soc-2011-onion/release/scripts/startup/bl_ui/space_view3d_toolbar.py
===================================================================
--- branches/soc-2011-onion/release/scripts/startup/bl_ui/space_view3d_toolbar.py 2011-06-09 18:28:58 UTC (rev 37345)
+++ branches/soc-2011-onion/release/scripts/startup/bl_ui/space_view3d_toolbar.py 2011-06-09 21:28:02 UTC (rev 37346)
@@ -1151,7 +1151,6 @@
col.prop(vpaint, "use_all_faces")
col.prop(vpaint, "use_normal")
col.prop(vpaint, "use_spray")
- col.prop(vpaint, "backbuf")
col.label(text="Unified Settings:")
col.prop(tool_settings, "sculpt_paint_use_unified_size", text="Size")
Modified: branches/soc-2011-onion/source/blender/blenkernel/intern/DerivedMesh.c
===================================================================
--- branches/soc-2011-onion/source/blender/blenkernel/intern/DerivedMesh.c 2011-06-09 18:28:58 UTC (rev 37345)
+++ branches/soc-2011-onion/source/blender/blenkernel/intern/DerivedMesh.c 2011-06-09 21:28:02 UTC (rev 37346)
@@ -2257,9 +2257,6 @@
/* weight paint and face select need original indicies because of selection buffer drawing */
int needMapping = (ob==obact) && (editing || (ob->mode & OB_MODE_WEIGHT_PAINT));
- if((ob->mode & OB_MODE_VERTEX_PAINT) && (scene->toolsettings->vpaint->flag & VP_BACKBUF))
- needMapping |= 1;
-
clear_mesh_caches(ob);
mesh_calc_modifiers(scene, ob, NULL, &ob->derivedDeform,
Modified: branches/soc-2011-onion/source/blender/editors/sculpt_paint/paint_vertex.c
===================================================================
--- branches/soc-2011-onion/source/blender/editors/sculpt_paint/paint_vertex.c 2011-06-09 18:28:58 UTC (rev 37345)
+++ branches/soc-2011-onion/source/blender/editors/sculpt_paint/paint_vertex.c 2011-06-09 21:28:02 UTC (rev 37346)
@@ -1689,12 +1689,8 @@
paint_init(&vp->paint, PAINT_CURSOR_VERTEX_PAINT);
}
- if(vp->flag & VP_BACKBUF)
- /* update modifier stack for mapping requirements */
- DAG_id_tag_update(&me->id, 0);
-
/* create pbvh */
- if(!(vp->flag & VP_BACKBUF) && ob->mode & OB_MODE_VERTEX_PAINT) {
+ if(ob->mode & OB_MODE_VERTEX_PAINT) {
DerivedMesh *dm = mesh_get_derived_final(scene, ob, CD_MASK_BAREMESH|CD_MASK_MCOL);
ob->paint->pbvh = dm->getPBVH(ob, dm);
}
@@ -1781,6 +1777,8 @@
struct VPaintData *vpd;
ViewContext *vc = paint_stroke_view_context(stroke);
Object *ob= CTX_data_active_object(C);
+ Scene *scene = CTX_data_scene(C);
+ DerivedMesh *dm;
Mesh *me;
float mat[4][4], imat[4][4];
@@ -1795,8 +1793,6 @@
paint_stroke_set_mode_data(stroke, vpd);
vpd->vertexcosnos= mesh_get_mapped_verts_nors(vc->scene, ob);
- if(vp->flag & VP_BACKBUF)
- vpd->indexar= get_indexarray(me);
vpd->paintcol= vpaint_get_current_col(vp);
/* for filtering */
@@ -1807,107 +1803,12 @@
invert_m4_m4(imat, mat);
copy_m3_m4(vpd->vpimat, imat);
- if(!(CTX_data_tool_settings(C)->vpaint->flag & VP_BACKBUF)) {
- Scene *scene = CTX_data_scene(C);
- DerivedMesh *dm = mesh_get_derived_final(scene, ob, CD_MASK_BAREMESH|CD_MASK_MCOL);
+ dm = mesh_get_derived_final(scene, ob, CD_MASK_BAREMESH|CD_MASK_MCOL);
ob->paint->pbvh = dm->getPBVH(ob, dm);
- }
return 1;
}
-static void vpaint_paint_face(VPaint *vp, VPaintData *vpd, ViewContext *vc, int index, float mval[2], float pressure, int UNUSED(flip))
-{
- Object *ob = vc->obact;
- Brush *brush = paint_brush(&vp->paint);
- Mesh *me = get_mesh(ob);
- MFace *mface= ((MFace*)me->mface) + index;
- unsigned int *mcol= ((unsigned int*)me->mcol) + 4*index;
- unsigned int *mcolorig= ((unsigned int*)vp->vpaint_prev) + 4*index;
- float alpha;
- int i;
-
- if((vp->flag & VP_COLINDEX && mface->mat_nr!=ob->actcol-1) ||
- ((me->editflag & ME_EDIT_PAINT_MASK) && !(mface->flag & ME_FACE_SEL)))
- return;
-
- if(brush->vertexpaint_tool==VP_BLUR) {
- unsigned int fcol1= mcol_blend( mcol[0], mcol[1], 128);
- if(mface->v4) {
- unsigned int fcol2= mcol_blend( mcol[2], mcol[3], 128);
- vpd->paintcol= mcol_blend( fcol1, fcol2, 128);
- }
- else {
- vpd->paintcol= mcol_blend( mcol[2], fcol1, 170);
- }
-
- }
-
- for(i = 0; i < (mface->v4 ? 4 : 3); ++i) {
- alpha= calc_vp_alpha_dl(vp, vc, vpd->vpimat, vpd->vertexcosnos+6*(&mface->v1)[i], mval, pressure);
- if(alpha)
- vpaint_blend(vp, mcol+i, mcolorig+i, vpd->paintcol, (int)(alpha*255.0f));
- }
-}
-
-/* uses GL backbuf projection */
-static void vpaint_stroke_update_step_old(bContext *C, PaintStroke *stroke, PointerRNA *itemptr)
-{
- VPaint *vp= CTX_data_tool_settings(C)->vpaint;
- VPaintData *vpd = paint_stroke_mode_data(stroke);
- ViewContext *vc = paint_stroke_view_context(stroke);
- Brush *brush = paint_brush(&vp->paint);
- Object *ob= vc->obact;
- Mesh *me = get_mesh(ob);
- int *indexar= vpd->indexar;
- float mat[4][4], mval[2], pressure;
- int totindex, index, flip;
-
- RNA_float_get_array(itemptr, "mouse", mval);
- flip = RNA_boolean_get(itemptr, "pen_flip");
- pressure = RNA_float_get(itemptr, "pressure");
-
- view3d_operator_needs_opengl(C);
-
- /* load projection matrix */
- mul_m4_m4m4(mat, ob->obmat, vc->rv3d->persmat);
-
-
-
-
-
- mval[0]-= vc->ar->winrct.xmin;
- mval[1]-= vc->ar->winrct.ymin;
-
-
- /* which faces are involved */
- if(vp->flag & VP_AREA) {
- totindex= sample_backbuf_area(vc, indexar, me->totface, mval[0], mval[1], brush_size(brush));
- }
- else {
- indexar[0]= view3d_sample_backbuf(vc, mval[0], mval[1]);
- if(indexar[0]) totindex= 1;
- else totindex= 0;
- }
-
- swap_m4m4(vc->rv3d->persmat, mat);
-
- for(index=0; index<totindex; index++) {
- if(indexar[index] && indexar[index]<=me->totface)
- vpaint_paint_face(vp, vpd, vc, indexar[index]-1, mval, pressure, flip);
- }
-
- swap_m4m4(vc->rv3d->persmat, mat);
-
- /* was disabled because it is slow, but necessary for blur */
- if(brush->vertexpaint_tool == VP_BLUR)
- do_shared_vertexcol(me);
-
- ED_region_tag_redraw(vc->ar);
-
- DAG_id_tag_update(ob->data, 0);
-}
-
/* apply paint at specified coordinate
returns 1 if paint was applied, 0 otherwise */
static int vpaint_paint_coord(VPaint *vp, VPaintData *vpd, float co[3],
@@ -1933,14 +1834,8 @@
brush_curve_strength(brush, dist,
radius);
- //printf("orig=%f,%f,%f,%f ", col[0], col[1], col[2], col[3]);
IMB_blend_color_float(col, col, paint_col, strength, IMB_BLEND_MIX /* TODO */);
- //printf("result=%f,%f,%f,%f\n", col[0], col[1], col[2], col[3]);
- /*vpaint_blend(vp, col, orig_col,
- vpd->paintcol,
- str*255);*/
-
return 1;
}
@@ -2156,8 +2051,7 @@
}
}
-/* uses PBVH */
-static void vpaint_stroke_update_step_new(bContext *C, PaintStroke *stroke,
+static void vpaint_stroke_update_step(bContext *C, PaintStroke *stroke,
PointerRNA *itemptr)
{
VPaint *vp= CTX_data_tool_settings(C)->vpaint;
@@ -2201,16 +2095,6 @@
paint_tag_partial_redraw(C, ob);
}
-static void vpaint_stroke_update_step(bContext *C, PaintStroke *stroke, PointerRNA *itemptr)
-{
- VPaint *vp= CTX_data_tool_settings(C)->vpaint;
-
- if(vp->flag & VP_BACKBUF)
- vpaint_stroke_update_step_old(C, stroke, itemptr);
- else
- vpaint_stroke_update_step_new(C, stroke, itemptr);
-}
-
static void vpaint_stroke_done(bContext *C, struct PaintStroke *stroke)
{
ToolSettings *ts= CTX_data_tool_settings(C);
@@ -2229,10 +2113,8 @@
static int vpaint_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- VPaint *vp= CTX_data_tool_settings(C)->vpaint;
-
op->customdata = paint_stroke_new(C,
- (vp->flag & VP_BACKBUF) ? NULL : vpaint_stroke_get_location,
+ vpaint_stroke_get_location,
vpaint_stroke_test_start,
vpaint_stroke_update_step,
vpaint_stroke_done, event->type);
Modified: branches/soc-2011-onion/source/blender/editors/space_view3d/drawobject.c
===================================================================
--- branches/soc-2011-onion/source/blender/editors/space_view3d/drawobject.c 2011-06-09 18:28:58 UTC (rev 37345)
+++ branches/soc-2011-onion/source/blender/editors/space_view3d/drawobject.c 2011-06-09 21:28:02 UTC (rev 37346)
@@ -2747,13 +2747,12 @@
}
else if(ob->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_TEXTURE_PAINT)) {
if(me->mcol) {
- VPaint *vp = scene->toolsettings->vpaint;
+ MFace *mface = get_mesh(ob)->mface;
+
/* XXX - temporary - set up nicer drawing for new vpaint */
- if(!(vp->flag & VP_BACKBUF)) {
- MFace *mface = get_mesh(ob)->mface;
- GPU_enable_material(mface->mat_nr+1, NULL);
- glEnable(GL_LIGHTING);
- }
+ GPU_enable_material(mface->mat_nr+1, NULL);
+ glEnable(GL_LIGHTING);
+
dm->drawMappedFaces(dm, wpaint__setSolidDrawOptions, NULL, 1, GPU_enable_material);
glDisable(GL_LIGHTING);
}
Modified: branches/soc-2011-onion/source/blender/makesdna/DNA_scene_types.h
===================================================================
--- branches/soc-2011-onion/source/blender/makesdna/DNA_scene_types.h 2011-06-09 18:28:58 UTC (rev 37345)
+++ branches/soc-2011-onion/source/blender/makesdna/DNA_scene_types.h 2011-06-09 21:28:02 UTC (rev 37346)
@@ -619,10 +619,6 @@
// #define VP_MIRROR_X 32 // depricated in 2.5x use (me->editflag & ME_EDIT_MIRROR_X)
#define VP_ONLYVGROUP 128
-/* temporary flag; if this flag is set vpaint is same as ever, otherwise it uses the PBVH */
-#define VP_BACKBUF 256
-
-
typedef struct ToolSettings {
VPaint *vpaint; /* vertex paint */
VPaint *wpaint; /* weight paint */
Modified: branches/soc-2011-onion/source/blender/makesrna/intern/rna_sculpt_paint.c
===================================================================
--- branches/soc-2011-onion/source/blender/makesrna/intern/rna_sculpt_paint.c 2011-06-09 18:28:58 UTC (rev 37345)
+++ branches/soc-2011-onion/source/blender/makesrna/intern/rna_sculpt_paint.c 2011-06-09 21:28:02 UTC (rev 37346)
@@ -318,11 +318,6 @@
prop= RNA_def_property(srna, "use_spray", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", VP_SPRAY);
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list