Menu

#47 Replacer Plugin

open
nobody
None
1
2024-03-17
2023-07-25
No

This plugin is used to replace each of the selected pieces of furniture before opening the plugin with another selected piece of furniture after opening the plugin; both must be selected in the plan.

**Features: **

  • You can choose the properties to be copied from the furniture to be replaced to the replacement piece of furniture, such as: x, y, elevation, level, angle, height, width, depth, color, texture, mirrored status, and if it part of base plan.
  • By default, properties like x, y, elevation, level, and angle, as well as whether it is part of base plan, will be copied.
  • You can choose if replace the groups of furniture as a whole or replace each individual piece of furniture within the groups.
  • You can choose whether only the selected furniture should be replaced or if all matching furniture should also be replaced.

An example using the plugin is shown in the images:

9 Attachments

Discussion

  • Oliver Martínez

    I forgot to upload the plugin, here it is:

     
  • ivan diaz

    ivan diaz - 2023-08-01

    good morning Oliver Martínez, I have found a problem when replacing the bulbs according to their brightness with your plugin, that is, if for example in a room I have 4 bulbs and those bulbs have a brightness of 50%, and I want to reduce the brightness of all the bulbs at 30%, so what I do is change the brightness of one of the bulbs to 30% and use your plugin to replace the brightness of the other 3 bulbs simultaneously, but unfortunately it didn't work. What's more, for the 3 light bulbs that I wanted to modify the brightness with your plugin, the box is hidden to be able to modify the brightness manually in the "modify furniture" window.

     
    • Oliver Martínez

      Hello Ivan, I'm very sorry about that, what happens is that I had not taken into account the luminosity property of the light sources, because only these objects have this property, but in the next version I will fix it

       

      Last edit: Oliver Martínez 2023-08-02
  • YGYL2

    YGYL2 - 2023-08-17

    Thank you very much!It would be even better if we could add the function of randomly placing X and Y coordinates and randomly rotating angles

     
    • Oliver Martínez

      I'm glad you found the plugin useful! Regarding your tip, do you mean that there is an option that, instead of copying x, y and the angle of the objects to be replaced to the replacement, random values are given to those properties? In which cases could this functionality be useful?

       

      Last edit: Oliver Martínez 2023-08-18
      • YGYL2

        YGYL2 - 2023-08-23

        Placement of crowds, lots of grass or plants, large tree

         
  • Oliver Martínez

    Version 1.1

    • Added option to transfer the brightness of the original object to the replacement.
    • Added an option that allows transfer light power, especially when both the original and replacement objects are light sources.
    • If the color or texture needs to be transferred, but the original object has default color and texture, the plugin will use the texture/color from the first material found or the first material modified by the user as the overall replacement color/texture.
    • Fixed a bug where replace furniture within groups would cause the replacements to be placed outside the groups.
    • When select "replace all matching" and choose a group, the replacement will apply to that group and other groups with the same quantity and models of furniture.
    • Fixed other bugs regarding the replacement of groups and furniture within groups.
    • Source code available within the plugin.

     

    Last edit: Oliver Martínez 2025-02-27
  • Emmanuel Puybaret

    Thanks for the update.
    Please pay attention to the javaMinimumVersion property you set in the ApplicationPlugin.properties file of your plug-in. It states "1.5", whereas the target version of the .class files of your plug-in are not compatible with Java 1.5. The best solution would to recompile them with a -target option equal to 1.5, or at least 1.8 so it's still compatible with the Java version used by Sweet Home 3D on some plateforms.
    Then, don't forget to update javaMinimumVersion property accordingly.

     
  • Emmanuel Puybaret

    I didn't study your code in details but saw that it didn't use the setModel method added in Sweet Home 3D 6.5.
    Maybe its use could simplify greatly your plug-in, even if you would have to change the handling of the copied properties.
    If ever you want to use it, don't forget to update applicationMinimumVersionproperty to "6.5" in in the ApplicationPlugin.properties file of your plug-in.

     

    Last edit: Emmanuel Puybaret 2024-03-15
  • Oliver Martínez

    Hi Emmanuel! Thanks for your recommendations. I have recompiled my plugin and updated the javaMinimumVersion property with version 1.8 to avoid incompatibilities. I will take into account your recommendation about using the setModel method for the next version to analyze how convenient it would be to use it in my code and what I would have to modify it. Here is the plugin with the fixes:

     

    Last edit: Oliver Martínez 2024-03-20

Log in to post a comment.

MongoDB Logo MongoDB