13 July 2017 22:58
Hi Everyone,
Having a much better day today with B4W. Starting to get the hang of it.
Hopefully this should be a simple answer for someone, as I'm getting a bit smarter and know how to ask the questions more efficiently.
I'm trying to inherit a material from one blend file to my primary app blend file.
Steps I've taken so far:
Made 2 projects (the primary ((tex 1)) with a JS callback node) and the secondary ((tex2)) with nothing more than a cube and material.
I've saved the blend file and JSON file from 'tex2' along with moving the material texture in the 'tex1' project directory.
I've included 'obj', 'mat', 'scenes' and 'logic nodes' into my require list.
…Appended my function to a custom call back and written the following code (I'm taking baby steps remember)
This doesn't do anything unpredictable, it simply imports the cube from the my secondary blend file to my primary. Which is a good start… NO CONSOLE ERRORS YEEHAR!
But obviously I'm wanting to only import the material from the cube in 'tex2'.
So how do I amalgamate my 'secondary APP_ASSETS_PATH' with:
Thanks in advance
Having a much better day today with B4W. Starting to get the hang of it.
Hopefully this should be a simple answer for someone, as I'm getting a bit smarter and know how to ask the questions more efficiently.
I'm trying to inherit a material from one blend file to my primary app blend file.
Steps I've taken so far:
Made 2 projects (the primary ((tex 1)) with a JS callback node) and the secondary ((tex2)) with nothing more than a cube and material.
I've saved the blend file and JSON file from 'tex2' along with moving the material texture in the 'tex1' project directory.
I've included 'obj', 'mat', 'scenes' and 'logic nodes' into my require list.
…Appended my function to a custom call back and written the following code (I'm taking baby steps remember)
m_data.load(APP_ASSETS_PATH + "my_project_Tex2.json");
This doesn't do anything unpredictable, it simply imports the cube from the my secondary blend file to my primary. Which is a good start… NO CONSOLE ERRORS YEEHAR!
But obviously I'm wanting to only import the material from the cube in 'tex2'.
So how do I amalgamate my 'secondary APP_ASSETS_PATH' with:
var cube1 = m_scenes.get_object_by_name("Cube1");
var cube2 = m_scenes.get_object_by_name("Cube2");
m_mat.inherit_material(cube1, "MyMaterial_1", cube2, "MyMaterial_2");
Thanks in advance