exporting AWD file from Maya then unable to parse file

Software: Away3D 4.x

Leo Brennan, Newbie
Posted: 07 November 2011 12:19 PM   Total Posts: 20

I went through the build instructions for AWD and built them all in VS2008 (had problems in VS2010 importing the Python source code) and initially couldn’t get Maya to load the exporter but then saw this bug: http://code.google.com/p/awd/issues/detail?id=5 and passed across the utils folder as well and that allowed Maya to load the exporter.

I did try to export a model which was rigged and animating but the exporter produced nothing on the output file (file was empty, 0 bytes). So I have literally done this: Opened Maya, created a cube (with the add cube button, I tried a Sphere with same results) and then exported it.

Now I see nothing as it doesn’t seem to draw it on screen (AwayStats shows 0 Polygons). I have checked what is returned from AssetEvent.ASSET_COMPLETE and found that only a container is returned with nothing in it. I dug further and found that I was using the AWDParser which then tried to parse it in AWD1Parser which returned the container then the AWDParser.proceedParsing just kept firing but not doing anything.
When I forced it to use the AWD2Parser I get this error: “Error #1125: The index 131072 is out of range 1.” at AWD2Parser 302.

So pretty much what I am asking is what do I need to do to the Cube to get it displayed on the screen, I am about to try adding UV Mapping to the cube as I saw on another thread someone tried that and will let you know if that works at all. Any other suggestions would be helpful.

my Code: http://pastebin.com/WB8JRBGL
I will try to upload the models I am trying later if I get time.

Just to note: downloaded Away3D and AWD files 6 days ago and haven’t updated since then. And I have imported the awd polarbear file and imported various MD5 models (not with the exact same code, but similar)

   

