So I thought I'd try to use ColladaMaya and FCollada to get some animation
out of Maya.
I made a simple curve with only 3 points. I exported, loaded the file with
FCollada and compared the values. The are nothing alike. This is a simple
curve.
Here's the values Maya gives for the curve at frames 2 through 14
struct ExpectedResult {
float position; // in 24hz frames
float value;
};
static const ExpectedResult expected_results[] = {
{ 2.0f, 3.0f, },
{ 3.0f, 4.139f, },
{ 4.0f, 3.016f, },
{ 5.0f, 3.023f, },
{ 6.0f, 7.554f, },
{ 7.0f, 20.0f, },
{ 8.0f, 31.935f, },
{ 9.0f, 34.394f, },
{ 10.0f, 29.961f, },
{ 11.0f, 21.221f, },
{ 12.0f, 10.757f, },
{ 13.0f, 1.156f, },
{ 14.0f, -5.0f, },
};
And using this code.
FCollada::Initialize();
FCDocument* doc = FCollada::NewTopDocument();
bool fc_status = FCollada::LoadDocumentFromFile(
doc,
L"anim-curves-smalll.dae");
FCDAnimationLibrary* library = doc->GetAnimationLibrary();
FCDAnimation* anim = library->FindDaeId("pCylinder1.translate");
FCDAnimationChannel* channel = anim->GetChannel(0);
FCDAnimationCurve* fcurve = channel->GetCurve(0);
const float kFrameRate = 24.0f;
for (unsigned ii = 0; ii < ARRAYSIZE(expected_results); ++ii) {
const ExpectedResult& expected_result = expected_results[ii];
float value = fcurve->Evaluate(expected_result.position / kFrameRate);
printf ("%f\n", value);
}
These are the results that FCollada returns.
3.0530877
6.2773538
9.4320183
12.648014
16.109333
19.934971
22.113695
20.753159
16.865885
11.399403
5.3012395
-0.48108310
-5.0000000
Except for the points at the keys they are not even close to correct.
Nobody/Anonymous
None
None
Public
|
Date: 2008-11-14 08:41 Ok, you are right, there was still an error with the direction of the |
|
Date: 2008-11-13 22:37 Thanks for checking it out. |
|
Date: 2008-11-13 17:33 The bug happens only on non-weighted animation curves. |
|
Date: 2008-11-13 03:15 I attached an image of the results so you can see how the maya results and |
| Filename | Description | Download |
|---|---|---|
| anim-curves-small.ma | example curve in maya | Download |
| fcollada-anim-curve.png | Download | |
| newplugin-vs-maya.png | new plugin graph | Download |
| Field | Old Value | Date | By |
|---|---|---|---|
| File Added | 301276: newplugin-vs-maya.png | 2008-11-13 22:34 | greggman |
| File Added | 301187: fcollada-anim-curve.png | 2008-11-13 03:14 | greggman |
| File Added | 301186: anim-curves-small.ma | 2008-11-13 03:10 | greggman |
Copyright © 2009 Geeknet, Inc. All rights reserved. Terms of Use