Problem loading models- any models

Software: Away3D 4.x

Drumbo, Newbie
Posted: 22 April 2012 02:08 AM   Total Posts: 17

I can’t seem to get any models to load in any format. I’ve no idea if it’s an Away3D thing, or something related to 3D graphics in general, or something else. Here’s the code:

public override function load():void {
   
   Parsers
.enableAllBundled();
   
   
loader3d = new Loader3D();
   
loader3d.addEventListener(LoaderEvent.RESOURCE_COMPLETEloadComplete);
   
loader3d.addEventListener(LoaderEvent.LOAD_ERRORloadFailed);
   
loader3d.load(new URLRequest("assets/stall.obj"));
  
}
  
  
public function loadFailed(evt:Event):void {
   trace
(evt.formatToString);
   
trace('oh no, not again');
  
}
  
  
public override function loadComplete(evt:Event null):void {
   trace
(evt.type);
  

Doing this results in an error:

[Fault] exceptioninformation=ErrorError #2032: Stream Error. URL: file:///C|/Stuff/Away3DTest/bin/assets/. 

...which is clearly not the thing I’ve asked it to look for. FlashDevelop brings up AssetLibrary.as with the cursor next to this block:

/**
   * Called when a an error occurs during dependency retrieving.
   */
  
private function onDependencyRetrievingError(event LoaderEvent) : void
  {
   
// TODO: not used
   //var ext:String = 
   
event.url.substring(event.url.length-4event.url.length).toLowerCase();
   if (
hasEventListener(LoaderEvent.LOAD_ERROR)){
    dispatchEvent
(event);
   
}
   
   
else throw new Error(event.message);
  

It does the same thing with 3DS files.

The files are definitely there. I can get Flash to see them with a standard Loader object. Moreover, If I try using a nonsense URL, I get the following:

[Fault] exceptioninformation=ErrorError #2032: Stream Error. URL: file:///C|/Stuff/Away3DTest/bin/assets/nnnnnnnnnnnngh 

To be clear, the files in the directory are a crossdomain.xml, stall.mtl, stall.obj, stall_please_work.3ds and texture.png. They’ve been exported from Blender. I can get them to load in preFab, so they’re perfectly sound from what I can tell.

Has anyone got any idea what I could be doing wrong here? The only example I can find for Away3D 4 uses embedded assets, and that’s not really a solution.

Thanks in advance for any help smile

   

blumersolutions, Newbie
Posted: 22 April 2012 07:02 AM   Total Posts: 13   [ # 1 ]

Hi,
I’m also having issues with away3d loading 3D assets.
Did you tried to use another format? (ie awd). Check the away3d examples for some code.
HTH.

   

Drumbo, Newbie
Posted: 22 April 2012 09:17 AM   Total Posts: 17   [ # 2 ]

No- as far as I can tell, for AWD and Blender there is a mysterious Python file with no instructions.

I just tried this: since I created my models in SketchUp and moved them into Blender for texturing, I tried creating a simple sphere in Blender, doing a uv-unwrap and exporting the results as 3ds.

It worked. You can imagine how I feel about this. I’m going to try going through the process again and let you know what happens.

   

blumersolutions, Newbie
Posted: 22 April 2012 09:28 AM   Total Posts: 13   [ # 3 ]

Great! is nice to hear some good news.
Keep in mind that 3ds will give you just a static object. If you need animation, you’ll need awd or md5mesh-md5anim (or collada, but as far as I can tell is not longer supported on away3d 4, could anyone confirm?).

 

   

Drumbo, Newbie
Posted: 22 April 2012 09:32 AM   Total Posts: 17   [ # 4 ]

That did indeed seem to be the problem- or at least one of the problems. I’ll try again with the trial of sketchup pro and exporting as something that isn’t COLLADA

   

Drumbo, Newbie
Posted: 22 April 2012 11:56 AM   Total Posts: 17   [ # 5 ]

Nope. Sketchup just seems to be exporting unusable data, unfortunately, or maybe Blender doesn’t mix well with it. I’ve tried forcing it to output double-sided polygons, but that doesn’t fix it. I’ve used Blender to convert textures to quads, changing the model, but that doesn’t work either.

I’ve been able to load and manipulate other models fine now.

Importing directly from SketchUp is a nightmare- the 3ds files still don’t load, and while the obj files do… they’re invisible.

Basically, then, a bit of a farce. You can create wonderful prefabs in minutes in Sketchup, but spending eight hours trying to get them to work rather offsets that.

If someone has a solution, please let me know smile

   

Drumbo, Newbie
Posted: 22 April 2012 11:58 AM   Total Posts: 17   [ # 6 ]

Also, yes, I don’t think COLLADA is supported any more.

   

Avatar
Fabrice Closier, Administrator
Posted: 22 April 2012 07:21 PM   Total Posts: 1265   [ # 7 ]

Collada parser will be soon added back to Away3D.

   

Drumbo, Newbie
Posted: 22 April 2012 07:35 PM   Total Posts: 17   [ # 8 ]

I’ve resolved my problem- Blender was exporting the obj files with a flag saying they were to include textures, and there weren’t any. File gets parsed, doesn’t find any textures, error gets thrown. Same problem with the 3ds files.

The embeds were failing for the same reason, but it’s something I was totally unaware of. So, my question is- how and where should I pack the texture files should I decide to export them in either case, or should I just export them separately?

   

Qbrain, Member
Posted: 22 April 2012 07:53 PM   Total Posts: 92   [ # 9 ]
Fabrice Closier - 22 April 2012 07:21 PM

Collada parser will be soon added back to Away3D.

Good news!

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X