#82 AnimationCurves not correct from Maya

open
nobody
None
5
2008-11-13
2008-11-13
Gregg Tavares
No

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.

Discussion

  • Gregg Tavares
    Gregg Tavares
    2008-11-13

    example curve in maya

     
    Attachments
  • Gregg Tavares
    Gregg Tavares
    2008-11-13

    I attached an image of the results so you can see how the maya results and fcollada results are completely different.

     
  • Judith Schenk
    Judith Schenk
    2008-11-13

    The bug happens only on non-weighted animation curves.
    It's fixed in the newest sources of the COLLADAMaya NextGen exporter plug-in.

     
  • Gregg Tavares
    Gregg Tavares
    2008-11-13

    new plugin graph

     
    Attachments
  • Gregg Tavares
    Gregg Tavares
    2008-11-13

    Thanks for checking it out.

    I downloaded the source and applied the changes I saw in nextgen to old gen. The results are closer but still off. I attached a graph below. Are there changes needed in FCollada as well or just the exporter?

    Any ideas? Sorry my math skills suck so I'm completely at your mercy.

     
  • Judith Schenk
    Judith Schenk
    2008-11-14

    Ok, you are right, there was still an error with the direction of the tangents slope. Should work now (I have now both curves in my math program, so I can really see, if it's the same...).
    Thanks for advice!