Download

Online

Gallery

Blog

  Index  | Recent Threads  | List Attachments  | Search
 Welcome Guest  |  Register  |  Login
Login Name  Password
 

Sweet Home 3D Forum



No member browsing this thread
Thread Status: Active
Total posts in this thread: 5
[ Jump to Last Post ]
Post new Thread
Author
Previous Thread This topic has been viewed 3849 times and has 4 replies Next Thread
enkonyito
Advanced Member
Member's Avatar


Joined: May 28, 2015
Post Count: 601
Status: Offline
Reply to this Post  Reply with Quote 
Modify the materials of a piece of furniture

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.
----------------------------------------
EnkoNyito
[Jul 16, 2018, 10:47:18 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Puybaret
Expert
Member's Avatar

France
Joined: Nov 7, 2005
Post Count: 9141
Status: Offline
Reply to this Post  Reply with Quote 
Re: Modify the materials of a piece of furniture

HomeMaterial objects are immutable like a few other ones in Sweet Home 3D like BackgroundImagel, Sash, TextStyle... instances. But I guess your question isn't about the advantages of immutability, right?
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?
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
----------------------------------------
[Edit 1 times, last edit by Puybaret at Jul 17, 2018, 12:12:48 AM]
[Jul 16, 2018, 11:35:12 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
enkonyito
Advanced Member
Member's Avatar


Joined: May 28, 2015
Post Count: 601
Status: Offline
Reply to this Post  Reply with Quote 
Re: Modify the materials of a piece of furniture

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?
No, I didn't know the advantages of immutability .

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?
Sometimes we miss out on the most obvious things.
I had not yet figured out how to use this method in my plugin.

Thanks
----------------------------------------
EnkoNyito
[Jul 18, 2018, 1:58:02 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
enkonyito
Advanced Member
Member's Avatar


Joined: May 28, 2015
Post Count: 601
Status: Offline
Reply to this Post  Reply with Quote 
Re: Modify the materials of a piece of furniture

Is it normal that sometimes the getModelMaterials() method only returns one material when there are several?
----------------------------------------
EnkoNyito
[Jan 8, 2019, 11:40:32 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
enkonyito
Advanced Member
Member's Avatar


Joined: May 28, 2015
Post Count: 601
Status: Offline
Reply to this Post  Reply with Quote 
Re: Modify the materials of a piece of furniture

It's normal and I was able to adapt it to my plug-in. smile
----------------------------------------
EnkoNyito
[Jan 24, 2019, 9:13:44 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
[ Jump to Last Post ]
Show Printable Version of Thread  Post new Thread

    Get Sweet Home 3D at SourceForge.net. Fast, secure and Free Open Source software downloads
   
© Copyright 2006-2024 eTeks - All rights reserved