Forum

Toggle New Material Question

02 January 2016 04:24 #6202
Hi,

Just started getting into Blend4Web. Totally new to visual scripting, but a longtime Blender user.

How do I set up a node tree, so that blender checks what material an object currently has, and based on that, changes the object to the second material in the material slot?

I've attached an image that shows what I currently have. I can click on an object to change it's material but can't do anything else.

Thanks!
Longtime Blender user, just getting into all the "web" stuff :-)
02 January 2016 23:22 #6208
Hello!
See blender/interactivity/inherit_material.blend. If you want to check current material, just use variable. See blender/interactivity/node_play_anim.blend where "box" variable is used for open/close state setting.
Alexander (Blend4Web Team)
02 January 2016 23:24 #6209
I've made a simple flow chart thing to show what I intend. I have a suspicion the answer lies in either the "Switch Select" or the "Conditional Jump" nodes, but I don't understand how either of those work ;-)
Longtime Blender user, just getting into all the "web" stuff :-)
02 January 2016 23:26 #6210
Ah thanks Alexander. I posted just before I saw your reply! I'll give that a try.
Longtime Blender user, just getting into all the "web" stuff :-)
 
Please register or log in to leave a reply.