Loading Multiple materials from a 3DS or .OBJ

Software: Away3D 4.x

andreahmed, Member
Posted: 14 October 2013 10:30 AM   Total Posts: 62

Hi All,

I have a .OBJ and .3DS I tried different parsers of those files, and I call
numChildren and they always give a 0 output.

The .OBJ has 36 Materials, and 1 Mesh.  I tested also 36 Materials, and 36 Meshes.  Nothing worked.

How Do I change one material in a .obj file in run time ? A code hint would help

Attached the sample files

 

File Attachments
untitled.3DS  (File Size: 13KB - Downloads: 0)
untitled.obj  (File Size: 14KB - Downloads: 149)
untitled.mtl  (File Size: 4KB - Downloads: 152)
   

Avatar
Fabrice Closier, Administrator
Posted: 14 October 2013 11:00 AM   Total Posts: 1265   [ # 1 ]

you have dedicated assets events you can listen to, to access a mesh. If the object that you test is a Mesh, and has no children, it of course returns zero numChildren.
Inspecting your model hierarchy into Prefab or AwayBuilder could also pin point you to some valuable information as well.

   

andreahmed, Member
Posted: 14 October 2013 11:42 AM   Total Posts: 62   [ # 2 ]

Yea but I do want to change the meshes’s texture at runtime too, not only at assestloader event listener, is that possible ?

   

Avatar
Fabrice Closier, Administrator
Posted: 14 October 2013 01:01 PM   Total Posts: 1265   [ # 3 ]

Of course it’s possible, you simply save this mesh or its material.texture as class var or in a vector and reuse that later on.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X