Joined: Nov 1, 2011
Post Count: 47
Status:
Offline
Translucent
Is it possible to have a light-emitting surface? Not a punctiform source but something uniform that can be sized like any other object/texture. More or less resembling a window with translucent glass. Or even without the light source, is it possible to make a translucent surface and control its opacity?
Joined: Nov 1, 2011
Post Count: 47
Status:
Offline
Re: Translucent
Yeah, the explanation in the v7.0 thread is a little too esoteric for me. How about editing (transparency to translucent) an already made OBJ, with no MTL file to start with? I see the free SketchUp doesn't export in OBJ anymore, including the offline version.
----------------------------------------
[Edit 1 times,
last edit by coldcomfort at Aug 16, 2022, 2:05:33 PM]
Netherlands
Joined: Apr 8, 2022
Post Count: 1353
Status:
Offline
Re: Translucent
How about editing (transparency to translucent) an already made OBJ, with no MTL file to start with?
There's a "cheat" to create a functional MTL file for an existing OBJ file. You can edit both OBJ and MTL files with a simple text editor.
Example for test.obj:
In the OBJ file add a line directly after the top description lines (#) in the OBJ file (if there are any):
mtllib test.mtl
In the OBJ file there are lines starting with "g <a name>". After each "g <a name>" line you can add a line with
usemtl <your name>
For example:
g groupname_1_1_23_3 usemtl TableTop
Each different name you use will become a color/texture property name. You can use a different name for each g or use the same if you want multiple "g's" to have the same texture.
Now create an empty mtl file: test.mtl.
For each <your name> you added in the OBJ file you add a line
newmtl <your name>
Save the file.
Now import the OBJ file into Sweethome3D. Obviously there are no colors or textures yet but you should see the property names you created when you modify the imported object. You can set your colors and textures and when you export the object a new, complete MTL file will be created by Sweethome3D. If you want to add transparence to a specific color/texture just add the line with "d" to that property after Sweethome3D created a correct MTL file and import your object again.
It sounds complex but it's actually very easy. Good luck!
---------------------------------------- Dodecagon.nl 1000+ 3D models, manuals, and projects
Italy
Joined: Nov 17, 2021
Post Count: 465
Status:
Offline
Re: Translucent
I see the free SketchUp doesn't export in OBJ anymore
You can use SH3D as a conversion tool. I'm not sure if it can handle SketchUp supported formats, however you can give a try. The steps are as follow: 1) export the model to any format that SH3D is able to import; 2) import the model into SH3D; 3) add the model to the plan and select it; 4) export the selection as OBJ file using the menu "3D view / Export as OBJ".
Italy
Joined: Nov 17, 2021
Post Count: 465
Status:
Offline
Re: Translucent
the explanation in the v7.0 thread is a little too esoteric for me.
If you are fine with a rectangle shaped light source, you can just import the LightShapes.sh3f library found on the first post. You can use the transparent alternative following the steps described by Keet, however I'm going to explain how to create a light emitting shape for documentation purpose.
If you wish to make a generic object light emitting, it is required that the object contains exactly one material that will emit light. You can have multiple materials, but only one of your choice will emit light. Which one can be declared in 2 places: - in the furniture library that contains the object; - in the home file.
So the light emitting material is not set in the OBJ file, so there is no way to import a OBJ file directly in SH3D and expect it contains a light source.
You can choose any one of the above, but be warned that both require editing some files manually. So you can create your object with any 3D modeling software, but then you have to make your hands dirty. It is quite trivial if you follow the steps. I will detail the first method, since the second one has been described by PUYBARET on his post.
First, download the Furniture Library Editor from the "Plug-ins and tools" section. I'm not sure how many 3D formats it can import, however SH3D is capable of importing many and to export as OBJ, so you can use it as a conversion tool if required.
1) create your model using your favourite 3D modelling software, but be sure to assign a single material to the parts that have to emit light; 2) OPTIONAL: convert the model to a format that the Furniture Library Editor can import; 3) launch the Furniture Library Editor, and import the model; 4) edit the imported object by setting all relevant attributes, be sure to set the size and the lights category; 5) save the library; 6) extract the library to a folder using any zip file extractor; 7) edit the PluginFurnitureCatalog.properties using a text editor, locate the block of lines related to the furniture (its' very easy if you have imported just one model into the library) and add the following line: lightSourceMaterialName#1=xxxx where xxxx is the material name you want to be light emitting; 8) save the file; 9) repack all the files as a zip, but be sure to change the extension from ".zip" to ".sh3f". Don't include the parent folder itself, just all the files and folders inside. 10) import the furniture library in SH3D... et voilà!
NOTE: some archive managers let you edit files within zip archives directly without having to extract and pack back again, so you may be tempted to do so. But be aware: SH3D zip reader may not have the capability to read the archives edited this way, and it may ignore any changes made without any warning, so don't try to do it this way.
Joined: Nov 1, 2011
Post Count: 47
Status:
Offline
Re: Translucent
Thanks, both worked like a charm. Kinda embarrassed i didn't think of the second solution myself. I'll have to tackle the light emitting model next, it should prove very useful.
----------------------------------------
[Edit 1 times,
last edit by coldcomfort at Aug 16, 2022, 3:29:34 PM]
Joined: Nov 1, 2011
Post Count: 47
Status:
Offline
Re: Translucent
Strange, the opacity (0.99) is obvious in the 3d viewer, but it seems to make little to no difference when taking a picture with a 30% light source behind it. Still a clear see-through glass.
----------------------------------------
[Edit 1 times,
last edit by coldcomfort at Aug 16, 2022, 3:45:14 PM]
Joined: Nov 1, 2011
Post Count: 47
Status:
Offline
Re: Translucent
Not sure how that helps, but of course. The windows on the left side have the same green tint, but the opacity is unedited. The ones in the center of the picture have a d 0.99. Doesn't seem to make a change except showing off more of the color tint. Also, the opacity is obvious in the 3d view.