confused import Arbaro files with colors

This topic has been viewed 6237 times and has 3 replies
Thread status: Active
Looking for a particular 3D model or texture? [img]http://www.sweethome3d.com/images/flags/en_small.gif[/img]
Post Reply New Topic
rennmoehre
Posts: 13
Joined: Sun Jul 24, 2016 7:22 am

import Arbaro files with colors

Post by rennmoehre »

Hi,

I tried to import on OBJ file from Arbaro, that works, but the tree has no colors. More precisely the leaves have the same color as the trunk.
How can I create a MTL file for the color?

Thomas
okh
Posts: 1545
Joined: Sun May 12, 2013 9:43 pm

Re: import Arbaro files with colors

Post by okh »

Played with Arbaro a while back, but abandoned it because tree files in general, not only Arbaro, tend to be huge and bloat and slow down SH3D (see SF 3D models 261 for tiny, but not-so-pretty alternatives). That said, Arbaro really is a nice way of making custom trees. There may very well be an easier way of doing what you ask, but I had the same problem and simply made my own .mtl file based on the different materials (usemtl xxx) in the .obj file. For the Arbaro files I generated, there were always four materials used, trunk, stems_1, stems_2 and leaves. So I used a text editor to insert a first line to mytree.obj and create a corresponding mytree.mtl.

Add first line in mytree.obj file:

Code: Select all

mtllib mytree.mtl
Create mytree.mtl (placed in the same directory as mytree.obj):

Code: Select all

newmtl trunk
illum 1
Ka 0.39607844 0.29803923 0.0
Kd 0.39607844 0.29803923 0.0
Ks 0.0078125 0.0078125 0.0078125
Ns 1.0

newmtl stems_1
illum 1
Ka 0.5372549 0.40392157 0.0
Kd 0.5372549 0.40392157 0.0
Ks 0.0078125 0.0078125 0.0078125
Ns 1.0

newmtl stems_2
illum 1
Ka 0.65882355 0.49411765 0.0
Kd 0.65882355 0.49411765 0.0
Ks 0.0078125 0.0078125 0.0078125
Ns 1.0

newmtl leaves
illum 1
Ka 0.31764707 0.5529412 0.18039216
Kd 0.31764707 0.5529412 0.18039216
Ks 0.0078125 0.0078125 0.0078125
Ns 1.0
Provided there are no other options in Arbaro that I missed and you have used in terms of groups, the above [font=courier new]mtllib mytree.mtl[/font] should work for any arbaro file that has a correct [font=courier new]mtllib mytree.mtl[/font] as a first line. The files, of course, do not have to be called mytree.* - the point is that the reference in the .obj file must point to the .mtl file.

Once this was done, the tree imported with colours in SH3D and could be changed in the SH3D [font=courier new]Modify furniture - Materials modify[/font] dialogue.

ok
okh
Posts: 1545
Joined: Sun May 12, 2013 9:43 pm

Re: import Arbaro files with colors

Post by okh »

More compact tests: SF 3D models 261 with the help of arbaro and blender.

1) starting with Wolfram Diestel's quaking aspen xml. Like Puybarets version, only simplified a lot more (brutally) and converted to a birch. At 1071kB uncompressed, less than a third of the size of the original quaking aspen. Of course, not as rich in detal (like my garden birch).
2) a generic tree at < 300 kB uncompressed.

A lot fewer surfaces so these models can work better with SH3D on slower computers - and not bloat files.

Hope is to get a workable model with leaves down to half of the above sizes.

ok

Image
okh
Posts: 1545
Joined: Sun May 12, 2013 9:43 pm

Re: import Arbaro files with colors

Post by okh »

More on this and examples of lightweight trees (and how to edit) in thread 8110. ok
Post Reply New Topic

Who is online

Users browsing this forum: No registered users and 2 guests