Errors When Running Gold Version

Software: Away3D 4.x

John Wilson, Member
Posted: 18 July 2012 08:14 AM   Total Posts: 62

Hi,

I am getting a series of errors using the new gold release that I don’t get when running the code using a version downloaded from the master branch on GitHub a few days ago.

The code, shown below, attempts to load an .obj file, attached,  which I exported from PreFab 2.116.

private function initObjects():void  { 

 ship 
= new ObjectContainer3D();
 
view.scene.addChild(ship);

 
Loader3D.enableParser(OBJParser);  

 
loaderAnchor = new Loader3D(falsenull);
 
loaderAnchor.addEventListener(LoaderEvent.RESOURCE_COMPLETEonAnchorComplete);
 
loaderAnchor.addEventListener(LoaderEvent.LOAD_ERRORonResourceLoadingError);
 
loaderAnchor.load(new URLRequest("assets/anchor/Anchor.obj"));
 
loaderAnchor.scale(1);
}

private function onAnchorComplete(event:LoaderEvent):void
{
 loaderAnchor
.removeEventListener(LoaderEvent.RESOURCE_COMPLETEonAnchorComplete);
 
loaderAnchor.removeEventListener(LoaderEvent.LOAD_ERRORonResourceLoadingError);
 var 
m:Mesh initMesh(loaderAnchor01mirror);
 
MeshHelper.recenter(mfalse);
}


