loadin OBJ, numchildren always 1

Software: Away3D 4.x

pool338, Jr. Member
Posted: 05 October 2011 01:38 PM   Total Posts: 37

Hi @all,
i had a flash app with away3d 3.5.5 which loads an obj file and setzt materials lights etc. correctly.

Now i’m trying to do the same in away3d 4 but had no luck so far. The example (LoaderObjTest.as) doesn’t help because “_loader.parseData(...)” is an undefined function ?!

After some searching in the www i found some usefull hints so that i was able to load an obj file. But when i try to set the material to all the meshes i always get “_loader.numChildren = 1”.

My current Version is in attachment.

Thank you for help. I was trying different things for hours now.

 

File Attachments
Main.as  (File Size: 5KB - Downloads: 237)
   

Richard Olsson, Administrator
Posted: 06 October 2011 03:57 PM   Total Posts: 1192   [ # 1 ]

What would you expect it to be? Does the OBJ file contain several objects?

The parseData() method has been renamed to loadData(). The examples that you are looking at are probably the old ones (for Broomstick, the away3d-examples-broomstick repository on GitHub)? Please have a look at the away3d-examples-fp11 repository instead.

If you cannot get it to work, please attach the OBJ (and MTL) files, and file an issue report at GitHub.

 

   

pool338, Jr. Member
Posted: 07 October 2011 06:24 AM   Total Posts: 37   [ # 2 ]

I just checked the latest examples from git…but the LoadObj.as uses embedding source for the models and materials…i have to load them dynamically. Also, “AssetType.MESH” (line 268) doesnt work at my Version (latest from git).

I attach an obj File. It contains 2 modells, but only 1 is loaded.

 

File Attachments
2modelle.obj  (File Size: 469KB - Downloads: 155)
   

Richard Olsson, Administrator
Posted: 07 October 2011 05:13 PM   Total Posts: 1192   [ # 3 ]

I think a recent update must have broken a lot of the loading architecture. I will go over it and fix all of these recent bugs this weekend, and then try to make sure that a breaking change like this never happens again.

 

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X