Jump to content

Material.inherit()


photo

Recommended Posts

Posted

Hi,

 

the Material class has the inherit() function, what - according to the documentation does exactly what I want to do: I want to create a inherit a new material during runtime without storing it in any Material Libraries XML etc.

 

 

Problem is, if I do this:

Material material = baseMaterial.inherit("my_fancy_material");
mesh.setMaterial(material.getName(), "*");

I get the error message:

Object::setMaterial(): can't find "my_fancy_material" material.

I do not find any way to set the Material based on the Material Class instead of it's name tho.. so.. how do I use the inherit() function properly?

 

 

Cheers,

Daniela

 

PS: I can not use the Object::getMaterialInherit() function, since my new material needs to have a different parent than the current assigned one.

Posted

Hello Daniela,

 

Make sure you have material library loaded with your fancy materials. After that you can do inherit stuff.

 

Have a good day! ;)

×
×
  • Create New...