Reversed values in imported chan file

Started by sboerner, May 06, 2016, 02:22:57 pm

Previous topic - Next topic

sboerner

I've been playing around with importing chan files created in Maya (with a mel script). Most things seem to be working.

The exported values are correct when when I check the chan file in a text editor. But when it's brought into Terragen via Camera > Import > Import File the Z position, and Y and Z rotation values are all multiplied by -1. So in the curves editor they are the inverse of what they should be.

Funny thing is, everything works just fine when I split the chan file into two files - one for translation (first three columns) and one for rotation (columns four through six) - and import them separately with the Position and Rotation animation buttons.

I've searched the forums and it sounds like others have had similar issues, but I couldn't find a reference to this one in particular. Is this normal behavior?

Also tried importing fbx, but that's giving me strange rotation values.



sboerner

Thanks much for those links. I had seen the first but didn't recognize the description of this issue in Matt's pseudocode - it's there all right. The second link confirms it. Good to know about the rotate order. I was really wondering about that.

I can split the file or do the conversions in Excel. I'll see which one's simpler; may depend on how many frames there are.

Just tried importing a Maya .mov file, by the way, but kept getting an "FBX: Unable to initialise import file" fatal error. Strange.

Thanks again.

SB


sboerner

For the record, I was able to get everything to work but it took an extra twist. It may be this specific file or I'm missing a step on export/import, but here's what worked for me. The motion path exported from Maya is a circular orbit around a target. It was exported with the camera's rotate order set to ZXY per Matt's recommendation. The exported .chan file was opened in Excel and linked to a new table with the following relationships:

Translate:
X' = X
Y' = Y
Z' = -Z

Rotate:
X' = X
Y' = -(Y + 180)
Z' = -Z

So for example these lines from the original table:

234   -364.934   150   -6.91641   -10   -91.0867   0   53.131
235   -364.99    150   -2.72002   -10   -90.4275   0   53.131
236   -364.997   150    1.48592   -10   -89.7664   0   53.131
237   -364.955   150    5.70098   -10   -89.1042   0   53.131


Become:

234   -364.934   150    6.91641   -10   -88.9133   0   53.131
235   -364.99    150    2.72002   -10   -89.5725   0   53.131
236   -364.997   150   -1.48592   -10   -90.2336   0   53.131
237   -364.955   150   -5.70098   -10   -90.8958   0   53.131


And when pulled into Terragen via Camera > Import > Import File these are converted to:

234   -364.934   150    -6.91641   -10   88.9133   0   53.131
235   -364.99    150    -2.72002   -10   89.5725   0   53.131
236   -364.997   150     1.48592   -10   90.2336   0   53.131
237   -364.955   150     5.70098   -10   90.8958   0   53.131


Can't vouch for rotate Z since this file doesn't use it, but based on Matt's post those values also would be negated again by Terragen.

Filing this away to (someday) test with more complex paths . . .

SB