Upgraded to gold , now scene is blank

Software: Away3D 4.x

Avatar
mrpinc, Sr. Member
Posted: 17 July 2012 07:03 PM   Total Posts: 119

I upgraded my app to use the latest (gold) release of Away3D but after loading all my obj files I no longer see anything in my scene.

I was wondering if anything changed with either parsing OBJ files or if something else has changed in regards to rendering.

Looking at the example code it does not seem like anything is different.  All when compiling the code I get no warnings or errors.

   

Richard Olsson, Administrator
Posted: 17 July 2012 10:24 PM   Total Posts: 1192   [ # 1 ]

Are you running a debug player so that you would notice if any errors were thrown? What version of the codebase were you using before?

   

Avatar
mrpinc, Sr. Member
Posted: 18 July 2012 01:20 PM   Total Posts: 119   [ # 2 ]

Yes i am running debug player. I work in FlashDevelop with latest SDK + Debug Player

According to Away3D.as

Major Version 4
Minor Version 0
Revision 6

I got this version on June 6

   

Richard Olsson, Administrator
Posted: 18 July 2012 01:32 PM   Total Posts: 1192   [ # 3 ]

Can you try loading something else (using another file format) and/or just displaying a primitive to make sure that it’s not rendering, but possibly the OBJParser, that is causing your problems?

   

Avatar
mrpinc, Sr. Member
Posted: 18 July 2012 02:18 PM   Total Posts: 119   [ # 4 ]

I will try later as I am trying to upgrade an existing project.

One thing I can tell you is that the models load fine in the current version of perfab 3d

   

Avatar
Fabrice Closier, Administrator
Posted: 18 July 2012 02:38 PM   Total Posts: 1265   [ # 5 ]

If its loading as obj in Prefab, try reexport as obj from Prefab. and see if you still get the errors. Note that the current version 2.116 is not running on 4.0.6. I’m in the process of an update as we speak…

   

synkarius, Member
Posted: 19 July 2012 08:47 PM   Total Posts: 64   [ # 6 ]

I too have run into this problem. They’re all getting added with no bumps via scene.addChild(), but when I measure them with Bounds, they all have width, height, and depth of 0.

EDIT: Okay, try this. If you’re assembling your .obj files in pieces, like I am, first geometry, then bitmapdata, then combine:...

PSEUDOCODE:
Parse Obj
Add Obj Geom to lib
Parse BitmapData
Add BitmapDataAsset to lib
Combine Geom 
BitmapDataAsset to make Mesh
Add Mesh to lib
Remove Geom 
BmDA from lib 

... then the problem might be that previously, removing geom and bmda from the AssetLibrary didn’t dispose them, but now it does. So when you remove them in this process, do this:

AssetLibrary.removeAsset(_geom,false);
AssetLibrary.removeAsset(_bmda,false); 

That worked for me anyway.

   

jong2x, Newbie
Posted: 20 July 2012 09:22 AM   Total Posts: 6   [ # 7 ]

Hi,

I’m also stuck with this… Please help.

I didn’t really grasp the whole solution provided by @synkarius. Right now, if I’m publishing the program with Away3D Beta 4.0, the OBJ format is working correctly. But if i switched to GOLD version, it doesn’t work.

I noticed that the AssetEvent.ASSET_COMPLETE now returns a different OBJECT.

LOADER3D.addEventListener(AssetEvent.ASSET_COMPLETEonModelParseComplete);

private function 
onModelParseComplete (e:AssetEvent):void {
 e
.asset.assetType // on BETA returns a Mesh object
 
e.asset.assetType // on GOLD returns a Geometry object


Can you give me an example how we load OBJ format in Gold?

   

jong2x, Newbie
Posted: 20 July 2012 09:25 AM   Total Posts: 6   [ # 8 ]

Hi,

I’m also stuck with this… Please help.

I didn’t really grasp the whole solution provided by @synkarius. Right now, if I’m publishing the program with Away3D Beta 4.0, the OBJ format is working correctly. But if i switched to GOLD version, it doesn’t work.

I noticed that the AssetEvent.ASSET_COMPLETE now returns a different OBJECT.

LOADER3D.addEventListener(AssetEvent.ASSET_COMPLETEonModelParseComplete);

private function 
onModelParseComplete (e:AssetEvent):void {
 
// on BETA (e.asset.assetType == Mesh)
 // on GOLD (e.asset.assetType == Geometry)


Can you give me an example how we load OBJ format in Gold?

   

synkarius, Member
Posted: 20 July 2012 01:52 PM   Total Posts: 64   [ # 9 ]

Jong2x, you’re right that the AssetEvent now returns a Geometry. What’s working for me is this:

private var geom:Geometry;

private function 
assetParseComplete(e:AssetEvent):void { 
   AssetLibrary
.removeEventListener(AssetEvent.ASSET_COMPLETEassetParseComplete);
geom e.asset as Geometry;

var 
bmdParser:Loader = new Loader();
bmdParser.contentLoaderInfo.addEventListener(Event.COMPLETE,bmdParseComplete,false,0,true);
bmdParser.load(new URLRequest("bmd.png"));
}

private function bmdParseComplete(e:Event):void {
e
.target.removeEventListener(Event.COMPLETEbmdParseComplete);
var 
m:Mesh = new Mesh(geom, new TextureMaterial(new BitmapTexture(e.target.content.bitmapData)));
scene.addChild(mesh);

 

   

Avatar
mrpinc, Sr. Member
Posted: 10 August 2012 01:30 PM   Total Posts: 119   [ # 10 ]

I am not using the AssetLibrary but using a Loader3D.  I am also relying on the internal parser to load the materials on it’s own.  This worked fine in Beta but now causing the above mentioned problem in Gold.  Is there any advice on getting it to work?

   

Avatar
mrpinc, Sr. Member
Posted: 10 August 2012 03:08 PM   Total Posts: 119   [ # 11 ]

I should also point out that even non obj assets are not showing up.  I have a skybox for example and that is not being rendered.

   

Avatar
mrpinc, Sr. Member
Posted: 10 August 2012 03:53 PM   Total Posts: 119   [ # 12 ]

Well don’t i feel silly.  Turns out my code was setting the Away 3D view.visible to false.  For whatever reason this didn’t work in the beta so it would not disappear.

Only thing though is now all the textures for my loaded OBJ files are completely messed up, and don’t map correctly at all.

 

   

Avatar
mrpinc, Sr. Member
Posted: 10 August 2012 04:06 PM   Total Posts: 119   [ # 13 ]

Another note,  if I take the OBJ into Prefab3D it looks fine.  I then export it as AWD2 format and load that in my scene, and that works fine as well. 

   

synkarius, Member
Posted: 10 August 2012 05:51 PM   Total Posts: 64   [ # 14 ]

That’s bizarre. Can you post one of the .obj files with its texture?

   

Avatar
mrpinc, Sr. Member
Posted: 10 August 2012 06:22 PM   Total Posts: 119   [ # 15 ]

This works fine in prefab.

http://encodable.com/cgi-bin/filechucker.cgi?action=landing&path;=/&file=cbreaker.zip

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X