Unable to parse 3DS files

Software: Away3D 4.x

wagster, Member
Posted: 05 October 2011 10:53 PM   Total Posts: 68

I can’t get a mesh out of ANY 3ds file, mine made with Blender or a downloaded one.

Here’s the code:

package ie.aro.floorplanviewer.controller
{
 import away3d
.events.AssetEvent;
 
import away3d.events.LoaderEvent;
 
import away3d.library.AssetLibrary;
 
import away3d.library.utils.AssetLibraryIterator;
 
import away3d.loaders.parsers.Max3DSParser;
 
 
import flash.net.URLRequest;
 
 
import ie.aro.floorplanviewer.model.BuildingModel;
 
 
import org.robotlegs.mvcs.Command;

 public class 
Load3DModelsCommand extends Command
 {
  [Inject]
  
public var buildingModel:BuildingModel;
  
  private var 
_furnitureMap:XML;
  
  
override public function execute():void
  {
   
   
//_furnitureMap = buildingModel.furnitureMap;
   
AssetLibrary.enableParser(Max3DSParser);

   
AssetLibrary.addEventListener(AssetEvent.ASSET_COMPLETEonAssetComplete);
   
AssetLibrary.addEventListener(LoaderEvent.RESOURCE_COMPLETEonResourceComplete);
   
AssetLibrary.load(new URLRequest("data/armchair_29.3DS"));
    

  
}
  
  
private function onAssetComplete(e:AssetEvent):void
  {
   trace
("Asset Complete");
  
}
  
  
private function onResourceComplete(e:LoaderEvent):void
  {
   trace
("Resource Complete");
   var 
assetIterator:AssetLibraryIterator AssetLibrary.createIterator();
   
trace("Meshes in library: " assetIterator.numAssets);
  
}
 }

Don’t worry - the listeners and all aren’t staying in the command - they’ll be moved out.  And yes, the command isn’t getting garbage collected.

I’m getting the RESOURCE_COMPLETE event ok, but no ASSET_COMPLETE events, and the assetIterator is counting zero assets.

I’ve tried the Max3DSParser and enableAllParsers as well - same result.

Any ideas? (If everyone but me isn’t partying at Max…!)

   

Avatar
maddog, Sr. Member
Posted: 06 October 2011 02:10 AM   Total Posts: 118   [ # 1 ]

Same here I tried exporting 3ds models from blender and Lightwave and could not get them to load right. But if i go back to away3d 3.6 they load. material just does not show up on model. And for some reason models are mirrored.

 

   

texnl, Newbie
Posted: 06 October 2011 06:08 AM   Total Posts: 6   [ # 2 ]

When i updated my code to the newest GIT it made my 3DS models not to load. After RESOURCE_COMPLETE event dispatched loader3D always has 0 children. But if i roll back to 3-week ago GIT, everything works ok. I use 3ds models exported from 3dmax without texture dependencies. My model consists of multiple objects.

 

   

Avatar
Choons, Sr. Member
Posted: 06 October 2011 07:41 AM   Total Posts: 281   [ # 3 ]

I’m having the same problem as well. I updated to the latest player, playerglobal.swc, and github but no go on 3ds files

 

   

wagster, Member
Posted: 06 October 2011 08:07 AM   Total Posts: 68   [ # 4 ]

Excellent - it’s not just me then! I’ll keep working on my non-3DS stuff until this gets resolved.

 

   

Richard Olsson, Administrator
Posted: 06 October 2011 04:12 PM   Total Posts: 1192   [ # 5 ]

Please supply us with the 3DS files that are not working, and we can have a look. There is no way of knowing from your code what goes wrong.

 

   

texnl, Newbie
Posted: 06 October 2011 04:32 PM   Total Posts: 6   [ # 6 ]

Sure, model in attachment.
When i change all source folders to new ones exept “loaders” it keeps working fine, but when i update “loaders” nothing shows - Resourse.complete dispatches with 0 children, Asset.complete is not dispatching at all.

 

File Attachments
02.3ds  (File Size: 65KB - Downloads: 0)
   

Avatar
Choons, Sr. Member
Posted: 06 October 2011 06:55 PM   Total Posts: 281   [ # 7 ]

the 3ds files I tried are the ones in my F-16 demo that Rob put in the demo reel so I know they are good. I’m using the exact same AssetLibrary code approach that wagster posted

 

   

wagster, Member
Posted: 06 October 2011 07:36 PM   Total Posts: 68   [ # 8 ]

Sure Richard, I’ve tried these four:

http://dl.dropbox.com/u/3372150/3ds.rar

Using Away3D from Git about 3 days ago.

Thanks!

 

   

empend, Member
Posted: 06 October 2011 08:04 PM   Total Posts: 77   [ # 9 ]

I’m having a problem loading a 3ds file as well.
I have no idea why its doing it…
I make the smallest difference in the model, and export it, then it doesn’t work.

For me the events get called as if everything went smoothly, but the LoaderEvent.LOAD_ERROR event also gets called.

Could anyone help me out?

 

   

Avatar
Choons, Sr. Member
Posted: 06 October 2011 08:08 PM   Total Posts: 281   [ # 10 ]

preFab is a great way to confirm first off whether the model is OK so I’d suggest testing that way as well. There is clearly some kind of 3ds bug happening though since the new player hit

 

   

empend, Member
Posted: 06 October 2011 09:04 PM   Total Posts: 77   [ # 11 ]

The 3D file works with everything else.
I guess I’ll just have to wait until its fixed with Away3D 4…
Please try to fix it quickly!
Thanks a lot!

 

   

Avatar
maddog, Sr. Member
Posted: 07 October 2011 12:49 AM   Total Posts: 118   [ # 12 ]

Here is a model I can’t get texture to load to. If someone could test it and let me know what I am doing wrong. It does load fine in prefab, and I can texture it there, but not in away3d4 with flash 11. Thanks for anyone that can help.

 

File Attachments
HOWwellnessFINAL.3ds  (File Size: 16KB - Downloads: 0)
   

Avatar
Fabrice Closier, Administrator
Posted: 07 October 2011 10:59 PM   Total Posts: 1265   [ # 13 ]

There is a known issue with the LoaderEvent.RESOURCE_COMPLETE. It may in some cases return a null object event.currentTarget. Occurs often with low polys models, the event seams to be triggered too early. It seams, not saying that is the reason. But there is a fix if you set a AssetEvent.MESH_COMPLETE you will get the resource every time. You will have to add a switch and test on names if you have more meshes in there.

Finally if this fails too, try to export without map(s), embed it/them instead. Another issue occurs with relative url’s. The code adds an extra “/” causing a loading failure. To make sure this is not the case, make sure you set a LoaderEvent.LOAD_ERROR. All these will be fixed in comming days.

 

   

Avatar
maddog, Sr. Member
Posted: 08 October 2011 03:12 AM   Total Posts: 118   [ # 14 ]

Just wondering since the low poly seems to be part of my issue How many polys does my model need before it is no longer a issue?  I tried using AssetEvent.MESH_COMPLETE, but it does not seem to change loading problem for me at least. Thanks for all your hard work.

 

   

empend, Member
Posted: 08 October 2011 04:36 AM   Total Posts: 77   [ # 15 ]

The extra “/” thing I noticed.

Checking for different events didn’t help…

I hope you guys get this fixed soon!
Thanks a lot.

 

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X