Commit: 669104b5da6b70cee0f24567c02bad13adf147fb Author: Campbell Barton Date: Thu Mar 30 17:23:05 2017 +1100 Branches: custom-manipulators https://developer.blender.org/rB669104b5da6b70cee0f24567c02bad13adf147fb
Merge branch 'blender2.8' into custom-manipulators =================================================================== =================================================================== diff --cc source/blender/editors/space_view3d/drawobject.c index c4885202e64,fb190293d72..8702b548380 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@@ -9281,53 -9290,7 +9291,52 @@@ static void draw_object_mesh_instance(S if (dm) dm->release(dm); } +void ED_draw_object_facemap(Scene *scene, Object *ob, const float col[4], const int facemap) +{ + DerivedMesh *dm = NULL; + + /* happens on undo */ + if (ob->type != OB_MESH || !ob->data) + return; + + dm = mesh_get_derived_final(scene, ob, CD_MASK_BAREMESH); + if (!dm || !CustomData_has_layer(&dm->polyData, CD_FACEMAP)) + return; + + DM_update_materials(dm, ob); + + glFrontFace((ob->transflag & OB_NEG_SCALE) ? GL_CW : GL_CCW); + + /* add polygon offset so we draw above the original surface */ + glPolygonOffset(1.0, 1.0); + + dm->totfmaps = BLI_listbase_count(&ob->fmaps); + + GPU_facemap_setup(dm); + + glColor4fv(col); + + glPushAttrib(GL_ENABLE_BIT); + glEnable(GL_BLEND); + glDisable(GL_LIGHTING); + + /* always draw using backface culling */ + glEnable(GL_CULL_FACE); + glCullFace(GL_BACK); + + if (dm->drawObject->facemapindices) { + glDrawElements(GL_TRIANGLES, dm->drawObject->facemap_count[facemap] * 3, GL_UNSIGNED_INT, + (int *)NULL + dm->drawObject->facemap_start[facemap] * 3); + } + glPopAttrib(); + + GPU_buffers_unbind(); + + glPolygonOffset(0.0, 0.0); + dm->release(dm); +} + - - void draw_object_instance(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob, const char dt, int outline) + void draw_object_instance(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob, const char dt, int outline, float wire_col[4]) { if (ob == NULL) return; _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs