mrozmanith / awd

Automatically exported from code.google.com/p/awd
Apache License 2.0
0 stars 0 forks source link

Spec: Fields in "Meta-data" Block are VarStrings not ConstString #32

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
just successfully implemented meta-data blocks in my custom parser. The fields 
"Encoder name", "Encoder version", "Generator name" and "Generator Version" are 
declared as being ConstStrings. But since these are actually of variable length 
these should be declared as VarStrings.

In the PolarBear.awd supplied with the latest awd-examples file there are two 
bytes in front of these strings representing the string length.

(PolarBear.awd is included in this file 
http://away3d.com/images/uploads/releases/away3d-examples-fp11_4_0_7_gold.zip)

Original issue reported on code.google.com by pr...@ibbgdv.de on 19 Jul 2012 at 1:47

GoogleCodeExporter commented 8 years ago
Thanks for having a look at this. It's always very positive with outside review!

The two bytes that you are referring to is the length field of the NumAttribute 
structure, and is not part of the string. As such, the string itself is a 
ConstString, which means, as the specification describes it, that the context 
will determine it's length. The length field that you are referring to, i.e. 
the value length field for the attribute structure, is an example of such 
context.

If they were actually var strings, there would be two length fields.

Original comment by bengtric...@gmail.com on 19 Jul 2012 at 1:53

GoogleCodeExporter commented 8 years ago
That's exactly my point. There are 2 length fields with the same length. There 
is one of the NumAttribute structure and another one directly after it, which 
looks like a VarString.

Original comment by pr...@ibbgdv.de on 19 Jul 2012 at 1:58

GoogleCodeExporter commented 8 years ago
It seems that you are indeed seeing VarStrings in the AWD file you're referring 
to. After speaking to Fabrice who wrote the encoder in Prefab used to create 
that file, it seems like he may have a bug in his encoder.

That is, however, not a bug in the specification which is what you seemed to be 
suggesting in your issue report. It's a bug in one particular encoder, that 
happens to not be part of this project at all. I've raised it with Fabrice and 
he will fix it.

Original comment by bengtric...@gmail.com on 19 Jul 2012 at 1:59

GoogleCodeExporter commented 8 years ago
Well, I only have this file to test the spec (and my parser) against ;) Do you 
have a "correct" awd file, which follows the spec?

Original comment by pr...@ibbgdv.de on 19 Jul 2012 at 2:05

GoogleCodeExporter commented 8 years ago
If you can't use any of the exporters that are part of this project (Maya, 3ds 
Max), and not compile the SDK to try to export stuff procedurally then I'm not 
sure. I will let you know once there is a file that you can use to double-check 
the meta-data block though! It's being worked on right now.

Original comment by bengtric...@gmail.com on 19 Jul 2012 at 2:12

GoogleCodeExporter commented 8 years ago
This file should have a correct meta-data block:
https://dl.dropbox.com/u/1560087/MyCube.awd

Original comment by bengtric...@gmail.com on 19 Jul 2012 at 2:21

GoogleCodeExporter commented 8 years ago
Thanks! Works perfectly!

Original comment by pr...@ibbgdv.de on 19 Jul 2012 at 2:47

GoogleCodeExporter commented 8 years ago
Great! Thanks for your effort reviewing this. It's always good to sanity check. 
:)

Original comment by bengtric...@gmail.com on 19 Jul 2012 at 2:53