Forum

User posts joelstein
12 July 2017 02:21
Thank you both for your replies.

I have been using Blender and Blend4web to display neuroimaging data on meshes of brain cortical surfaces. For this, I have been coloring different brain regions either using material colors and separate meshes or vertex painting in Blender as Will mentioned. It would be nice to apply different vertex colors dynamically to display different data sets, as you say after run-time, rather than generating multiple differently colored mesh objects.
08 July 2017 22:00
I know how to change material colors dynamically with the API.

Is there any way to reassign vertex colors?
20 August 2016 06:17
Oops, that was dumb. The even easier way is just to take advantage of the A in RGBA

set_diffuse_color(obj, mat_name, color) where color is RGBA
20 August 2016 05:41
Figured it out. Being a relative blender newbie hurts me too.

In Blender:
Set material alpha to 0.
Add a texture.
Texture alpha factor now controls transparency.
20 August 2016 00:13
I have a scene with buttons elsewhere on the page that allow the user to change object colors via m_mat.set_diffuse_color.

I'd like to do the same with transparency. Objects saved in blender with transparency display nicely with blend4web, but I don't know how to change the transparency setting dynamically.

I read the section here https://www.blend4web.com/doc/en/materials.html and see that the material alpha value is not used by the engine. I don't see how to use the alpha channel of a texture. I couldn't see anything further in the API.

Thanks!