|
Sweet Home 3D Forum » List all forums » » Forum: Developers » » » Thread: HomePieceOfFurniture - model color » » » » Post: Re: HomePieceOfFurniture - model color |
Print at Dec 18, 2025, 11:45:30 AM |
| Posted by Puybaret at Nov 11, 2011, 9:42:54 AM |
|
Re: HomePieceOfFurniture - model color Welcome among Sweet Home 3D developers. If you're trying to program a plug-in that will allow users to change the color of the different parts of a piece of furniture, it would be greatly appreciated. Do you plan to share your plug-in? But how do I get to the colors of the pieces of the actual model? This information is only in the 3D model and more complicated to get. You'll have to read the model of the piece with one of ModelManager class loadModel methods and search recursively the Material colors in the appearance of its shapes. Looking at PieceOfFurnitureModelIcon inner class and HomePieceofFurniture3D class will give you many hints to achieve this faster.Note that if you want the changed colors to be saved at the end (and/or want the change to be applied only to the edited furniture when it shares the same 3D model with others), you'll have to generate a new temporary 3D model file for the updated furniture with OBJWriter and store its URL in the model of the piece with a TemporaryURLContent instance. Good luck! ---------------------------------------- Emmanuel Puybaret, Sweet Home 3D creator |
|
|
Current timezone is GMT Dec 18, 2025, 11:45:30 AM |