Change color plugin

This topic has been viewed 27540 times and has 21 replies
Thread status: Active
Questions about extending features and developing plug-ins [img]http://www.sweethome3d.com/images/flags/en_small.gif[/img]
User avatar
digitaltrails
Posts: 95
Joined: Sun Dec 28, 2014 12:20 am
Country: Wellington, New Zealand, New Zealand
Contact:

Re: Change color plugin - broken in v5.2

Post by digitaltrails »

The plugin code is removing the alpha when comparing colours, which isn't a problem. But its also removing the alpha when changing them - this is causing the issue I'm seeing.

Looking at the code, it seems I was originally concerned about preserving the destination's original alpha. Only if the new colour has a non 0xFF alpha, should the new alpha be used). I had disabled this as extraneous.

I've fixed the code, and re-enabled alpha preservation of the destinations original alpha. So far it looks good. Once I've done some more testing I'll put up a new version.
User avatar
digitaltrails
Posts: 95
Joined: Sun Dec 28, 2014 12:20 am
Country: Wellington, New Zealand, New Zealand
Contact:

Re: Change color plugin - broken in v5.2

Post by digitaltrails »

I put up a fixed version 1.1 of the Change Color Plugin at sourceforge:

https://sourceforge.net/p/sweethome3d/plug-ins/14/#9ea3

The plugin now preserves the existing alpha (transparency) of an item's colour. This means that visible things should stay visible.

I also added a special case to restore the alpha of item's broken by the bug. If a colour is changed to itself, the alpha is set to the alpha of the new colour (which is always FF). So I made all my kitchen cabinets visible again by changing colour #E5E4DB to the same colour #E5E4DB. (Manually un-setting invisible causes the colour to be lost).

Lastly, I fixed a bug where the plugin was failing to detect when a texture was present (if a texture is present it overrides colour).
Post Reply New Topic

Who is online

Users browsing this forum: No registered users and 1 guest