|
Sweet Home 3D Forum » List all forums » » Forum: Features use and tips » » » Thread: AOI - colored objects? |
|
| Print at Jan 30, 2026, 1:50:37 PM | |
| Posted by pencilart at Oct 12, 2007, 1:01:00 AM |
|
AOI - colored objects? I've been trying to get my objects colored (in Art Of Illusion) so that when SH3D imports it, then the user does not have to set a color if they want. Each time I import the object, it is white instead of the color I thought I had set for it in A.O.I. puybaret, how have you been doing it? [Note: this thread was started on sourceforge.net forums] |
| Posted by Puybaret at Oct 12, 2007, 9:27:00 PM |
|
Re: AOI - colored objects? Ok, I'll give here more details about the answer I posted yesterday at https://sourceforge.net/forum/message.php?msg_id=4562508 I you want to add colors to your OBJ models, you should open an OBJ file you generated in a text editor and study the tokens "g" and "usemtl" of the OBJ format described at http://download.java.net/media/java3d/javadoc...bjectfile/ObjectFile.html . The token "g" followed by a text, describes the name of a part of the object. For example in the railing.obj file you created, there is a line "g Cube_1". To specify the color of a part, add a new line under a line starting by "g", and type in that line "usemtl" followed by a space and the name of one of the colors described in OBJ format. Here is the list of supported colors : amber amber_trans aqua aqua_filter archwhite archwhite2 bflesh black blondhair blue_pure bluegrey bluetint blugrn blutan bluteal bone bone1 bone2 brass brnhair bronze brown brownlips brownskn brzskin chappie charcoal deepgreen default dkblue dkblue_pure dkbrown dkdkgrey dkgreen dkgrey dkorange dkpurple dkred dkteal emerald fgreen flaqua flblack flblonde flblue_pure flbrown fldkblue_pure fldkdkgrey fldkgreen fldkgreen2 fldkgrey fldkolivegreen fldkpurple fldkred flesh fleshtransparent flgrey fllime flltbrown flltgrey flltolivegreen flmintgreen flmustard florange flpinegreen flpurple flred fltan flwhite flwhite1 flyellow glass glassblutint glasstransparent gold green greenskn grey hair iris jetflame lavendar lcdgreen lighttan lighttan2 lighttan3 lighttannew lightyellow lime lips ltbrown ltgrey meh metal mintgrn muscle navy_blue offwhite.cool offwhite.warm olivegreen orange pale_green pale_pink pale_yellow peach periwinkle pink pinktan plasma purple red redbrick redbrown redorange redwood rubber ruby sand_stone sapphire shadow ship2 silver skin sky_blue smoked_glass tan taupe teeth violet white yellow yellow_green yellowbrt yelloworng For example in the railing.obj file you created, if you want the color of the part "Cube_1" be grey, you should add the line : usemtl grey As long as you don't add any other line starting by "usemtl" token, all the other following parts will be colored with the previously specified color. Thus, if you want to change the colors of the other parts, you should add other lines starting by "usemtl". Once, you have finished with these "usemtl" lines, save your file and try it in Sweet Home 3D Import furniture wizard. To help you choose a color, please download the image http://sweethome3d.sourceforge.net/Java3DCubeColorsWithTransparency.png : it shows all the colors listed above. You'll see that among these colors, some are transparent. You may use these colors for window panes. You can also name a part with a name starting by "sweethome3d_window_pane" to make that part transparent, as in the example http://sweethome3d.cvs.sourceforge.net/sweeth...content-type=text%2Fplain , that matches the "Double window" of Sweet Home 3D. Finally, don't hesitate to open the Sweet Home 3D OBJ files available at http://sweethome3d.cvs.sourceforge.net/sweeth...sweethome3d/io/resources/ , and the ones available at http://sweethome3d.sourceforge.net/importModels.html to view some real examples. ---------------------------------------- Emmanuel Puybaret, Sweet Home 3D creator |
| Posted by pencilart at Oct 12, 2007, 10:04:00 PM |
|
Re: AOI - colored objects? Thank you so much! The coloring of the railing worked. I will look at the rest of what you told me about transparency in windows. I'm working on a really cool looking 5 pane window with a curved window above the main pane. They are rather popular in home construction in my area. This is a preview of what I want it to look like (I'm not done with it yet): http://www.storm-artists.net/view/39805 I'm sorry I didn't realize that you had to edit the text file itself. I thought it could be done by the Art Of Illusion program itself. |
| Posted by Puybaret at Oct 13, 2007, 12:00:00 AM |
|
Re: AOI - colored objects? One more thing about windows : In the current version of Sweet Home 3D (and that probably won't change before a long time), the intersection between a window and a wall is computed from the bounding box of the window. This means that the hole in a wall where the window is placed is always rectangular. For the windows set you want to create, you'll have to add in your 3D model some wall parts at the left and the right of the rounded part of the upper window, otherwise these parts will appear as holes in Sweet Home 3D. The drawback of this way of doing is that these two parts won't be automatically of the same color as the wall the window is placed into (personally, I would set a white color on these two parts, because most people have white painted walls). I hope my explanations are clear enough... ;-) ---------------------------------------- Emmanuel Puybaret, Sweet Home 3D creator |
| Posted by pencilart at Oct 13, 2007, 1:14:00 AM |
|
Re: AOI - colored objects? I've edited the .obj text file for the window panes but they still aren't transparent. I've studied your example for the part: g sweethome3d_window_pane usemtl flltgrey and I've made mine exactly like that but it's not working. The colors for the other parts work nicely though. :D |
| Posted by pencilart at Oct 13, 2007, 1:51:00 AM |
|
Re: AOI - colored objects- n/m ok, I just tried changing the names of the window panes in the AOI program and THEN exporting it and then I plugged in the necessary changes for the window panes and wood areas. It works now, the panes are transparent. Just like you said, the arched area had a hole in it, lol. I will fix that later according to your directions. Thank you again! Another question (sorry to keep you so busy) About the depth: When I import the window, the depth is extremely small (.0something), unlike yours, which is about 10 inches. I'm just wondering about that. I do make changes before finishing the import though. |
| Posted by Puybaret at Oct 13, 2007, 2:09:00 AM |
|
Re: AOI - colored objects? > (sorry to keep you so busy) Don't worry, answering your questions may help other users... ;-) The depth (and other sizes) displayed in import furniture wizard comes directly from the OBJ file, and therefore from the sizes you used in Art Of Illusion. I added the ability to change the size of a model in the import wizard because most imported models haven't a realistic size. Most models I designed have the same problem, but their size is set in a property file like this one : http://sweethome3d.cvs.sourceforge.net/sweeth...og.properties?view=markup ---------------------------------------- Emmanuel Puybaret, Sweet Home 3D creator |
| Posted by Puybaret at Oct 13, 2007, 1:37:00 PM |
|
Re: AOI - colored objects? Maybe you should add a solid frame around your window, like I did for the double-hung window (see http://sweethome3d.cvs.sourceforge.net/sweeth...content-type=text%2Fplain for its OBJ file), and choose a depth for this frame equal to default wall thickness. ---------------------------------------- Emmanuel Puybaret, Sweet Home 3D creator |
| Posted by pencilart at Oct 15, 2007, 7:17:00 PM |
|
Re: AOI - colored objects? I just tried that but it didn't work. The area inside the box was treated as a window also, not solid. I did not know (yet) the right way to add the solid box area around that curve. btw, can you carve out an area (like a curve) from a solid box in AOI? If there is a way, I'd like to find the tutorial that tells you how. |
| Posted by Puybaret at Oct 16, 2007, 8:23:00 PM |
|
Re: AOI - colored objects? I'm not sure I fully understand what you mean by "carve out", but I think you should use Tools > Boolean modelling menu : - select all your objects and create a temporary object that matches the union of all these objects with Tools > Boolean modelling - create a thin box around the objects - select the union object and the thin box and use the option First - second or Second - first in Tools > Boolean modelling dialog - hide or delete the union and the thin box ---------------------------------------- Emmanuel Puybaret, Sweet Home 3D creator |
| Posted by pencilart at Oct 16, 2007, 8:43:00 PM |
|
Re: AOI - colored objects? Great!! thank you so much! I will try that. |
| Posted by pencilart at Oct 17, 2007, 6:13:00 PM |
|
Re: AOI - colored objects? ok, I tried it and this is a snapshot of the result: http://i64.photobucket.com/albums/h186/gymnart/spst-wndows-trees.jpg At least there's a frame around the whole thing and I can live with that. :) Anyway, if you like it, I can submit it for the repository. |
| Posted by Puybaret at Oct 17, 2007, 8:35:00 PM |
|
Re: AOI - colored objects? It looks very nice. Submit it for the repository if you want. ---------------------------------------- Emmanuel Puybaret, Sweet Home 3D creator |
| Posted by Alv20 at Jan 28, 2011, 11:19:01 AM |
|
Re: AOI - colored objects? Please, where can i download this: To help you choose a color, please download the image http://sweethome3d.sourceforge.net/Java3DCubeColorsWithTransparency.png : it shows all the colors listed above. 404 Not found! Thanks, |
| Posted by hansmex at Jan 28, 2011, 11:38:45 AM |
|
Re: AOI - colored objects? Alv, This link works. Hans ---------------------------------------- Hans new website - under constuction hansdirkse.info |
| Posted by Alv20 at Jan 28, 2011, 12:13:58 PM |
|
Re: AOI - colored objects? Ok, thanks!! |
| Posted by okh at Dec 9, 2013, 2:17:54 PM |
|
Re: AOI - colored objects? When making models, I have so far tended to use material names that match the part of the furniture, e.g. usemtl desktopDoes anyone have an opinion on which approach is better? Does using the predefined colours have advantages in terms of performance (no .mtl file for SH3D to worry about)? Other good reasons for sticking to the defaults instead of named furniture parts? ok |
| Posted by Puybaret at Dec 9, 2013, 7:05:25 PM |
|
Re: AOI - colored objects? Predefined colors were mandatory when Sweet Home 3D wasn't able to import .mtl files (before version 1.3). As from version 4.0, it's also possible to modify the materials of a piece of furniture from Sweet Home 3D user interface, I guess your idea to name materials from their function rather from their color is a good idea. I did it myself for a few 3D models last summer, and in the bunk beds model (and a few other ones), I even used different names for the materials of the two beds even if their colors are the same. This way the user have more choice of customization. I wouldn't worry for the performance loss, it's probably not significant. ---------------------------------------- Emmanuel Puybaret, Sweet Home 3D creator |
| Posted by okh at Dec 9, 2013, 7:46:44 PM |
|
Re: AOI - colored objects? Thanks. Then I will stick to my "named parts" approach (and not change existing models). And yes, I also use different names for the same colours, for instance back and front of a door-frame, in case I need to repaint on the orders of she who must be obeyed :-) ok |
| Posted by Theduck38 at Dec 13, 2013, 11:29:11 PM |
|
Re: AOI - colored objects? Hello all I am very proud for having created my own window with a trapeze shape ...But I still have a minor issue : I opened a .obj SH3D window to find the colour used for the glass. I found : flltgrey. But when using this colour for my glass, it is finally much more transparent than the SH3D's library windows... why ? Did I use an incorrect color ? Must my glass be thicker in order to have another colour aspect ? |
| Posted by okh at Dec 14, 2013, 9:47:14 AM |
|
Re: AOI - colored objects? ...much more transparent than the SH3D's library windows... why ? Did I use an incorrect color ? Must my glass be thicker in order to have another colour aspect ? Congratulations on your trapeze window. You did not mention your transparency setting. SH3D windowpanes have a transparency of 50% (I think). If this is not possible from within your modelling software, this thread has hints on changing transparency in the .mtl file. Below values I've found in a SH3D window. newmtl flltgreyok |
| Posted by Theduck38 at Dec 15, 2013, 11:26:32 PM |
|
Re: AOI - colored objects? Hi, In fact I followed the tutorial on this site to make a 3D object with Art Of Illusion, and modified the glass object of the exported .obj file with these lines : g sweethome3d_window_paneI took the colour 'flltgrey' from another SH3D window object. But mine is not rendering the same. The tutorial does not give way to change the transparency of the object and the window I choose seems to have no more info than coordinates and 'unsemtl' values... I found on some other models that you can specify a mtl library file inside the .obj file, but it seems not to be the case of most windows used in SH3D, like the example I took (called 'doublewindow 126x163'). ...but I don't understand what I need to do with my .obj file to get the same material as the library provided windows... |
| Posted by Theduck38 at Dec 15, 2013, 11:53:55 PM |
|
Re: AOI - colored objects? OK, I finally solved this... thanks to your hints !!! I created a .mtl file with your data inside, and added 'mtllib filename' at beginning of my .obj file. But the final trick is that the 50% transparent effect is visible on render only if when I position the window, I orient the 'black part' at the outside of the wall... I try to say it better : when you add a window, there's a thicker black line that can be either side of the wall. In my case, if this thicker black line is positioned inside the house, I get a totally transparent glass (seen from outside). If the black line is outside, I get the correct 50% transparency. Is it expected behaviour ? |
| Posted by okh at Dec 16, 2013, 8:35:52 AM |
|
Re: AOI - colored objects? Oops, sorry, I forgot to mention mtllib reference in the .obj file (I assumed you had both files already). No, not expected behaviour. Are you sure that BOTH sides of the glass (windowpane) have been assigned the same, transparent colour name? If you share a simple wall sh3d file with your model, it is probably easier to figure out what happened. ok |
| Posted by Theduck38 at Dec 16, 2013, 11:29:09 PM |
|
Re: AOI - colored objects? Hello, Here is an example... it seems you are right, and the glass hasn't a 50% transparent property on both sides... Wall with Trapeze window How can I correct this ? |
| Posted by hansmex at Dec 17, 2013, 12:06:49 AM |
|
Re: AOI - colored objects? When I open the file, the window is transparent from both sides. H ---------------------------------------- Hans new website - under constuction hansdirkse.info |
| Posted by Theduck38 at Dec 17, 2013, 12:29:19 AM |
|
Re: AOI - colored objects? Ho ho... I imported a zip file containing a .obj and a .mtl in my sh3D wall test. My renderer showed it different if seen on different sides. If I download it again from my server, change the ground to display a green texture, I still have the transparency difference... What did I miss when exporting ? Could there be a local file that enables my 'selective side transparent view' |
| Posted by okh at Dec 17, 2013, 11:58:50 AM |
|
Re: AOI - colored objects? It looks to me as if you have a one sided object (window pane): transparent glass (verre) on one side and nothing on the other side. If you can define and add material to the other (invisible) side of the glass, it should be ok. ok |
| Posted by Theduck38 at Dec 17, 2013, 6:53:29 PM |
|
Re: AOI - colored objects? Hello, You were right... I used for the glass a polygon instead of a cube as a primitive... my noobish fault ! Problem is now solved with a 3D object as window glass. Thanks for your help, okh and hansmex ! |
|
|
Current timezone is GMT Jan 30, 2026, 1:50:37 PM |