Jump to content

How to fix can't inherit material into the parent library


photo

Recommended Posts

Hi, this is our scenario.

 

We share a common materials file between worlds, called world/iceMaterials.mat

We load world A using the console command.

We load world B using the console command.

We inherit from one of the materials defined in world/iceMaterials.mat.

 

We get this output:

 

15:13:38 MaterialManager::inheritMaterial(): can't inherit material into the parent library
15:13:38 Object::setMaterial(): can't find "ice_matte_0" material
 
We are creating a new material called "ice_matte_0" based off material "ice_matte"
 
If we load world B directly without loading world A first, it works just fine.

 

Any ideas? 

 

Thanks

Link to comment

Hi Joseph,

 

Please take a look at the material libraries article: https://developer.unigine.com/en/docs/2.2.1/content/materials/inheritance. The important part is described in Loading order for material libraries scheme. More likely you have wrong material libraries order during the world init.

 

If this doesn't help - we need to check a small test scene to get the idea which library is loading first and what exactly is going on in your materials code.

 

Thanks!

  • Like 1

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment

I have a work-around fix for this.

 

After loading the first world, I inherit a material.  Then after the second world load, it no longer exhibits the problem above.  From your description, I *think* what's happening is that inheriting at least one material causes the base materials to stick around, then they won't reload the second time and thus get out of order.

 

Thanks.

Link to comment
  • 2 months later...

wow.... i just typed 'can't' and by mistake i hit enter and straight on got me to the answer of my problem, where a parent material library couldn't be found, just a matter of changing the order of loading in the .world file.... talk about luck.... Silent you are a god....!!! :D

Link to comment
×
×
  • Create New...