diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-10-22 21:33:53 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-10-22 21:33:53 +0400 |
commit | 6e62491c5a101ee36ec48db97e4a4f4945f5eada (patch) | |
tree | 7f118f3c3acbee43cee33494bb6da332a8a68ee5 /source/blender/gpu/intern/gpu_draw.c | |
parent | c6b4494727144154511cdacb0e9e832a4b6fefc1 (diff) |
Fix #32522: Object's diffuse color not showing in Sculpt Mode
Added option to display object's diffuse color multiplied by sculpting
mask. This option could be found in Options panel of toolshelf when in
sculpting mode.
Thanks to Nicholas and Brecht for reviewing the patch!
Diffstat (limited to 'source/blender/gpu/intern/gpu_draw.c')
-rw-r--r-- | source/blender/gpu/intern/gpu_draw.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c index 0796a6c2ee0..96ba0bf0ec7 100644 --- a/source/blender/gpu/intern/gpu_draw.c +++ b/source/blender/gpu/intern/gpu_draw.c @@ -1469,6 +1469,21 @@ void GPU_disable_material(void) GPU_set_material_alpha_blend(GPU_BLEND_SOLID); } +void GPU_material_diffuse_get(int nr, float diff[4]) +{ + /* prevent index to use un-initialized array items */ + if (nr >= GMS.totmat) + nr = 0; + + /* no GPU_begin_object_materials, use default material */ + if (!GMS.matbuf) { + mul_v3_v3fl(diff, &defmaterial.r, defmaterial.ref + defmaterial.emit); + } + else { + copy_v4_v4(diff, GMS.matbuf[nr].diff); + } +} + void GPU_end_object_materials(void) { GPU_disable_material(); |