Add a new texture feature

This topic has been viewed 4126 times and has 1 replies
Thread status: Active
Questions about extending features and developing plug-ins [img]http://www.sweethome3d.com/images/flags/en_small.gif[/img]
Post Reply New Topic
tsionik
Posts: 4
Joined: Thu Sep 29, 2011 7:18 pm

Add a new texture feature

Post by tsionik »

Dear SH3D Community,

I want to create a new feature in SH3D. Specifically, if for example I have a simple cube, I would have the choice to put a different texture in every side of the cube(in current version os SH3D, it is possible to change only the whole texture of an object). I have to mention that my quest is not to do something like that in any object but only in simple objects, such as cubes.

Is that possible with some way? In which classes I should focus and how difficult it could be?

Thanks!
User avatar
Puybaret
Posts: 9440
Joined: Mon Nov 07, 2005 12:00 pm
Country: Paris, France
Contact:

Re: Add a new texture feature

Post by Puybaret »

That could be a nice plug-in. [:)]
The difficulty depends on your programming skills, but you could reuse many classes of Sweet Home 3D to help you achieve it faster. To avoid having too much to master, I would:
- learn how to program a new plug-in,
- program a dialog box that would let the user choose the image on each side of the cube,
- generate a cube at OBJ + MTL formats (generate one with Sweet Home 3D or better with an other 3D program and you'll understand quickly what it requires),
- gather the OBJ, MTL and textures files in a zip file,
- create a modifiable CatalogPieceOfFurniture instance, and add it to the catalog (and/or add it to home after that if you want it to appear in the plan), reproducing the behavior of the finish method in ImportedFurnitureWizardController class.
Emmanuel Puybaret, Sweet Home 3D creator
Post Reply New Topic

Who is online

Users browsing this forum: No registered users and 1 guest