Loading multiple models in a single file

Software: Away3D 4.x

Avatar
Apprentice, Jr. Member
Posted: 19 August 2011 02:10 PM   Total Posts: 45

I’m loading a single OBJ file with multiple objects in it. I’m using the AssetLibrary which feeds me each object seperately as a mesh in each ASSET_COMPLETE event. I’m doing this in a preloader, but is there any way of knowing how many assets there are in a single OBJ file? Because currently I don’t know when all objects in this OBJ file have been loaded (without hard-coding it). Previously I simply used one object per OBJ file, but it would be nice to export multiple objects at once (apart from the object names (obj0, obj1, ...) but I saw it’s under consideration).

I can think of work-arounds, but perhaps I’ve missed something or if not: perhaps this would be nice to have?

—Apprentice

   

Richard Olsson, Administrator
Posted: 20 August 2011 01:12 PM   Total Posts: 1192   [ # 1 ]

There is no way of knowing how many objects are in an OBJ file before the entire file has been parsed, and by the time that happens you will get a RESOURCE_COMPLETE event from the loader that you’re using.

   

Avatar
Apprentice, Jr. Member
Posted: 22 August 2011 07:24 AM   Total Posts: 45   [ # 2 ]

Ah, you’re right.
And I don’t need to know the amount of objects in an OBJ file beforehand, I only need to know when it’s done loading. The RESOURCE_COMPLETE event will do nicely, thanks.

—Apprentice

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X