Commit: d79197d9a89858c85c7cd2136b6bf1bc2d85be53
Author: Lukas Tönne
Date:   Fri Jan 23 16:44:59 2015 +0100
Branches: gooseberry
https://developer.blender.org/rBd79197d9a89858c85c7cd2136b6bf1bc2d85be53

Use the particle system material for OpenGL drawing.

This is probably not correct yet, the code is terribly confusing ...

===================================================================

M       source/blender/editors/space_view3d/drawobject.c

===================================================================

diff --git a/source/blender/editors/space_view3d/drawobject.c 
b/source/blender/editors/space_view3d/drawobject.c
index 9add328..1a83f53 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -4639,11 +4639,13 @@ BLI_INLINE int particle_path_prev(ParticleCacheKey 
**cache, int pmin, int p)
 
 static void draw_particle_hair_hull(Scene *UNUSED(scene), View3D *v3d, 
RegionView3D *rv3d,
                                     Base *base, ParticleSystem *psys,
-                                    const char UNUSED(ob_dt), const short 
UNUSED(dflag))
+                                    const char UNUSED(ob_dt), const short 
dflag)
 {
        Object *ob = base->object;
        ParticleSettings *part = psys->part;
-       /*Material *ma = give_current_material(ob, part->omat);*/
+       Material *ma = give_current_material(ob, part->omat);
+       float ma_col[3] = {0.0f, 0.0f, 0.0f};
+       unsigned char tcol[4] = {0, 0, 0, 255};
        GLint polygonmode[2];
        int totchild;
        
@@ -4661,6 +4663,15 @@ static void draw_particle_hair_hull(Scene 
*UNUSED(scene), View3D *v3d, RegionVie
        
        cache = psys->childcache;
        
+       if ((ma) && (part->draw_col == PART_DRAW_COL_MAT)) {
+               rgb_float_to_uchar(tcol, &(ma->r));
+               copy_v3_v3(ma_col, &ma->r);
+       }
+
+       if ((dflag & DRAW_CONSTCOLOR) == 0) {
+               glColor3ubv(tcol);
+       }
+       
        /* draw child particles */
        {
                int pstart;

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to