Syntax of calibration.xml?

What language is used in calibration.xml? Is there any reference out there for this?

I’m trying to modify it to add an XYZ translation so that I can export a georeferenced scene in small number coordinates. Alternatively, if someone can tell me how to move a component, or another way to get small number coordinate pointcloud output from a georeferenced component in RC, that would be helpful.

Aha! Tokens are here: Camera export and file formats

I still would like to know what the syntax / template language is. For example, what sort of math is allowed, what is .ip .ltc, what is the g in $(tx:g), what is requiresGeoref, etc.

Aaron Curtis wrote:

I still would like to know what the syntax / template language is. For example, what sort of math is allowed, what is .ip .ltc, what is the g in $(tx:g), what is requiresGeoref, etc.

Hello Aaron,
I don’t know details of the syntax either. Everything I know is already explained here - the post you already found.
But I will try to help you here.

Everything outside brackets with dollar sign - $() is printed to file as it is. e.g. if you see in calibration.xml something like this

Code:
"cameraShape$(index+1:d).ip"
for first camera (with index 0) it will print:
Code:
"cameraShape1.ip"
Here we can see that everything outside brackets was printed untouched. So .ip or .ltc got nothing to do with exporter syntax, it's probably just part of Maya export format.

Inside the brackets you can use simple arithmetic like *,/,+,- maybe % (modulo) or even binary operations.
And mysterious ‘g’ after tokenName: is just formatting for your number - see C++ documentation of printf.

Commonly used formattings:

Code:
$(token:f) - prints floating point number (I think this is default, so $(token:f) is same as $(token)
$(token:d) - prints decimal number
$(token:e) - prints floating number in scientific notation
$(token:g) - prints the shortest representation: %e or %f
$(token:.8) - prints floating point number with 8 digits after decimal point
I hope this will help you. Just write here if something wasn't clear enough.

EDIT:
There are other things to explain as I read calibration.xml.
You can print/not to print something if some condition is fulfilled.
e.g.

Code:
$If( bImagePlane, ..)
If variable bImagePlane is true, then everything after comma is printed, if bImagePlane is false, then nothing is printed.

But where bImagePlane came from?

Code:
<format mask="*.ma" desc="Maya 2013 ascii scene" writer="cvs" undistortImages="1" undistortPrincipal="1">
<parameter name="Export image planes" type="bool" default="true" variable="bImagePlane" />
<body>
...
</body>
</format>
This are user defined parameters which are displayed in Export Registration Dialog. But there can be other variables, like 'isGeoreferenced' in maya export and honestly I don't know where it came from.

To warn you, everything I write here are just my hypothesis from seeing calibration.xml file.

Hey thanks Kruzma, that’s super helpful! I presume they are using some off-the-shelf template language here, would be nice to know which one it is. Silly that we have to reverse-engineer this stuff.