Features

Download

Online

Gallery

Blog

  Index  | Recent Threads  | List Attachments  | Help  | 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: 10
[ Jump to Last Post ]
Post new Thread
Author
Previous Thread This topic has been viewed 5648 times and has 9 replies Next Thread
digitaltrails
Member



New Zealand
Joined: Dec 28, 2014
Post Count: 45
Status: Offline
Reply to this Post  Reply with Quote 
Change Texture Plugin

I was trying to evaluate different surfaces for a kitchen countertop where the countertop was made of a dozen or more cupboard units, drawer units, sink units, plus boxes representing a waterfall end. Changing each texture was getting tedious.

So today I wrote a plugin that traverses the furniture model and replaces one texture and with another.

The plugin first presents a list of "from" textures, then a list of "to" textures. It then lists furniture items that were modified.

  • I'm not too familiar with the internals of Sweet Home 3D, you should backup your model before using it.
  • There is no undo capability, but you can always exit without saving.
  • After using the plugin I have managed to save and re-open quite a complicated model, so it appears to be working.
  • Matches are made by comparing texture names. Sweet Home 3D seems to permit more than one texture with the same name. My guess is that this plugin will alter all textures with matching names.

If there is sufficient interest, I'm open to putting more work into this plugin. Plus anyone should feel free to run with code and concept. Possible enhancements:

  • It would be nice to be able to use Sweet Home 3D's actual texture selection dialog (or similar).
  • It would be good to allow textures for walls etc to also be changed (checkbox options).
  • It would be nice if undo could be made to work.
  • Optionally filtering the texture list could be useful.

Sourceforge Ticket (where Jar with source is attached):

https://sourceforge.net/p/sweethome3d/plug-ins/12/

Installation is as for other plugins. Have fun.
[Sep 12, 2015 6:20:02 AM] Show Printable Version of Post    View Member Profile    Send Private Message    https://www.flickr.com/photos/digitaltrails/ [Link] Report threatening or abusive post: please login first  Go to top 
digitaltrails
Member



New Zealand
Joined: Dec 28, 2014
Post Count: 45
Status: Offline
Reply to this Post  Reply with Quote 
Re: Change Texture Plugin Version 1.1

Change Texture Plugin Version 1.1: https://sourceforge.net/p/sweethome3d/plug-ins/12/

Version 1.1 simplifies the user interface and adds texture icons to the selection panels.



Instructions: The plugin's interface shows three panels. You may interact with the panels in any order. The following interaction would be typical:

  • Under the Tools menu choose Change Furniture Textures.
  • In the left From Texture panel select the texture to replace, .
  • The right Furniture to Modify panel will then show any furniture using the selected From Texture. Optionally alter the selection of furniture (using click, shift-click and ctrl-click).
  • In the middle To Texture panel in the middle, click the replacement texture.
  • Click Change Textures to perform the change.
  • Repeat to make other texture change.
  • Click Close to close and exit the plugin.

Installation:
Download the plugin jar from the link at the top of this post and copy it into your Sweet Home 3D plugins folder. According to the plugin Developer's Guide...
The appropriate folder depends on your system as follows:

  • under Windows Vista / 7 / 8, this folder is C:\Users\user\AppData\Roaming\eTeks\Sweet Home 3D\plugins,
  • under Windows XP and previous versions of Windows, this folder is C:\Documents and Settings\user\Application Data\eTeks\Sweet Home 3D\plugins,
  • under Mac OS X, it's the subfolder Library/Application Support/eTeks/Sweet Home 3D/plugins of your user folder,
  • under Linux and other Unix, it's the subfolder .eteks/sweethome3d/plugins of your user folder.

Limitations: Some pieces of furniture have inbuilt textures. These textures won't appear in the From Texture Panel. If you want to use this plugin with furniture with inbuilt textures, first use Modify Furniture to replace the inbuilt textures with textures from the Sweet Home 3D catalog. For example, to experiment with kitchen benchtop textures I first set all the bench unit's tops to normal catalog textures, once that was done I could use the plugin to bulk change the textures for all work surfaces.
[Sep 20, 2015 6:46:04 AM] Show Printable Version of Post    View Member Profile    Send Private Message    https://www.flickr.com/photos/digitaltrails/ [Link] Report threatening or abusive post: please login first  Go to top 
digitaltrails
Member



New Zealand
Joined: Dec 28, 2014
Post Count: 45
Status: Offline
Reply to this Post  Reply with Quote 
Re: Change Texture Plugin v1.2

