[Soc-2017-dev] vertex paint project - ply exporter

Howard Trickey howard.trickey at gmail.com
Thu Jul 13 15:08:33 CEST 2017


Hi Darshan,

Your collada export looks good (examining output by hand), but I can't test
with Unity import of that until tonight.  I think you should now work on
some kind of hacky way of visualizing the alpha when in Vertex Paint mode.
You can basically follow the method used in Fabio's patch but ignoring the
legacy changes (those are gone now). The copying of the mcols has moved
too.  You basically want to do these things:
- in cdderivedmesh.c, in function cdDM_drawMappedFaces
  * use glEnable(GL_BLEND) and glBlendFunc(GL_SRC_ALPHA,
GL_ONE_MINUS_SRC_ALPHA) somewhere before drawing the elements
(the GPU_buffer_draw_elements call) and then glDisable(GL_BLEND) somewhere
after, but only in the cases where colType is CD_MLOOPCOL.  For now, maybe
only worry about the case when setDrawOptions is NULL
- change cdDM_buffer_copy_mcol to copy 4 bytes at a time instead of 3
- in gpu_buffers.c:
  * change the gpu_buffer_type_settings to make the mcol buffer have stride
4 instead of 3
 * in GPU_color_setup, change the glColorPointer call to specify 4 unsiged
bytes rather than 3.

After doing this, we need to see if we've broken anything else in Blender
-- need to check all uses of the color buffer to see that they will be
properly populated by 4 bytes instead of 3, and that for the
non-vertex-paint cases, the alpha byte will be 255.

- Howard


On Wed, Jul 12, 2017 at 10:41 PM Darshan kadu <darsh7807 at gmail.com> wrote:

> Thank you, Mr. Howard.
> I will try to test it after the collada.
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.blender.org/pipermail/soc-2017-dev/attachments/20170713/6ac011c8/attachment.htm 


More information about the Soc-2017-dev mailing list