diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2012-01-23 00:05:26 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2012-01-23 00:05:26 +0400 |
commit | 6eb0ca9385aaf69c89172a5826592e5ad9dac198 (patch) | |
tree | c9262f0272a3d566077436958400cfe72ebf8461 /source/blender/editors | |
parent | b54182c93fac2bd79d0c9244eaf1d553b93adcb0 (diff) | |
parent | 1a93d8834319b890ff0cbc70231b14635603ae95 (diff) |
Merged with trunk (-r43609:43611): updated modifier preview.
Noted preview code for DynamicPaint is currently disabled, will see if I can re-enable it…
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/space_view3d/drawmesh.c | 4 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/drawobject.c | 24 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_intern.h | 2 |
3 files changed, 9 insertions, 21 deletions
diff --git a/source/blender/editors/space_view3d/drawmesh.c b/source/blender/editors/space_view3d/drawmesh.c index 061a9f5a300..de3c28ca919 100644 --- a/source/blender/editors/space_view3d/drawmesh.c +++ b/source/blender/editors/space_view3d/drawmesh.c @@ -742,7 +742,7 @@ void draw_mesh_textured_old(Scene *scene, View3D *v3d, RegionView3D *rv3d, Objec } else { if(GPU_buffer_legacy(dm)) { - if (draw_flags & DRAW_DYNAMIC_PAINT_PREVIEW) + if (draw_flags & DRAW_MODIFIERS_PREVIEW) dm->drawFacesTex(dm, draw_mcol__set_draw_legacy, NULL, NULL); else dm->drawFacesTex(dm, draw_tface__set_draw_legacy, NULL, NULL); @@ -880,7 +880,7 @@ static int tex_mat_set_face_editmesh_cb(void *userData, int index) void draw_mesh_textured(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob, DerivedMesh *dm, int draw_flags) { - if((!scene_use_new_shading_nodes(scene)) || (draw_flags & DRAW_DYNAMIC_PAINT_PREVIEW)) { + if((!scene_use_new_shading_nodes(scene)) || (draw_flags & DRAW_MODIFIERS_PREVIEW)) { draw_mesh_textured_old(scene, v3d, rv3d, ob, dm, draw_flags); return; } diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 2aced4e6e1c..bcfa57a2687 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -36,7 +36,6 @@ #include "DNA_camera_types.h" #include "DNA_curve_types.h" #include "DNA_constraint_types.h" // for drawing constraint -#include "DNA_dynamicpaint_types.h" #include "DNA_lamp_types.h" #include "DNA_lattice_types.h" #include "DNA_material_types.h" @@ -3151,27 +3150,16 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D eWireDrawMode draw_wire= OBDRAW_WIRE_OFF; int /* totvert,*/ totedge, totface; DerivedMesh *dm= mesh_get_derived_final(scene, ob, scene->customdata_mask); - ModifierData *md = NULL; const short is_obact= (ob == OBACT); int draw_flags = (is_obact && paint_facesel_test(ob)) ? DRAW_FACE_SELECT : 0; if(!dm) return; - /* check to draw dynamic paint colors */ - if ((md = modifiers_findByType(ob, eModifierType_DynamicPaint))) - { - /* check if target has an active dpaint modifier */ - if(md && (md->mode & eModifierMode_Realtime)) - { - DynamicPaintModifierData *pmd = (DynamicPaintModifierData *)md; - /* if canvas is ready to preview vertex colors */ - if (pmd->canvas && pmd->canvas->flags & MOD_DPAINT_PREVIEW_READY && - DM_get_poly_data_layer(dm, CD_WEIGHT_MCOL)) { - draw_flags |= DRAW_DYNAMIC_PAINT_PREVIEW; - } - } - } + /* Check to draw dynamic paint colors (or weights from WeightVG modifiers). + * Note: Last "preview-active" modifier in stack will win! */ + if(DM_get_poly_data_layer(dm, CD_WEIGHT_MCOL) && modifiers_isPreview(ob)) + draw_flags |= DRAW_MODIFIERS_PREVIEW; /* Unwanted combination */ if (draw_flags & DRAW_FACE_SELECT) { @@ -3212,7 +3200,7 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D draw_mesh_object_outline(v3d, ob, dm); } - if(draw_glsl_material(scene, ob, v3d, dt) && !(draw_flags & DRAW_DYNAMIC_PAINT_PREVIEW)) { + if(draw_glsl_material(scene, ob, v3d, dt) && !(draw_flags & DRAW_MODIFIERS_PREVIEW)) { glFrontFace((ob->transflag&OB_NEG_SCALE)?GL_CW:GL_CCW); dm->drawFacesGLSL(dm, GPU_enable_material); @@ -3263,7 +3251,7 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D /* since we already draw wire as wp guide, dont draw over the top */ draw_wire= OBDRAW_WIRE_OFF; } - else if (draw_flags & DRAW_DYNAMIC_PAINT_PREVIEW) { + else if (draw_flags & DRAW_MODIFIERS_PREVIEW) { /* for object selection draws no shade */ if (flag & (DRAW_PICKING|DRAW_CONSTCOLOR)) { dm->drawFacesSolid(dm, NULL, 0, GPU_enable_material); diff --git a/source/blender/editors/space_view3d/view3d_intern.h b/source/blender/editors/space_view3d/view3d_intern.h index f6c82b0ba9d..07754c0883c 100644 --- a/source/blender/editors/space_view3d/view3d_intern.h +++ b/source/blender/editors/space_view3d/view3d_intern.h @@ -59,7 +59,7 @@ struct wmNDOFMotionData; #define DRAW_SCENESET 4 /* draw_mesh_fancy/draw_mesh_textured draw_flags */ -#define DRAW_DYNAMIC_PAINT_PREVIEW 1 +#define DRAW_MODIFIERS_PREVIEW 1 #define DRAW_FACE_SELECT 2 /* view3d_header.c */ |