private function initMesh(loader:Loader3De:Numbertrans:Numbermirror:Boolean):Mesh {
 
var m:Mesh;
 if (
loader.getChildAt(0is Object3D{
  
if(mirror){
   Mirror
.apply(loader"z"falsetrue);
  
}
  m 
loader.getChildAt(0) as Mesh;
  
createMaterials(mm.material as TextureMaterialetrans);
  
m.mouseEnabled false;
 
}
 ship
.addChild(loader);
 
objectsLoaded ++;
 
objectsPercent = (objectsLoaded objectsTotal) * 100;
 return 
m;

The error message I get is:

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at away3d.tools.commands::Mirror$/build()[C:inetpubwwwrootaway_4_hms_surprise - newsrcaway3dtoolscommandsMirror.as:215]
at away3d.tools.commands::Mirror$/apply()[C:inetpubwwwrootaway_4_hms_surprise - newsrcaway3dtoolscommandsMirror.as:54]
at away3d.tools.commands::Mirror$/apply()[C:inetpubwwwrootaway_4_hms_surprise - newsrcaway3dtoolscommandsMirror.as:58]
at Main/initMesh()[C:inetpubwwwrootaway_4_hms_surprise - newsrcMain.as:1594]
at Main/onAnchorComplete()[C:inetpubwwwrootaway_4_hms_surprise - newsrcMain.as:753]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at away3d.containers::ObjectContainer3D/dispatchEvent()[C:inetpubwwwrootaway_4_hms_surprise - newsrcaway3dcontainersObjectContainer3D.as:668]
at away3d.loaders::Loader3D/onResourceComplete()[C:inetpubwwwrootaway_4_hms_surprise - newsrcaway3dloadersLoader3D.as:321]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at away3d.loaders::AssetLoader/retrieveNext()[C:inetpubwwwrootaway_4_hms_surprise - newsrcaway3dloadersAssetLoader.as:254]
at away3d.loaders::AssetLoader/retrieveNext()[C:inetpubwwwrootaway_4_hms_surprise - newsrcaway3dloadersAssetLoader.as:251]
at away3d.loaders::AssetLoader/retrieveNext()[C:inetpubwwwrootaway_4_hms_surprise - newsrcaway3dloadersAssetLoader.as:251]
at away3d.loaders::AssetLoader/retrieveNext()[C:inetpubwwwrootaway_4_hms_surprise - newsrcaway3dloadersAssetLoader.as:251]
at away3d.loaders::AssetLoader/onRetrievalComplete()[C:inetpubwwwrootaway_4_hms_surprise - newsrcaway3dloadersAssetLoader.as:481]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at away3d.loaders.misc::SingleFileLoader/onParseComplete()[C:inetpubwwwrootaway_4_hms_surprise - newsrcaway3dloadersmiscSingleFileLoader.as:416]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at away3d.loaders.parsers::ParserBase/finishParsing()[C:inetpubwwwrootaway_4_hms_surprise - newsrcaway3dloadersparsersParserBase.as:446]
at away3d.loaders.parsers::ParserBase/onInterval()[C:inetpubwwwrootaway_4_hms_surprise - newsrcaway3dloadersparsersParserBase.as:421]
at flash.utils::Timer/_timerDispatch()
at flash.utils::Timer/tick()

If I comment out the line

Mirror.apply(loader"z"falsetrue); 

I get the following error when view.render() is invoked.

Does anyone have any ideas?

 

File Attachments
anchor.zip  (File Size: 91KB - Downloads: 183)
   

Richard Olsson, Administrator
Posted: 18 July 2012 09:44 AM   Total Posts: 1192   [ # 1 ]

You say that if you comment out te Mirror line you get “the following error”. What error are you referring to?

 

   

John Wilson, Member
Posted: 18 July 2012 10:19 AM   Total Posts: 62   [ # 2 ]

Hi Richard,

Sorry, I forgot to include the error.  It is:

ArgumentErrorError #3671: Buffer has zero size.
 
at flash.display3D::Context3D/createVertexBuffer()
 
at away3d.core.base::SubGeometry/getUVBuffer()[C:\inetpub\wwwroot\away_4_hms_surprise new\src\away3d\core\base\SubGeometry.as:223]
 at away3d
.core.base::SubMesh/getUVBuffer()[C:\inetpub\wwwroot\away_4_hms_surprise new\src\away3d\core\base\SubMesh.as:192]
 at away3d
.materials.passes::DefaultScreenPass/render()[C:\inetpub\wwwroot\away_4_hms_surprise new\src\away3d\materials\passes\DefaultScreenPass.as:566]
 at away3d
.materials::MaterialBase/renderPass()[C:\inetpub\wwwroot\away_4_hms_surprise new\src\away3d\materials\MaterialBase.as:379]
 at away3d
.core.render::DefaultRenderer/drawRenderables()[C:\inetpub\wwwroot\away_4_hms_surprise new\src\away3d\core\render\DefaultRenderer.as:155]
 at away3d
.core.render::DefaultRenderer/draw()[C:\inetpub\wwwroot\away_4_hms_surprise new\src\away3d\core\render\DefaultRenderer.as:102]
 at away3d
.core.render::RendererBase/executeRender()[C:\inetpub\wwwroot\away_4_hms_surprise new\src\away3d\core\render\RendererBase.as:276]
 at away3d
.core.render::DefaultRenderer/executeRender()[C:\inetpub\wwwroot\away_4_hms_surprise new\src\away3d\core\render\DefaultRenderer.as:62]
 at away3d
.core.render::RendererBase/render()[C:\inetpub\wwwroot\away_4_hms_surprise new\src\away3d\core\render\RendererBase.as:240]
 at away3d
.containers::View3D/render()[C:\inetpub\wwwroot\away_4_hms_surprise new\src\away3d\containers\View3D.as:611]
 at Main
/onEnterFrame()[C:\inetpub\wwwroot\away_4_hms_surprise new\src\Main.as:1736] 

 

   

Richard Olsson, Administrator
Posted: 18 July 2012 10:27 AM   Total Posts: 1192   [ # 3 ]

Ok, this sounds like it’s due to an issue with the OBJParser that was discovered just before the release of 4.0 gold, and which will be fixed ASAP and merged back into the master branch.

Please try to work around the issue for now by using another file format, e.g. AWD.

 

   

John Wilson, Member
Posted: 18 July 2012 10:31 AM   Total Posts: 62   [ # 4 ]

Hi Richard,

Thanks a lot.

 

   

slmille4, Newbie
Posted: 25 July 2012 05:03 PM   Total Posts: 2   [ # 5 ]

I believe I’m having the same problem.  It seems to work ok with some .obj files like the In2AR logo file, but it produces the “Buffer has zero size” on others.  I’ve attached one file it had a problem with, the spaceship model from the Stage3D Game Programming book.

 

File Attachments
spaceship.obj  (File Size: 6KB - Downloads: 133)
   

John Wilson, Member
Posted: 31 July 2012 12:37 PM   Total Posts: 62   [ # 6 ]

I am still having a problem with files I load at runtime with Away3D 4.0.9 (the latest version from the GitHub Master branch). The files, which I exported from Prefab3D 2.119, seem to load without errors. I use the following code to load and process the obj file:

private function initObjects():void  { 
 
 ship 
= new ObjectContainer3D();
 
view.scene.addChild(ship);
 
 
Loader3D.enableParser(OBJParser);
    
 
loaderAnchor = new Loader3D(falsenull);
 
loaderAnchor.addEventListener(LoaderEvent.RESOURCE_COMPLETEonAnchorComplete);
 
loaderAnchor.addEventListener(LoaderEvent.LOAD_ERRORonResourceLoadingError);
 
loaderAnchor.load(new URLRequest("assets/anchor/Anchor.obj"));
 
loaderAnchor.scale(2);  
}

private function onResourceLoadingError(e:LoaderEvent) : void
{
  txtDebug
.appendText("File load failed " +  e.message " url = " e.url "\n");
}
  
private function onMapsLoadingError(e:LoaderEvent) : void
{
 txtDebug
.appendText("Image load failed " +  e.message +  " url = " e.url "\n");
}

private function onAnchorComplete(event:LoaderEvent):void
{
 txtDebug
.appendText("onAnchorComplete\n");
 
loaderAnchor.removeEventListener(LoaderEvent.RESOURCE_COMPLETEonAnchorComplete);
 
loaderAnchor.removeEventListener(LoaderEvent.LOAD_ERRORonResourceLoadingError);
 var 
m:Mesh initMesh(loaderAnchortrue);
 
MeshHelper.recenter(mfalse);
}

private function initMesh(loader:Loader3D,  mirror:Boolean):Mesh {
 
var m:Mesh;
 if (
loader.getChildAt(0is Object3D{
  
if(mirror){
   Mirror
.apply(loader"z"falsetrue);
  
}
  m 
loader.getChildAt(0) as Mesh;
  
createMaterials(mm.material as TextureMaterial);
 
}
 ship
.addChild(loader);
 return 
m;
}

private function createMaterials(m:Meshb:TextureMaterial):void
{
 m
.material b;
 
b.lightPicker lightPicker1;
 
b.ambient 1
 
fresnelMethod = new FresnelSpecularMethod(true);
 
b.specularMethod fresnelMethod;
 
diffuseMethod = new BasicDiffuseMethod();
 
b.diffuseMethod diffuseMethod;
 
specularMethod = new BasicSpecularMethod();
 
b.specularMethod specularMethod;

I then get the following error:

TypeErrorError #1009: Cannot access a property or method of a null object reference.
 
at away3d.tools.commands::Mirror$/build()[C:\inetpub\wwwroot\test\src\away3d\tools\commands\Mirror.as:215]
 at away3d
.tools.commands::Mirror$/apply()[C:\inetpub\wwwroot\test\src\away3d\tools\commands\Mirror.as:54]
 at away3d
.tools.commands::Mirror$/apply()[C:\inetpub\wwwroot\test\src\away3d\tools\commands\Mirror.as:58]
 at Main
/initMesh()[C:\inetpub\wwwroot\test\src\Main.as:254]
 at Main
/onAnchorComplete()[C:\inetpub\wwwroot\test\src\Main.as:246]
 at flash
.events::EventDispatcher/dispatchEventFunction()
 
at flash.events::EventDispatcher/dispatchEvent()
 
at away3d.containers::ObjectContainer3D/dispatchEvent()[C:\inetpub\wwwroot\test\src\away3d\containers\ObjectContainer3D.as:668]
 at away3d
.loaders::Loader3D/onResourceComplete()[C:\inetpub\wwwroot\test\src\away3d\loaders\Loader3D.as:321]
 at flash
.events::EventDispatcher/dispatchEventFunction()
 
at flash.events::EventDispatcher/dispatchEvent()
 
at away3d.loaders::AssetLoader/retrieveNext()[C:\inetpub\wwwroot\test\src\away3d\loaders\AssetLoader.as:254]
 at away3d
.loaders::AssetLoader/retrieveNext()[C:\inetpub\wwwroot\test\src\away3d\loaders\AssetLoader.as:251]
 at away3d
.loaders::AssetLoader/retrieveNext()[C:\inetpub\wwwroot\test\src\away3d\loaders\AssetLoader.as:251]
 at away3d
.loaders::AssetLoader/retrieveNext()[C:\inetpub\wwwroot\test\src\away3d\loaders\AssetLoader.as:251]
 at away3d
.loaders::AssetLoader/onRetrievalComplete()[C:\inetpub\wwwroot\test\src\away3d\loaders\AssetLoader.as:481]
 at flash
.events::EventDispatcher/dispatchEventFunction()
 
at flash.events::EventDispatcher/dispatchEvent()
 
at away3d.loaders.misc::SingleFileLoader/onParseComplete()[C:\inetpub\wwwroot\test\src\away3d\loaders\misc\SingleFileLoader.as:416]
 at flash
.events::EventDispatcher/dispatchEventFunction()
 
at flash.events::EventDispatcher/dispatchEvent()
 
at away3d.loaders.parsers::ParserBase/finishParsing()[C:\inetpub\wwwroot\test\src\away3d\loaders\parsers\ParserBase.as:446]
 at away3d
.loaders.parsers::ParserBase/onInterval()[C:\inetpub\wwwroot\test\src\away3d\loaders\parsers\ParserBase.as:421]
 at flash
.utils::Timer/_timerDispatch()
 
at flash.utils::Timer/tick() 

If I comment out Mirror.apply I get the following error.

ArgumentErrorError #3671: Buffer has zero size.
 
at flash.display3D::Context3D/createVertexBuffer()
 
at away3d.core.base::SubGeometry/getUVBuffer()[C:\inetpub\wwwroot\test\src\away3d\core\base\SubGeometry.as:223]
 at away3d
.core.base::SubMesh/getUVBuffer()[C:\inetpub\wwwroot\test\src\away3d\core\base\SubMesh.as:192]
 at away3d
.materials.passes::DefaultScreenPass/render()[C:\inetpub\wwwroot\test\src\away3d\materials\passes\DefaultScreenPass.as:566]
 at away3d
.materials::MaterialBase/renderPass()[C:\inetpub\wwwroot\test\src\away3d\materials\MaterialBase.as:381]
 at away3d
.core.render::DefaultRenderer/drawRenderables()[C:\inetpub\wwwroot\test\src\away3d\core\render\DefaultRenderer.as:154]
 at away3d
.core.render::DefaultRenderer/draw()[C:\inetpub\wwwroot\test\src\away3d\core\render\DefaultRenderer.as:102]
 at away3d
.core.render::RendererBase/executeRender()[C:\inetpub\wwwroot\test\src\away3d\core\render\RendererBase.as:288]
 at away3d
.core.render::DefaultRenderer/executeRender()[C:\inetpub\wwwroot\test\src\away3d\core\render\DefaultRenderer.as:62]
 at away3d
.core.render::RendererBase/render()[C:\inetpub\wwwroot\test\src\away3d\core\render\RendererBase.as:252]
 at away3d
.containers::View3D/render()[C:\inetpub\wwwroot\test\src\away3d\containers\View3D.as:611]
 at Main
/onEnterFrame()[C:\inetpub\wwwroot\test\src\Main.as:307] 

If I use Away3D 4.0.6 everything works without a problem.  Does anyone have any ideas?

 

   

John Wilson, Member
Posted: 31 July 2012 12:39 PM   Total Posts: 62   [ # 7 ]

Sorry, forgot to attach the file, so here it is.

 

File Attachments
anchor.zip  (File Size: 91KB - Downloads: 167)
   

Avatar
Fabrice Closier, Administrator
Posted: 31 July 2012 02:09 PM   Total Posts: 1265   [ # 8 ]

Yes, as Richard replied earlyer, there are known issues with the parser that may lead to buffer zero length errors. Fixing it is of course high on the todo.

Meanwhile. You’d probably be better off by using another format such as .awd or AS3.

 

   

John Wilson, Member
Posted: 31 July 2012 02:48 PM   Total Posts: 62   [ # 9 ]

Hi Fabrice,

Thanks, but I have tried awd2 (again exported from Prefab3D 2.119) and I get:

ErrorError #2030: End of file was encountered.
 
at flash.utils::ByteArray/readUnsignedInt()
 
at away3d.loaders.parsers::AWD2Parser/parseUserAttributes()[C:\inetpub\wwwroot\away_4_gold_test\src\away3d\loaders\parsers\AWD2Parser.as:1038]
 at away3d
.loaders.parsers::AWD2Parser/parseMaterial()[C:\inetpub\wwwroot\away_4_gold_test\src\away3d\loaders\parsers\AWD2Parser.as:376]
 at away3d
.loaders.parsers::AWD2Parser/parseNextBlock()[C:\inetpub\wwwroot\away_4_gold_test\src\away3d\loaders\parsers\AWD2Parser.as:267]
 at away3d
.loaders.parsers::AWD2Parser/proceedParsing()[C:\inetpub\wwwroot\away_4_gold_test\src\away3d\loaders\parsers\AWD2Parser.as:206]
 at away3d
.loaders.parsers::ParserBase/onInterval()[C:\inetpub\wwwroot\away_4_gold_test\src\away3d\loaders\parsers\ParserBase.as:309]
 at flash
.utils::Timer/_timerDispatch()
 
at flash.utils::Timer/tick() 

I’ll try AS3.

 

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X