diff options
author | Jeroen Bakker <j.bakker@atmind.nl> | 2018-04-30 16:50:08 +0300 |
---|---|---|
committer | Jeroen Bakker <j.bakker@atmind.nl> | 2018-04-30 16:54:38 +0300 |
commit | cbe57acddf9554d11988718758096f9d847e9c95 (patch) | |
tree | d496e04a5a28e18e13bf2d124b378ee6132ca0a2 /source/blender/draw/modes/paint_vertex_mode.c | |
parent | d9f395ac390d1e02aa9c3e97ebaee8bb834e3af4 (diff) |
Workbench: Integration VertexPaint and WeightPaint modes
- Disable VertexPaint and WeightPaint for OB_MATERIAL and OB_RENDER. Users want to see the final result
- When in OB_SOLID, the active object should be rendered without any color. The lighting information is multiplied with the VertexPaint/WeightPaint color
- Removed the use_shading flag from VertexPaint and WeightPaint
- add method to check if render engine should draw without color (DRW_object_in_only_lighting_mode)
Reviewers: fclem
Tags: #code_quest
Maniphest Tasks: T54894
Differential Revision: https://developer.blender.org/D3191
Diffstat (limited to 'source/blender/draw/modes/paint_vertex_mode.c')
-rw-r--r-- | source/blender/draw/modes/paint_vertex_mode.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/source/blender/draw/modes/paint_vertex_mode.c b/source/blender/draw/modes/paint_vertex_mode.c index 835fefdee26..2c963571302 100644 --- a/source/blender/draw/modes/paint_vertex_mode.c +++ b/source/blender/draw/modes/paint_vertex_mode.c @@ -96,8 +96,6 @@ static void PAINT_VERTEX_engine_init(void *UNUSED(vedata)) } } -static float world_light; - static void PAINT_VERTEX_cache_init(void *vedata) { PAINT_VERTEX_PassList *psl = ((PAINT_VERTEX_Data *)vedata)->psl; @@ -112,12 +110,13 @@ static void PAINT_VERTEX_cache_init(void *vedata) /* Create a pass */ psl->vcolor_faces = DRW_pass_create( "Vert Color Pass", - DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS); + DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS | DRW_STATE_MULTIPLY); stl->g_data->fvcolor_shgrp = DRW_shgroup_create(e_data.vcolor_face_shader, psl->vcolor_faces); static float light[3] = {-0.3f, 0.5f, 1.0f}; static float alpha = 1.0f; + static float world_light = 1.0f; DRW_shgroup_uniform_vec3(stl->g_data->fvcolor_shgrp, "light", light, 1); DRW_shgroup_uniform_float(stl->g_data->fvcolor_shgrp, "alpha", &alpha, 1); DRW_shgroup_uniform_float(stl->g_data->fvcolor_shgrp, "global", &world_light, 1); @@ -156,8 +155,6 @@ static void PAINT_VERTEX_cache_populate(void *vedata, Object *ob) const bool use_face_sel = (me->editflag & ME_EDIT_PAINT_FACE_SEL) != 0; struct Gwn_Batch *geom; - world_light = BKE_collection_engine_property_value_get_bool(ces_mode_pw, "use_shading") ? 0.5f : 1.0f; - if (use_surface) { geom = DRW_cache_mesh_surface_vert_colors_get(ob); DRW_shgroup_call_add(stl->g_data->fvcolor_shgrp, geom, ob->obmat); @@ -195,7 +192,6 @@ void PAINT_VERTEX_collection_settings_create(IDProperty *properties) properties->type == IDP_GROUP && properties->subtype == IDP_GROUP_SUB_MODE_PAINT_VERTEX); - BKE_collection_engine_property_add_bool(properties, "use_shading", true); BKE_collection_engine_property_add_bool(properties, "use_wire", false); } |