Version 1.2 adds an option to set a uniform shininess - the default value for shininess is copied from the targeted texture/furniture model. There is now a texture image preview on mouse hover. The text for labels and prompts have been moved to a properties file to allow for internationalisation. Icon sizes have been standardised.


[Sep 26, 2015 2:29:54 AM] Show Printable Version of Post    View Member Profile    Send Private Message    https://www.flickr.com/photos/digitaltrails/ [Link] Report threatening or abusive post: please login first  Go to top 
okh
Advanced Member




Joined: May 12, 2013
Post Count: 1289
Status: Offline
Reply to this Post  Reply with Quote 
Re: Change Texture Plugin v1.2

a. It would be nice to be able to use Sweet Home 3D's actual texture selection dialog (or similar).
b. It would be good to allow textures for walls etc to also be changed (checkbox options).
c. It would be nice if undo could be made to work.
d. Optionally filtering the texture list could be useful.

Very nice work. The neat part is that it is possible to find out which textures one has actually used in a model. E.g. I realised that I had experimented with three different textures for door thresholds. Good being able to tidy that up. Filtering would be nice. Maybe especially if the plugin could filter out and list textures in use in the plan (my full list is pretty overwhelming). If possible, making the plugin work on walls/floors/ceilings and even models with built-in textures, would really make this plugin a must-have. ok
[Sep 26, 2015 10:01:25 AM] Show Printable Version of Post    View Member Profile    Send Private Message    Hidden to Guest [Link] Report threatening or abusive post: please login first  Go to top 
digitaltrails
Member



New Zealand
Joined: Dec 28, 2014
Post Count: 45
Status: Offline
Reply to this Post  Reply with Quote 
Re: Change Texture Plugin v1.2

a. It would be nice to be able to use Sweet Home 3D's actual texture selection dialog (or similar).
b. It would be good to allow textures for walls etc to also be changed (checkbox options).
c. It would be nice if undo could be made to work.
d. Optionally filtering the texture list could be useful.

Very nice work. The neat part is that it is possible to find out which textures one has actually used in a model. E.g. I realised that I had experimented with three different textures for door thresholds. Good being able to tidy that up. Filtering would be nice. Maybe especially if the plugin could filter out and list textures in use in the plan (my full list is pretty overwhelming). If possible, making the plugin work on walls/floors/ceilings and even models with built-in textures, would really make this plugin a must-have. ok


Thanks for the feedback I'll give filtering some thought, I was thinking of perhaps two options:


  • Adding text fields to the top of the From-Texture-Panel and the To-Texture-Panel. When text is entered the lists would narrow accordingly.
  • Adding an option to the Furniture-Selection-Panel that would cause the panel to list all a home's furniture. Then when click/control-click/shift-click was used to select from the furniture-list, the textures in the From-Texture-Panel would narrow to only those used by the selected furniture.


There is also the possibility of extending the plugin by adding tabs to deal with other related tasks, such as non-furniture changes. Or perhaps related tasks should just have their own plugins.

The plugin now has to load furniture models in order to retrieve initial shininess values. Potentially the plugin could also access each model's built-in textures.
[Sep 26, 2015 11:02:22 AM] Show Printable Version of Post    View Member Profile    Send Private Message    https://www.flickr.com/photos/digitaltrails/ [Link] Report threatening or abusive post: please login first  Go to top 
okh
Advanced Member




Joined: May 12, 2013
Post Count: 1289
Status: Offline
Reply to this Post  Reply with Quote 
Re: Change Texture Plugin v1.2

Sounds good. Actually, I like both filtering options, but especially the second. A bit hard to test full scale, as I do tend to build textures into the models to make sure the mapping is ok.

Another thought, along the same lines, if different. A while back we discussed changing all windows in the house. To see how the house would look with new windows, it was possible to dive into the SH3D file and replace the window model. But that was a messy approach. So a sort of general search-replace would also be a nice idea. But I suppose that is different from what you are up to.

Anyway, looking forward to seeing what you come up with for the textures. Good luck. ok
[Sep 26, 2015 12:17:29 PM] Show Printable Version of Post    View Member Profile    Send Private Message    Hidden to Guest [Link] Report threatening or abusive post: please login first  Go to top 
digitaltrails
Member



New Zealand
Joined: Dec 28, 2014
Post Count: 45
Status: Offline
Reply to this Post  Reply with Quote 
Re: Change Texture Plugin v1.3

