Print at Dec 20, 2025, 8:02:51 PM

Posted by okh at Dec 20, 2018, 9:52:57 AM
Re: Custom made lights?
Lamp models with built in lights are great for simplifying house planning with SH3D. However, if you look at the masters of light they will rarely satisfy themselves with the built in light source properties, but add multiple light sources manually before rendering. So just a warning - for perfect rendering it is probably easier to add lightsources separately. If need be grouped with the model for easier editing in the plan.

If you still wish to add lightsources to the model, you should be able to find out how by studying the links provided. Still, here is a slightly more elaborate description (no programming or Java required) - and off the top of my head (several steps may be superfluous depending on your computer setup and how you work):

  • (Download and) open the FurnitureLibraryEditor.
  • Import the model file (drag and drop) into FurnitureLibraryEditor.
  • Save the file, so you have a file with sh3f extension.
  • Add .zip behind the .sh3f extension (you may have to set Win not to hide known extensions for this to work).
  • Open the library and copy the file called PluginFurnitureCatalog.properties out of the zipped file.
  • Open PluginFurnitureCatalog.properties with a text editor. Notepad does nicely, or PsPad or Notepad++, as long as the editor will save a clean text format.
  • The file will look something like this
id#1=macrodot#spotlight
name#1=Spotlight
category#1=Unknown
icon#1=/Spotlight.png
model#1=/Spotlight/spotlight.obj
multiPartModel#1=true
width#1=13.8
depth#1=43.4
height#1=20.5
movable#1=true
doorOrWindow#1=false
modelSize#1=112080
creator#1=Macrodot

To this list of properties, you need to add the lightSource properties, so it will look something like this:
name#1=Spotlight
category#1=Unknown
icon#1=/Spotlight.png
model#1=/Spotlight/spotlight.obj
multiPartModel#1=true
width#1=13.8
depth#1=43.4
height#1=20.5
movable#1=true
doorOrWindow#1=false
modelSize#1=112080
creator#1=Macrodot
lightSourceX#1=xx.xx
lightSourceY#1=yy.yy
lightSourceZ#1=zz.zz
lightSourceColor#1=#BB9854
lightSourceDiameter#1=dd

Where xx.xx is the placement of the lightsource along the x-axis, yy.yy along the y-axis, and zz.zz along the z axis (height) - see Puybaret's link. Numbers are relative to the dimensions listed above. lightSourceColor#1= should be set to the colour of the light in HTML notation (#RRGGBB) Red, Green, Blue - #FFFFFF is white, #000000 is black (Hex). lightSourceDiameter#= is, well, the diameter of the light. You can use several light-sources in one model adding more values behind xx.xx etc. separated by space. Note the US numeric format using . instead of ,

  • Save the file PluginFurnitureCatalog.properties (make sure it is a clean text format).
  • Copy the file into your .zip file.
  • Rename the .zip file back to a .sh3f file (by removing the .zip extension).
  • Open the .sh3f file with SweetHome3D.
  • Find the model in your list, use it and experiment.
  • You will probably have to go back and re-edit PluginFurnitureCatalog.properties to get it right.
My guess is that you will have too play around with the lightSource properties a bit. The lamp has a pretty flat reflector and getting the light to be directional could be a bit tricky. Ideally, you would want to play with the model itself, adding a reflector and changing the material of the light. If you use enkonyito's brilliant Photo-video rendering plugin, you will have the option of using more light properties (SphereLight/PointLight/TriangleMeshLight) to improve the effect of different light sources.

There may, by the way, be some licensing issues here. Do not know the origin of the model, but keep copyright in mind.

ok