Jump to content

Material library is deleted when parent material is missing


photo

Recommended Posts

Situation: In main material library I have parent materials and I have also many small material libraries preloaded into world as children of these materials. In case parent material is missing, materials from such library are not loaded (this is indeed OK). But when I save the world, such material library is saved as empty. I think proper behavious is, that library is not saved as empty. On the other side question is, if it is really possible to fix it.

Link to comment

demostenes

 

What do you mean by 'deleted'? It has been deleted physically from hard drive or just removed from the .world XML file? In case if it just removed from the .XML file - It's (unfortunately) expected behavior.

 

We will try to improve that behavior with an asset system.

 

Thanks!

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

Link to comment

demostenes

 

What do you mean by 'deleted'? It has been deleted physically from hard drive or just removed from the .world XML file? In case if it just removed from the .XML file - It's (unfortunately) expected behavior.

 

We will try to improve that behavior with an asset system.

 

Thanks!

 

I mean, that content of linked .mat is deleted. All materials. It stays linked in the .world file. In complex project it is quite easy to not notice and after some time you find out, that several .mat libraries are empty.

Link to comment

Thanks for the clarification. I'm not sure how to get the situation when you have missed materials:

In case parent material is missing, materials from such library are not loaded

They have to be modified manually via editing the .mat file? Or it can be done just using the Editor?

 

Thanks!

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

Link to comment

Thanks for the clarification. I'm not sure how to get the situation when you have missed materials:

They have to be modified manually via editing the .mat file? Or it can be done just using the Editor?

 

Thanks!

 

It can be simulated easily via editor. 

 

1) create main material library with material abc

2) create second material library with material bcd with parent abc

3) add second material library into preloaded material libraries

4) save the world

 

Delete material abc, save the world (or delete main material library) and reload world. Materials with abc parent will be not loaded (this is expeceted behaviour). Now, If you save the world, all materials with parent abc (bcd) will be deleted from second material library.

Link to comment

Hi Jirka,

 

When you delete material inside Editor you will see the pop-up message "Delete material "abc" with all children?". If you click Yes all the materials that were inherited from abc will be deleted automatically. Otherwise you will have wrong .mat files that will be loaded incorrectly.

 

We are deeply sorry, but this is the limitation of materials hierarchy and can't be easily fixed.

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

Link to comment

Hi Jirka,

 

When you delete material inside Editor you will see the pop-up message "Delete material "abc" with all children?". If you click Yes all the materials that were inherited from abc will be deleted automatically. Otherwise you will have wrong .mat files that will be loaded incorrectly.

 

We are deeply sorry, but this is the limitation of materials hierarchy and can't be easily fixed.

 

Yes you are right, you cant delete just parent in editor, sorry for misleading. In our case this happens in combination with this:

 

https://developer.unigine.com/forum/topic/2586-root-material-is-not-saved/

 

Root material library (first in the list) is not saved (deleted from preloaded libraries list), so next start many of dependent material libraries is not loaded and then after save we have for example 20 empty materials libraries. In some case we did not notice, because we work on something else and after one week of work and 50 commits there is surprise...it is not big problem to revert changes, etc, but we are doing this quite often.

 

What about some read-only flag for .mat library? 

Link to comment
×
×
  • Create New...