Joined: Jul 24, 2016
Post Count: 13
Status:
Offline
import Arbaro files with colors
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?
Joined: May 12, 2013
Post Count: 1545
Status:
Offline
Re: import Arbaro files with colors
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:
mtllib mytree.mtl
Create mytree.mtl (placed in the same directory as mytree.obj):
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 mtllib mytree.mtl should work for any arbaro file that has a correct mtllib mytree.mtl 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 Modify furniture - Materials modify dialogue.
Joined: May 12, 2013
Post Count: 1545
Status:
Offline
Re: import Arbaro files with colors
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.