In the HomeMaterial class , only methods for obtaining information about the color, name, shininess, or texture of a material are defined.
Is it possible to change the value of these parameters other than by manually accessing the Home.xml file?
When there is more than a hundred pieces of furniture, it's tiring.
Modify the materials of a piece of furniture
This topic has been viewed 5733 times and has 4 replies
Re: Modify the materials of a piece of furniture
[font=courier new]HomeMaterial[/font] objects are immutable like a few other ones in Sweet Home 3D like [font=courier new]BackgroundImagel[/font], [font=courier new]Sash[/font], [font=courier new]TextStyle[/font]... instances. But I guess your question isn't about the advantages of immutability, right?
As you're a programmer, you could call the [font=courier new]setModelMaterials[/font] in HomePieceOfFurniture class with a new array of [font=courier new]HomeMaterial[/font] instances. What is the problem to do that?
As you're a programmer, you could call the [font=courier new]setModelMaterials[/font] in HomePieceOfFurniture class with a new array of [font=courier new]HomeMaterial[/font] instances. What is the problem to do that?
Emmanuel Puybaret, Sweet Home 3D creator
Re: Modify the materials of a piece of furniture
No, I didn't know the advantages of immutability .HomeMaterial objects are immutable like a few other ones in Sweet Home 3D like BackgroundImagel, Sash, TextStylel... instances. But I guess your question isn't about the advantages of immutability, right?
Sometimes we miss out on the most obvious things.As you're a programmer, you could call the setModelMaterials in HomePieceOfFurniture class with a new array of HomeMaterial instances. What is the problem to do that?
I had not yet figured out how to use this method in my plugin.
Thanks
EnkoNyito
Re: Modify the materials of a piece of furniture
Is it normal that sometimes the [font=courier new]getModelMaterials()[/font] method only returns one material when there are several?
EnkoNyito
Re: Modify the materials of a piece of furniture
It's normal and I was able to adapt it to my plug-in. [:)]
EnkoNyito
Who is online
Users browsing this forum: No registered users and 1 guest