Material Switch
26 February 2016 15:19
Hi,
I'm doing something wrong with this material switch but can't figure it out.
I've taken the 'inherit_material.blend' and recreated it to better understand the process. Unfortunately, my attached example does not change the material like the example does… I have no idea what the issue is… Any thoughts?
I'm doing something wrong with this material switch but can't figure it out.
I've taken the 'inherit_material.blend' and recreated it to better understand the process. Unfortunately, my attached example does not change the material like the example does… I have no idea what the issue is… Any thoughts?
Danny Austin,Technical Manager
PIX Set Visions
PIX Set Visions
26 February 2016 15:46
26 February 2016 16:01
Ahhhhhhh SUPER noob!
Here's the file now working for reference.
Is there a way to load materials from an external library from inside the presentation?
Perhaps materials could be exported to a database and then called by an event in the interface?
Thank you for your help
Here's the file now working for reference.
Is there a way to load materials from an external library from inside the presentation?
Perhaps materials could be exported to a database and then called by an event in the interface?
Thank you for your help
Danny Austin,Technical Manager
PIX Set Visions
PIX Set Visions
26 February 2016 16:46
Is there a way to load materials from an external library from inside the presentation?For now there is such way:
You can use simple scenes with one object as library. Let's name it for example "SuperMegaMaterialCarrier".
Then you should dynamically load library scene from your main scene and use inherit material method:
https://www.blend4web.com/api_doc/module-material.html#.inherit_material
Perhaps materials could be exported to a database and then called by an event in the interface?As we can see from the previous answer you only need to store info about your library scenes (json and bin files). There are plenty of opportunities to organize storage and interaction depending on your needs.
26 February 2016 17:06
Excellent! Thanks for that great info.
If you had thousands of materials (assigned to "SuperMegaMaterialCarrier") could you call only one single material and it's resources? This would be fantastic.
OR would the entire library be required at client side for this to work?
Thanks
Danny
If you had thousands of materials (assigned to "SuperMegaMaterialCarrier") could you call only one single material and it's resources? This would be fantastic.
OR would the entire library be required at client side for this to work?
Thanks
Danny
Danny Austin,Technical Manager
PIX Set Visions
PIX Set Visions
26 February 2016 17:22
If you had thousands of materials (assigned to "SuperMegaMaterialCarrier") could you call only one single material and it's resources? This would be fantastic.If you want to load exactly one material per call you should create carrier scene for every material. As far as i can see the most optimal way is to batch objects thematically (somehow predict what material user will choose next, again everything is depending on your application) . For the best performance you should experiment in balancing carrier scene loading routine in engine and receiving carrier scene info from the server.
OR would the entire library be required at client side for this to work?
26 February 2016 17:23
26 February 2016 18:16