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/space_view3d/drawobject.c | |
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/space_view3d/drawobject.c')
-rw-r--r-- | source/blender/editors/space_view3d/drawobject.c | 24 |
1 files changed, 6 insertions, 18 deletions
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); |