Leo Brennan, Newbie
Posted: 07 November 2011 03:59 PM   Total Posts: 20   [ # 1 ]

So adding UV data to the cube didn’t help, still the same issue.

I was looking into this AWD2Parser crashing when I tried to force it to use this parser.

I put this into AWD2Parser.parseNextBlock:

trace("the start body length: "+_body.length+" bytes: "+_body.bytesAvailable);
   
_cur_block_id _body.readUnsignedInt();
   
trace("the current block id: "+_cur_block_id+" and body length: "+_body.length+" bytes: "+_body.bytesAvailable);
   
ns _body.readUnsignedByte();
   
trace("the ns: "+ns+" and body length: "+_body.length+" bytes: "+_body.bytesAvailable);
   
type _body.readUnsignedByte();
   
trace("the current type: "+type+" and body length: "+_body.length+" bytes: "+_body.bytesAvailable);
   
len _body.readUnsignedInt();
   
trace("the current len: "+len+" and body length: "+_body.length+" bytes: "+_body.bytesAvailable); 

and this is the output:
the start body length: 30 bytes: 18
the current block id: 131072 and body length: 30 bytes: 14
the ns: 0 and body length: 30 bytes: 13
the current type: 0 and body length: 30 bytes: 12
the current len: 0 and body length: 30 bytes: 8

This is just for a Cube being exported from Maya, this does contain UV mapping but same result for ones that don’t.

if I do _body.readUnsignedShort(); for _cur_block_id I get a value of 2, although it should be 1. (testing with the polarbear.awd example it does print everything correctly, in that the id goes up by 1 and everything else seems correct).

Not sure if this is helpful at all.

   

Leo Brennan, Newbie
Posted: 07 November 2011 04:29 PM   Total Posts: 20   [ # 2 ]

I also found when I was trying to export a cube with a texture and I marked the “Embed textures” then the .awd file would be 0 bytes.
The command window for Maya would show this error:
// Error: NameError: global name ‘TEX_EXTERNAL’ is not defined //

With the limited Python I know I did this quickly:
TEX_EXTERNAL = 0
TEX_EMBED_JPG = 0

just above the line:
class MayaAWDExporter

This did mean I didn’t get any errors outputting the file. I also did TEX_EMBED_JPG as I saw that once in the command window but can’t remember how I got that so I put this in to be safe.

But the parsing from the AWD2Parser was still the same with the cur_block_id being 131072 instead of 1.

So this stops the error in the command window and it does produce something in the file but I still can’t parse it so back to my original problem :(
Although someone may tell me this is something I shouldn’t have done for some reason

   

Leo Brennan, Newbie
Posted: 07 November 2011 04:37 PM   Total Posts: 20   [ # 3 ]

The output .awd files are about 30 or 40 bytes even for a model of an ape which contains animation, no error output to Command Window where as the polar bear example is 3kb.

So I think The parsing issues are still down to the exporter not exporting it correctly, I will keep looking but it might be that I am missing something obvious, currently I leave all the options in the exporter set to what ever they are when it first loads up (except the embed textures)

   

Leo Brennan, Newbie
Posted: 08 November 2011 10:53 AM   Total Posts: 20   [ # 4 ]

I used Prefab to export the model as a AWD1 file and I could import it into my scene.
But I couldn’t import the model as a .awd file (an exported AWD2 file from Maya) into Prefab, just didn’t do anything. It didn’t say no it just didn’t do anything.
I had to export it from Maya as a .obj then into prefab. So I am pretty sure now it is the export script for Maya that is not working correctly.

I will be looking through the Python code but I haven’t really done much Python before so if someone else knows the issue then please let me know smile

   

Avatar
Fabrice Closier, Administrator
Posted: 08 November 2011 04:37 PM   Total Posts: 1265   [ # 5 ]

Prefab 1.x doesn’t support awd2 format, that’s why it accepts the file but dies silently. If you want test your files, you need to load them into your project.

Prefab 2.0 will support both versions.

   

Leo Brennan, Newbie
Posted: 08 November 2011 04:41 PM   Total Posts: 20   [ # 6 ]

I should add that I am testing them by using them in my project, I just tried prefab this morning to see how it worked with awd2 files. I think the problem lies in the exporter or how I installed it because all files are being output at 40 bytes or 30 bytes whereas usually they should be much higher than that.

I have the example polarbear.awd file working and animating but that is a larger file and not just 40 bytes.

   

Tehn, Newbie
Posted: 08 November 2011 08:52 PM   Total Posts: 7   [ # 7 ]

I had similar issue that Leo Brennan described, so seems that something wrong in source or during compilation process.

@Leo Brennan, Try to open ur AWD file in text editor, you will see that it has something like:
null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null
=)
Think I should look into code, but it is hard to explore other codes.

   

Leo Brennan, Newbie
Posted: 09 November 2011 11:09 AM   Total Posts: 20   [ # 8 ]

yes that is what I get.

I am hoping someone might know this issue, as I am not sure what the problem is yet.

Maya doesn’t say any errors when exporting an object.

If someone has a Maya file that I can try exporting with (that they know works) then that would be awesome to try smile

   

Morgan, Newbie
Posted: 07 February 2012 09:01 PM   Total Posts: 2   [ # 9 ]

I’m experiencing this same issue.  I am also using a 64 bit edition of Maya, though it is 2011. 

I am also receiving the following warning from the exporter: “Using pure python for writing. Build PyAWD with—use-libawd=true to build using libawd for optimized writing performance.”

I also receive the TEX_EXTERNAL and TEX_EMBED_JPG error when exporting with textures on and textures embedded respectively.  I previously received an error about module.floor being unknown or unavailable but inserting an import within the def resolved that issue. Now when building even simple triangulated meshes I have no Console errors but the resulting file is always 30bytes, even when textures are supposed to be embedded or when the mesh is large and complicated.

I built PyAWD in Visual Studio 2008 Express in Release configuration 32 bit mode.  I’ve tried manually adding the use-libawd compiler argument but Visual Studio gives me an invalid argument warning.  Perhaps I am doing that in the wrong place.

My fear is that maybe this script is not designed to work with 64 bit Maya installations or else the fact that Visual Studio Express can only compile in 32 bit mode conflicts with Maya. Is that a possibility? 

Some administrator help understanding this issue would be very helpful.

   

MayaGuy, Newbie
Posted: 15 November 2012 08:36 PM   Total Posts: 2   [ # 10 ]

Hi,

    I am wondering about the status of this issue? Time has passed and we have seen new versions of Away3D, and yet this issue is not addressed to my knowledge.

    I would very much like to export AWD2 fiels since DAE, 3DS and MD2/MD5 seem to have little support in Maya.

    Any information would be appreciated.

   

sirpedroec, Newbie
Posted: 17 November 2012 11:08 AM   Total Posts: 26   [ # 11 ]

*BUMP*
Working Maya 2012 AWD2 Exporter, please.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X