Problems converting .dae to awd

Software: Other

Fred, Newbie
Posted: 30 April 2017 05:18 PM   Total Posts: 3

Hi,

I’m trying to convert a .dae file, exported from Blender, to .awd using Away Builder. The file uses skeleton animation and I’ve managed to imported it correctly into the Away Builder and played the animation, but when I save the file as .awd and try to re open it, I get an error#1034 and the scene is not loaded.

If I import the file and save it, without attaching the animation into the model, I can open it fine, but as soon I try to attach the animation a get the error#1034 again.

I’m attaching the .dae file I’m using for the test, can you help me on this matter?

Thank you in advance.

 

File Attachments
test.zip  (File Size: 66KB - Downloads: 27)
   

Avatar
Fabrice Closier, Administrator
Posted: 30 April 2017 05:51 PM   Total Posts: 1255   [ # 1 ]

Loaded it with Prefab, and reexported it.
I can reload it and it plays same way.

However, in order to load in your project, you have to modify the parser.
Its not related to the animation, its the bug of the parser that has inverted flags for compression.

Here’s the quick fix to load back in your project.

switch (_compression) {
    case DEFLATE:
    _body = new ByteArray();
    _byteData.readBytes(_body, 0, _byteData.bytesAvailable);

    try {
    _body.inflate();
    } catch(e:Error){
    //Deflate failed. The AWD2 encoder used another compression than the one specified in this awd file.
    _body.uncompress();
    }
    break;

    case LZMA:
    _body = new ByteArray();
    _byteData.readBytes(_body, 0, _byteData.bytesAvailable);
    _body.uncompress(LZMA_STRING);
    break;

    case ZLIB:
    _body = new ByteArray();
    _byteData.readBytes(_body, 0, _byteData.bytesAvailable);
    _body.uncompress();
    break;

    case UNCOMPRESSED:
    _body = _byteData;
    break;
  }

oh and forgot to say that the error comes from a null name in a skeletonPose object. On itself no problem, hence why it plays in the app, but in fact thats another bug in awd2Parser, that doesn’t give a tmp name to it if none is found. So when exporter write the pose, it exits with the error, because It can’t write the bytes length of the null name before actually write it.

Also notice that the zip is bigger, because Prefab assigns a default 512x512 map to missing materials data.

 

File Attachments
mesh001.zip  (File Size: 176KB - Downloads: 25)
   

Fred, Newbie
Posted: 02 May 2017 07:27 PM   Total Posts: 3   [ # 2 ]

Hi Fabrice, I hope you are well!

Thank you for the quick reply.  I’ll risk making a fool of myself here.

About the code snippet you provided, does it need to go in the end of the “encode” method of the AWDEncoder class, under the awaybuilder-core, on the AwayBuilder repository?

I have no idea how to build the project from source after forking and editing it, as you advised. Do I need to use the Flash Builder for that?

I couldn’t import the file you provided in Prefab3D, it gets stuck in a parsing loop. And if I try to open in AwayBuilder it crashes with error#2058, but I haven’t made the changes you proposed yet.

I’m sorry for the newbie questions, but I’m really lost here.

Thank you again!

 

   

Avatar
Fabrice Closier, Administrator
Posted: 02 May 2017 08:18 PM   Total Posts: 1255   [ # 3 ]

if you edit the encoder of AwayBuilder, you need go to the part that encodes the skeletonPose, I dunno the code, but knowing the format, in the block, it will try to write the skeletonPose name. So if you add before it tries the write string (the name) a check lile, if(!sp.name || sp.name == “”) sp.name = “whatever”;
then next line the sp.name.length necessary to write the string will not fail.

so if you use latest away3d, and want modify the exporter, you are done.
as they exporter sets wrong compression flag and the parser has same error, it will load.

If you want your away to load new, old and awd’s coming from many more apps, like blender, prefab etc… just mod the awd2Parser part that checks the flags and simply replace. Then away3d will load all the awd 2’s.

That the public old version of prefab falls on this file is possible. I dunno, I’m using my own version. Thats AwayBuilder fails at loading it, is exactly the flag issue. Prefab sets it according to awd specs, so it does decompress vs deflate and vide versa.

 

   

Fred, Newbie
Posted: 03 May 2017 11:14 PM   Total Posts: 3   [ # 4 ]

Got it! Thanks man!

 

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X