Blax Posted May 26, 2015 Share Posted May 26, 2015 Hi. Advice me, please. How i can correctly use material from scene A to scene B?I make clone of material, put material in scene.materials array, check paramets of material (its ok), material is assigned, but not render in other scene (( Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted May 26, 2015 Share Posted May 26, 2015 This should work. What do you mean by "not render" ? Do you have a repro I can test? Quote Link to comment Share on other sites More sharing options...
Blax Posted May 29, 2015 Author Share Posted May 29, 2015 Hi, Deltakosh! I try reproduce in playground, but can't create one more canvas, scene, engine, etc. Sorry// creating 2 canvas, 2 engine, 2 scenes (a and , loading each scene meshes and materials// next ...var tm;for (iMat in a.materials){ if (!!a.materials[iMat].clone){ // only StandardMaterial has clone() tm=a.materials[iMat]; if (b.getMaterialByID(tm.id)==null){ // not replace old mat's tm=tm.clone(); b.materials.push(tm); } }}// its not work. If out to console b.materials can see new materials,// but if assign any to mesh (myMesh.material=b.materials[anythingIndex]) // nothing changed in render view. Now i copy all properties from mat1 to mat2, for circumvent problem, but its so wild and horrible Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted May 29, 2015 Share Posted May 29, 2015 ok so perhaps you can share a page that reproduces the error somewhere (Please link to www.babylonjs.com/babylon.max.js) ? Quote Link to comment Share on other sites More sharing options...
Blax Posted June 8, 2015 Author Share Posted June 8, 2015 Hi, Deltakosh! Sorry, i can't ansewer at once. ok so perhaps you can share a page that reproduces the error somewhere (Please link to www.babylonjs.com/babylon.max.js) ? But, i have more strange results Please, see in https://www.clickon.ru/demo/3d/first: it seems clone() do not clone material IDsecond: assigning cloned material moved object and not set propertyes (in this case red color of diffuseColor). What I do not understand? And one more moment - if i do anyMaterial.dispose(), he's do not removed from objects, and continue stay on mesh? How i can correctly dispose material? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 8, 2015 Share Posted June 8, 2015 HUm...your test says" Babylon is not referenced" Quote Link to comment Share on other sites More sharing options...
jerome Posted June 8, 2015 Share Posted June 8, 2015 this is a browser security limitation you try to load your page from httpS://yourdomain.ru/something and babylon from httpS://babylon.com/etc/and this second URL hasn't a valid certificate under its own name The browser doesn't like you try to mix http (or unvalid certificated) with valid secure connections Quote Link to comment Share on other sites More sharing options...
Blax Posted June 9, 2015 Author Share Posted June 9, 2015 Hi, Jerome! Yes, just let you browser use mix, or... yes, look at: http://www.aregion.ru/demo/3d/ (i move sample here ). Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 9, 2015 Share Posted June 9, 2015 Ok gotcha: this could not work as the scene MUST have the same engine (and the same canvas) to share resources Quote Link to comment Share on other sites More sharing options...
Blax Posted June 10, 2015 Author Share Posted June 10, 2015 Ok gotcha: this could not work as the scene MUST have the same engine (and the same canvas) to share resourcesHmmm... in this case i must made big common canvas and set non intersect viewports of cameras for create two separete area with 3d-render, yes? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 10, 2015 Share Posted June 10, 2015 totally right! Quote Link to comment Share on other sites More sharing options...
Blax Posted June 11, 2015 Author Share Posted June 11, 2015 Roger that.Many thanks for answers!!! Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 11, 2015 Share Posted June 11, 2015 My pleasure Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.