What does ArgumentError: Error #3671: Buffer has zero size.?

Software: Away3D 4.x

Drewbaka, Newbie
Posted: 17 August 2012 07:35 PM   Total Posts: 11

When I try to load an .OBJ file I get this continuous loop error:

ArgumentError: Error #3671: Buffer has zero size.

What does it mean and how do I fix it?The file is not empty?

 

File Attachments
kill.mtl  (File Size: 1KB - Downloads: 184)
kill.obj  (File Size: 2KB - Downloads: 219)
   

bitmapdata, Newbie
Posted: 17 August 2012 08:31 PM   Total Posts: 24   [ # 1 ]

Code that loads the obj?

 

   

Drewbaka, Newbie
Posted: 17 August 2012 08:34 PM   Total Posts: 11   [ # 2 ]

Look at the post before this one.

Here is a simplified version

package  
{
        import away3d
.containers.View3D;
        
import away3d.entities.Mesh;
        
import away3d.events.LoaderEvent;
        
import away3d.loaders.Loader3D;
        
import away3d.loaders.parsers.*;
        
//import deep.away3d.loaders.DeepOBJParser;
        
import flash.display.Sprite;
        
import flash.events.Event;
        
import flash.net.URLRequest;
       
        
/**
         * ...
         * @author ...
         */
        
public class LoadObj extends Sprite
        {
                
private var view:View3D;
               
                public function 
LoadObj()
                
{
                        stage
.align "TL";
                        
stage.scaleMode "noScale";
                       
                        
view = new View3D();
                        
addChild(view);
                       
                        
addEventListener(Event.ENTER_FRAMEonRender);
                       
Parsers.enableAllBundled();
   
Loader3D.enableParsers(Parsers.ALL_BUNDLED);
                        
//Loader3D.enableParser(AWD2Parser);
                       
                        
var l:Loader3D = new Loader3D();
                        
l.addEventListener(LoaderEvent.RESOURCE_COMPLETEonComplete);
                        
l.load(new URLRequest("kill.obj"));
                       
                
}
               
                
private function onComplete(e:LoaderEvent):void
                {
                        
var l:Loader3D e.target as Loader3D;
                        var 
m:Mesh l.getChildAt(0) as Mesh;
                        
m.geometry.scale(10);
                        
view.scene.addChild(m);
                
}
               
                
private function onRender(e:Event):void
                {
                        view
.render();
                
}
               
        } 

 

   

bitmapdata, Newbie
Posted: 17 August 2012 08:39 PM   Total Posts: 24   [ # 3 ]

Full stack trace?

 

   

Drewbaka, Newbie
Posted: 17 August 2012 08:41 PM   Total Posts: 11   [ # 4 ]

It just gives this error..ArgumentError: Error #3671: Buffer has zero size.

 

   

Drewbaka, Newbie
Posted: 17 August 2012 08:47 PM   Total Posts: 11   [ # 5 ]

Perhaps it’s caused by onRender?

package  
{
        import away3d
.containers.View3D;
        
import away3d.entities.Mesh;
        
import away3d.events.LoaderEvent;
        
import away3d.loaders.Loader3D;
        
import away3d.loaders.parsers.*;
        
//import deep.away3d.loaders.DeepOBJParser;
        
import flash.display.Sprite;
        
import flash.events.Event;
        
import flash.net.URLRequest;
       
        
/**
         * ...
         * @author ...
         */
        
public class LoadObj extends Sprite
        {
                
private var view:View3D;
               
                public function 
LoadObj()
                
{
                        stage
.align "TL";
                        
stage.scaleMode "noScale";
                       
                        
view = new View3D();
                        
addChild(view);
                       
                        
addEventListener(Event.ENTER_FRAMEonRender);
      
trace(9);
                       
Parsers.enableAllBundled();
        
trace(8);
   
Loader3D.enableParsers(Parsers.ALL_BUNDLED);
                        
//Loader3D.enableParser(AWD2Parser);
                       
trace(7);
                        var 
l:Loader3D = new Loader3D();
      
trace(6);
                        
l.addEventListener(LoaderEvent.RESOURCE_COMPLETEonComplete);
      
trace(5);
                        
l.load(new URLRequest("kill.obj"));
                       
                
}
               
                
private function onComplete(e:LoaderEvent):void
                {
     trace
(0);
                        var 
l:Loader3D e.target as Loader3D;
      
trace(1);
                        var 
m:Mesh l.getChildAt(0) as Mesh;
      
trace(2);
                        
m.geometry.scale(10);
      
trace(3);
                        
view.scene.addChild(m);
      
trace(4);
                
}
               
                
private function onRender(e:Event):void
                {
     trace
(10);
                        
view.render();
      
trace(11);
                
}
               
        }
 

Here is the output:

9
8
7
6
5
10
11
10
11
10
11
0
1
2
3
4
10
ArgumentError
Error #3671: Buffer has zero size.
 
at flash.display3D::Context3D/createVertexBuffer()
 
at away3d.core.base::SubGeometry/getVertexBuffer()
 
at away3d.core.base::SubMesh/getVertexBuffer()
 
at away3d.materials.passes::MaterialPassBase/render()
 
at away3d.materials.passes::DefaultScreenPass/render()
 
at away3d.materials::MaterialBase/renderPass()
 
at away3d.core.render::DefaultRenderer/drawRenderables()
 
at away3d.core.render::DefaultRenderer/draw()
 
at away3d.core.render::RendererBase/executeRender()
 
at away3d.core.render::DefaultRenderer/executeRender()
 
at away3d.core.render::RendererBase/render()
 
at away3d.containers::View3D/render()
 
at LoadObj/onRender()
10
ArgumentError
Error #3671: Buffer has zero size.
 
at flash.display3D::Context3D/createVertexBuffer()
 
at away3d.core.base::SubGeometry/getVertexBuffer()
 
at away3d.core.base::SubMesh/getVertexBuffer()
 
at away3d.materials.passes::MaterialPassBase/render()
 
at away3d.materials.passes::DefaultScreenPass/render()
 
at away3d.materials::MaterialBase/renderPass()
 
at away3d.core.render::DefaultRenderer/drawRenderables()
 
at away3d.core.render::DefaultRenderer/draw()
 
at away3d.core.render::RendererBase/executeRender()
 
at away3d.core.render::DefaultRenderer/executeRender()
 
at away3d.core.render::RendererBase/render()
 
at away3d.containers::View3D/render()
 
at LoadObj/onRender()
10
ArgumentError
Error #3671: Buffer has zero size.
 
at flash.display3D::Context3D/createVertexBuffer()
 
at away3d.core.base::SubGeometry/getVertexBuffer()
 
at away3d.core.base::SubMesh/getVertexBuffer()
 
at away3d.materials.passes::MaterialPassBase/render()
 
at away3d.materials.passes::DefaultScreenPass/render()
 
at away3d.materials::MaterialBase/renderPass()
 
at away3d.core.render::DefaultRenderer/drawRenderables()
 
at away3d.core.render::DefaultRenderer/draw()
 
at away3d.core.render::RendererBase/executeRender()
 
at away3d.core.render::DefaultRenderer/executeRender()
 
at away3d.core.render::RendererBase/render()
 
at away3d.containers::View3D/render()
 
at LoadObj/onRender()
10
ArgumentError
Error #3671: Buffer has zero size.
 
at flash.display3D::Context3D/createVertexBuffer()
 
at away3d.core.base::SubGeometry/getVertexBuffer()
 
at away3d.core.base::SubMesh/getVertexBuffer()
 
at away3d.materials.passes::MaterialPassBase/render()
 
at away3d.materials.passes::DefaultScreenPass/render()
 
at away3d.materials::MaterialBase/renderPass()
 
at away3d.core.render::DefaultRenderer/drawRenderables()
 
at away3d.core.render::DefaultRenderer/draw()
 
at away3d.core.render::RendererBase/executeRender()
 
at away3d.core.render::DefaultRenderer/executeRender()
 
at away3d.core.render::RendererBase/render()
 
at away3d.containers::View3D/render()
 
at LoadObj/onRender()
10
ArgumentError
Error #3671: Buffer has zero size.
 
at flash.display3D::Context3D/createVertexBuffer()
 
at away3d.core.base::SubGeometry/getVertexBuffer()
 
at away3d.core.base::SubMesh/getVertexBuffer()
 
at away3d.materials.passes::MaterialPassBase/render()
 
at away3d.materials.passes::DefaultScreenPass/render()
 
at away3d.materials::MaterialBase/renderPass()
 
at away3d.core.render::DefaultRenderer/drawRenderables()
 
at away3d.core.render::DefaultRenderer/draw()
 
at away3d.core.render::RendererBase/executeRender()
 
at away3d.core.render::DefaultRenderer/executeRender()
 
at away3d.core.render::RendererBase/render()
 
at away3d.containers::View3D/render()
 
at LoadObj/onRender()
10
ArgumentError
Error #3671: Buffer has zero size.
 
at flash.display3D::Context3D/createVertexBuffer()
 
at away3d.core.base::SubGeometry/getVertexBuffer()
 
at away3d.core.base::SubMesh/getVertexBuffer()
 
at away3d.materials.passes::MaterialPassBase/render()
 
at away3d.materials.passes::DefaultScreenPass/render()
 
at away3d.materials::MaterialBase/renderPass() 

 

   

bitmapdata, Newbie
Posted: 17 August 2012 08:54 PM   Total Posts: 24   [ # 6 ]

I think you should call the enterframe after you get your object loaded. After you add the child.
Also I am not positive about this but with other loaders if you initialize it, it will try and load. So you might want to make sure that this:
var l:Loader3D = new Loader3D();
l.addEventListener(LoaderEvent.RESOURCE_COMPLETE, onComplete);
Isn’t already telling your loader to load.
But whatever it is your not sending your vertext buffer anything to render which is why you prob get this error:
ArgumentError: Error #3671: Buffer has zero size.
at flash.display3D::Context3D/createVertexBuffer()
Because the vertex buffer is empty.

 

   

Drewbaka, Newbie
Posted: 17 August 2012 08:57 PM   Total Posts: 11   [ # 7 ]

If I convert the .obj file to .3ds it works perfectly….why doesn’t the .obj work if 3ds works…hmmm

Changed the event listener still does not seem to work

 

File Attachments
teapot.3DS  (File Size: 34KB - Downloads: 0)
   

bitmapdata, Newbie
Posted: 17 August 2012 08:58 PM   Total Posts: 24   [ # 8 ]

Then it has to be your obj file. If you are just replacing it with an 3ds file and it works.

 

   

Drewbaka, Newbie
Posted: 17 August 2012 09:01 PM   Total Posts: 11   [ # 9 ]

I exported the .obj from maya. Can you try it out on your Flash, see if it is in fact my obj file?

 

   

Richard Olsson, Administrator
Posted: 18 August 2012 10:17 AM   Total Posts: 1192   [ # 10 ]

You already posted this question in another thread. Please let us know the version of the engine that you are using. Are you using Git, or did you download the engine from away3d.com/download? Please let us know the values of the static constants on the away3d.Away3D class if you downloaded it.

To make sure you’re using the latest release version, download from GitHub via http://github.com/away3d/away3d-core-fp11/zipball/master.

If you want to try an even newer version, i.e. the one currently in development, download the “dev” branch from http://github.com/away3d/away3d-core-fp11/zipball/dev

 

   

Drewbaka, Newbie
Posted: 18 August 2012 01:41 PM   Total Posts: 11   [ # 11 ]

Cheers! Sorry about that Matee. I am using F11.1-11.3, I am not using any other libraries except away3D as can be seen by the code. I downloaded version 4.0.9 (latest gold version) from away3d.com site. Could you point out a simple example on how to loading files.

Also additional info: I am using Maya(2013) to export .obj (default plug-in) I am using Maya to export AWD2 using a plugin I found on google and I use 3Ds Max(2013) to export .3DS files and they all do not seem to work. Could anyone check on this?

 

   

Richard Olsson, Administrator
Posted: 20 August 2012 07:02 AM   Total Posts: 1192   [ # 12 ]

I have no idea why loading files does not work for you. Can you please upload the files (3DS, AWD, OBJ) somewhere, and file a bug on GitHub, here: http://github.com/away3d/away3d-core-fp11/issues with a link to this forum thread and to the files that don’t work.

 

   

Drewbaka, Newbie
Posted: 20 August 2012 11:28 AM   Total Posts: 11   [ # 13 ]

I have attached all the files I used:

I exported .obj from Maya 2013.

I exported AWD2 from Maya 2013.

I exported .3ds from 3Ds Max 2013

 

File Attachments
kill.mtl  (File Size: 1KB - Downloads: 160)
kill.mtl  (File Size: 1KB - Downloads: 143)
test.3DS  (File Size: 2KB - Downloads: 0)
   

Richard Olsson, Administrator
Posted: 21 August 2012 02:50 PM   Total Posts: 1192   [ # 14 ]

Please either zip the files together or upload them somewhere else. The forum does not allow download of these filetypes.

 

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X