Share

COLLADA for Maya, 3DSMax

Tracker: Bugs

5 AnimationCurves not correct from Maya - ID: 2273623
Last Update: Comment added ( judithschenk )

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.


Gregg Tavares ( greggman ) - 2008-11-13 03:10

5

Open

None

Nobody/Anonymous

None

None

Public


Comments ( 4 )

Date: 2008-11-14 08:41
Sender: judithschenk

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!



Date: 2008-11-13 22:37
Sender: greggmanSourceForge.net Subscriber

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.




Date: 2008-11-13 17:33
Sender: judithschenk

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


Date: 2008-11-13 03:15
Sender: greggmanSourceForge.net Subscriber

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


Attached Files ( 3 )

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

Changes ( 3 )

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