Version 1.3 adds the filtering features described in the thread previously, plus some other additions and fixes:

  • Clicking on a Furniture-to-Modify item narrows the From-Texture list to only those textures used by the furniture item.
  • The From-Texture and To-Texture panels now include an incremental search text box.
  • From-Texture and Furniture-to-Modify panels now have a right-mouse menu item to show all respective items.
  • Icon drawing on deferred loading has been fixed.

How to deal with inbuilt textures is still not addressed (but I'm thinking about it).

Previous installation and usage instructions posted earlier in this thread still apply.
[Oct 5, 2015 9:37:47 AM] Show Printable Version of Post    View Member Profile    Send Private Message    https://www.flickr.com/photos/digitaltrails/ [Link] Report threatening or abusive post: please login first  Go to top 
digitaltrails
Member



New Zealand
Joined: Dec 28, 2014
Post Count: 45
Status: Offline
Reply to this Post  Reply with Quote 
Re: Change Texture Plugin v1.2

Sounds good. Actually, I like both filtering options, but especially the second. A bit hard to test full scale, as I do tend to build textures into the models to make sure the mapping is ok.

Another thought, along the same lines, if different. A while back we discussed changing all windows in the house. To see how the house would look with new windows, it was possible to dive into the SH3D file and replace the window model. But that was a messy approach. So a sort of general search-replace would also be a nice idea. But I suppose that is different from what you are up to.

Anyway, looking forward to seeing what you come up with for the textures. Good luck. ok


Bulk changing other items would be useful. It sounds tricky to try and replace windows. I guess if the dimensions and other properties are available, maybe it would be possible. But I not sure if I'm up for that challenge just now.

I wonder if some kind of macro facility to script or repeat operations might have a role to play. Maybe a plugin that adds a scripting language such as jython, plus some kind of helper jython libraries.
[Oct 5, 2015 9:49:51 AM] Show Printable Version of Post    View Member Profile    Send Private Message    https://www.flickr.com/photos/digitaltrails/ [Link] Report threatening or abusive post: please login first  Go to top 
digitaltrails
Member



New Zealand
Joined: Dec 28, 2014
Post Count: 45
Status: Offline
Reply to this Post  Reply with Quote 
Re: Change Texture Plugin v1.4

Version 1.4 includes the following changes:

  • The plugin now defaults the "From-Textures" panel to displaying only those textures in use for this home
  • A right-mouse menu has been added to both texture-panels with options to "show all textures" or "show textures in-use."
  • UI improvements have been made to the process of changing textures. This includes updating the selected from-texture to the previously applied to-texture to make it easier to try one texture after another.
  • The "From-Textures" panel now shows any orphaned textures that are no longer listed in the texture catalog (because they have been deleted from the catalog but are still in use).

As before, the plugin is available from ticket at SourceForge:
https://sourceforge.net/p/sweethome3d/plug-ins/12

Installation and usage was described previously in this thread.

I think I've done with this plugin for now. It adequately addresses the problem I was having with bulk changing textures as well as helping me track down duplicates, disused textures, and disused furniture.

I was considering also handling inbuilt/default non-catalog textures, but that's proving to be a bit harder. I have code that can find inbuilt/default non-catalog textures, and the code can override them with new home-textures, but the new textures draw as blank. This code is included in V1.4, but not enabled by default. If you want to experiment with it, set an environment variable CTP_INCLUDE_DEFAULT_TEXTURES to a non empty value (or see the source code included in the plugin jar/zip).
[Oct 10, 2015 5:57:56 AM] Show Printable Version of Post    View Member Profile    Send Private Message    https://www.flickr.com/photos/digitaltrails/ [Link] Report threatening or abusive post: please login first  Go to top 
okh
Advanced Member




Joined: May 12, 2013
Post Count: 1289
Status: Offline
Reply to this Post  Reply with Quote 
Re: Change Texture Plugin v1.4

I think I've done with this plugin for now. It adequately addresses the problem I was having with bulk changing textures as well as helping me track down duplicates, disused textures, and disused furniture.
This really is a very nice little tool. Like the way I can find out and tidy up textures used on various objects. The way it identifies the object on which the texture is used is a valuable feature. I would love for this to work on walls/floors too, but still. This is one I will keep. Thanks. ok

[Oct 10, 2015 8:33:52 AM] Show Printable Version of Post    View Member Profile    Send Private Message    Hidden to Guest [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-2017 eTeks - All rights reserved