Download

Online

Gallery

Blog

  Index  | Recent Threads  | List Attachments  | 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: 4
[ Jump to Last Post ]
Post new Thread
Author
Previous Thread This topic has been viewed 446 times and has 3 replies Next Thread
Keet
Advanced Member
Member's Avatar

Netherlands
Joined: Apr 8, 2022
Post Count: 789
Status: Offline
Reply to this Post  Reply with Quote 
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:
<light id='light-36553848-02d2-44f7-9765-1e438b0f752d' ....
power='0.5'>
<lightSourceMaterial name='spot'/>
</light>
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:
<light id='light-36553848-02d2-44f7-9765-1e438b0f752d' ...
<lightSourceMaterial name='spot1' power='0,5'/>
<lightSourceMaterial name='spot2' power='0,5'/>
<lightSourceMaterial name='spot3' power='0,5'/>
</light>

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.
[Nov 12, 2023, 10:23:46 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Puybaret
Expert
Member's Avatar

France
Joined: Nov 7, 2005
Post Count: 9181
Status: Offline
Reply to this Post  Reply with Quote 
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
[Nov 13, 2023, 11:36:14 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Keet
Advanced Member
Member's Avatar

Netherlands
Joined: Apr 8, 2022
Post Count: 789
Status: Offline
Reply to this Post  Reply with Quote 
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.

This is how it looks: https://www.mediafire.com/view/u2eijuc5i06cgkn/LedClock.png/file
and here is the Furniture Library: https://www.mediafire.com/file/398nxp59l2iiect/DodecagonLeds.sh3f/file
[Nov 13, 2023, 2:07:16 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Keet
Advanced Member
Member's Avatar

Netherlands
Joined: Apr 8, 2022
Post Count: 789
Status: Offline
Reply to this Post  Reply with Quote 
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?
[Nov 20, 2023, 9:39:49 AM] Show Printable Version of Post    View Member Profile    Send Private Message [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-2024 eTeks - All rights reserved