Netherlands
Joined: Apr 8, 2022
Post Count: 989
Status:
Offline
Move light power setting from object to property
Would it be possible to move the power setting for a light source to the light property (lightSourceMaterial) and not on the object itself?
Example: I created some led numbers but it is impossible to create a single object of seven led segments that can be turned on and of individually to form the desired number. This is because you only have one power setting on the object, i.e. the combined seven segments. If I could set a different lightSourceMaterial for each segment AND set a different power for each segment any number can be formed with a single object. The main goal of course is to get that single object for a number that can be added to a furniture library (ok, a clock with four numbers).
This is just one example but basically you can't have more than one light source on any object. I can think of many objects that would have multiple light sources if it was possible. (Buttons and ceiling lights for an elevator, ceiling light with multiple light points, different lights on a car, a digital clock, etc.)
Currently power and lightSourceMaterial are organized like this in the Home.xml file:
If I understand it correctly 'light' before 'id' is needed to indicate a light source, 'power' is to set the intensity, and 'lightSourceMaterial' sets the material property that is the light. <light ... </light> might already limit the object to a single light but should not be needed because the 'lightSourceMaterial' already indicates that there's a light.
Depending on how Sweet Home 3D and photo renderers handle the data node it might look like this:
I understand that because of backward compatibility this is impossible but maybe it is possible to introduce a second type of lights that does implement the suggested format. It does require a different Modify Furniture dialog to allow for setting the power on a property (lightSourceMaterial) and not on the whole object.
---------------------------------------- Dodecagon.nl 700+ 3D models, manuals, and projects
France
Joined: Nov 7, 2005
Post Count: 9366
Status:
Offline
Re: Move light power setting from object to property
Your idea would imply to add a new dialog box to be able to edit the power of each light. Quite weird to my opinion. Did you try to play with materials visibility, a little like in Scopia's traffic lights?
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
Netherlands
Joined: Apr 8, 2022
Post Count: 989
Status:
Offline
Re: Move light power setting from object to property
You wouldn't need a new dialog box. A power setting could be added below the Shininess slider and only visible if it's a lightSourceMaterial. A power setting on the property is more logical since the power works on that property and not on the complete object.
I did look at the traffic lights since it's one of the few models wich would benefit from multiple power settings. Did you look at the properties it uses? Textures for the lights and you can only make them invisible to have one light remaining on. And that doesn't even take into account that they are still not real lights. I could fix the traffic light. I did find an alternative method for a led clock but that wouldn't work for my elevator cabin where I have different lights that have to be set individually (buttons, up/down arrows, ceiling lights).
For those interested in how to create a 'real' led number: • Create the segments of the led number. • Group and export as "SegmentsOff.obj, import, and rotate to vertical if necessary. • Export, import as "Door or window". • Place a wall the size of the frame you want and place the imported 'window' in the wall. Export ony the wall and import after changing the material name to "Front". This is the front frame for the number with cutouts for the led segments. • Copy the "SegmentsOff.obj" and "SegmentOff.mtl" to "SegmentsOn" files. • Edit the SegmentsOn files and change the color properties to a single material name, for example "On". Add "d 0.8" for transparency. Don't forget to change "mtllib SegmentsOff.mtl" to "mtllib SegmentsOn.mtl". • Edit the SegmentsOff object file so each segment has its own material name. For example SegmentAOff, SegmentBOff, etc. • Import both the On and Off segments. Adjust the tickness if necessary to the same as the background object and place both in the background so they fit exactly in the cutouts. I used 2 for the frame and the Off segments and 1 for the On segments. The On segments are place "inside" the Off segments so they are really invisible when the Off segment is visible. • Change the colors if you want to. Usually you use a very dark version of the light color for the color of an Off segment. You now have two segment objects occupying the same space in the background. • Place a lightpanel at the back of the LedNumber object. Place a border around and a solid background behind the lightpanel so that the lightpanel is enclosed in a box. (For this I used the lightpanel by eTeks.) • Export everything as "LedLightNumber" and import. (Optionally change the material names for the border and back enclosure.) • Use the Furniture Library Editor to create a new library or use a library you already have. • Import your LedLightNumber object, set the category to Light Sources", set other properties like key words, save, and close the library. • Open the furniture library sh3f file with a zip program. Edit the "PluginFurnitureCatalog.properties" file. At the bottom you should see your added LedNumber. • Add "lightSourceMaterialName#1=light" to the block for the LedNumber. Make sure '#1' is changed to the correct number for that block. Save and make sure the file is updated in the sh3f zip file. • Import the library in Sweet Home 3D • Find and drag the LedNumber into your project. Use Modify Furniture to make some Off segments invisible to get the number you want. Set the light power to 2%.
If you want to create a single-object clock with multiple digits you have to create copies of the number and change the material names so you can set the off segments for each number separately.
Netherlands
Joined: Apr 8, 2022
Post Count: 989
Status:
Offline
Re: Move light power setting from object to property
Your idea would imply to add a new dialog box to be able to edit the power of each light. Quite weird to my opinion. Did you try to play with materials visibility, a little like in Scopia's traffic lights?
As mentioned in my previous post I did look at the traffic lights and found only a partial solution for my problem. Using colors/shininess/textures is not really an alternative to real lights. The difference is very visible in photo renderings.
Consider the following example: I'm creating a kitchen oven for which I would like to add a digital control panel with individual symbols that can be on or off, a led temperature display, a led clock, and a interior light for the baking area. Switching the individual symbols on and off I can solve although in a rather cumbersome way because we can't change transparency in the modify furniture dialog. Not ideal but it works. The same could work for the clock and temperature but becomes a problem if I want the make the numbers changeable (switch led segments).
The real problem is the extra light for the interior. There's no way the interior light can function using the light source that is already there for the control panel. So I need a minimum of two different light sources for the single oven object. This oven is just a single example for the need for multiple light sources for a single furniture object. The Scopia traffic light could use two sources too if you want to switch the main and pedestrian lights separately using real lights.
So back to the original question: Is it (technically) possible to move the light source power setting to the material instead of the furniture object? As I mentioned. the setting itself can be placed under the shininess slider so no need for a separate dialog. The setting can show/hide depending on the presence of a light source for the material. Honestly, that would be the logical place since the power setting is for the light source material and not for the whole object. Is it possible at all considering backward compatibility and photo rendering?
---------------------------------------- Dodecagon.nl 700+ 3D models, manuals, and projects
Netherlands
Joined: Apr 8, 2022
Post Count: 989
Status:
Offline
Re: Move light power setting from object to property
A recuring item on my wish list:
Reviving this topic because once again I ran into the problem that only a single light source is allowed for an object.
I have a ceiling in an object that has both a lightpanel pointing downward and a lightpanel pointing upward. Both need their own power setting. Actually, for the intended end-product I would need at least four different lightsources. To make it even more complex the complete end-product deforms on a rail. Obviously this is not something that can be solved with grouping objects, the end-product must be a single object that can be added from the catalog.
As far as I can determine it's only the user interface that makes multiple light sources in the same object impossible. As the propertyname already implies it's a material property, not a property of the object. But the single power setting is on the Modify Furniture dialog, not the modify material dialog (color/texture).
It should be possible to have multiple lightSourceMaterialName# lines in the furniture library properties file since it only tells that a specific material is a lightsource. A first step could be to move the power setting to the material dialog and available if the lightsource material is selected. That is really the place where it belongs. The next development step can add the power setting to more materials.
Any chance this is made possible in one of the future versions?
(Additionally, each lightsource should have a property setting you can set for the power, not the system default of 50%. That would be nice for the current single lightsource too.)
---------------------------------------- Dodecagon.nl 700+ 3D models, manuals, and projects
France
Joined: Nov 7, 2005
Post Count: 9366
Status:
Offline
Re: Move light power setting from object to property
You can already have more than one material listed in the lightSourceMaterialName# property. Just separe them with one or more spaces. Then, sorry, but adding a light power setting to the Material modification dialog box is weird too, even if it wouldn't be too difficult to program.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
Netherlands
Joined: Apr 8, 2022
Post Count: 989
Status:
Offline
Re: Move light power setting from object to property
You can already have more than one material listed in the lightSourceMaterialName# property. Just separe them with one or more spaces.
I didn't know that. That will solve the problem in some cases where lightsources need different colors. They will still be controlled with a single power setting but tweaking with more or less transparency of a panel in front of the lightsource can solve that in some situations.
Then, sorry, but adding a light power setting to the Material modification dialog box is weird too, even if it wouldn't be too difficult to program.
I don't understand why that is weird. It's a property of the material so the only logical location is in the modify material dialogue. I always thought that the current location is weird. Its current location suggests that it is a property of the object while it's a material property. The fact that you can list multiple material names clearly proves that.
I know that adding to the dialog is easy. The storage in the pluginFurnitureCatalog.properties file is already supported. Adding a similar property lightSourceMaterialPower# adds the option to preset the power settings. Without that property line all default to 50%, so backward compatibility solved too. Storage in the Home.xml file is also easy (see my first post in this thread).
As a developer I have made wrong design decisions too but I always redesign and refactor them, hopefully before a client comes with a request that needs the change anyway. I do understand your reluctance to change this, I just keep hoping you get over the 'weird' issue since technically I see no real problem The biggest problem is time and priorities, now those I understand VERY well!
---------------------------------------- Dodecagon.nl 700+ 3D models, manuals, and projects