Re: import Arbaro files with colors

by okh » Mon May 29, 2017 9:59 am

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