Announcements

We are currently experiencing an issue impacting some Autodesk Products and Services - please refer to the Autodesk Health Dashboard for updates.

mocap keyframe reducer

mocap keyframe reducer

graham_chow
Contributor Contributor
790 Views
3 Replies
Message 1 of 4

mocap keyframe reducer

graham_chow
Contributor
Contributor

Unfortunately Maya LT 2019 does not come with the keyframe reducer, so I thought I would make my own. So I'm just sharing my results... It is using a least squares technique to find the curve. I plan on using it to clean up / heavily modify mocap data.

 

keyframe reductionkeyframe reduction

 

791 Views
3 Replies
Replies (3)
Message 2 of 4

faline.custodio.da.silva
Alumni
Alumni

@graham_chow 

 

Thanks for posting! Great work, is this a MEL or Python script?

 


Faline Custodio Da Silva

0 Likes
Message 3 of 4

mspeer
Consultant
Consultant

Hi!

 

As Maya LT does not support Python scripting, i would guess it's a MEL script.

0 Likes
Message 4 of 4

graham_chow
Contributor
Contributor

Yes it is MEL (kind of). I'm using freadAllLines and fwriteAllLines to import and export data from Maya LT to and from a text file. Then I'm processing it using another program that i wrote.

		float $t[] = `keyframe -index $i -attribute $attributeName -query $objectName`;
		float $v[] = `keyframe -index $i -attribute $attributeName -query -eval $objectName`;
		$xstr = $xstr + $t[0] + "," + $v[0] + ",";
		currentTime $time;
		setAttr $name ($value);
		setKeyframe $name;
		keyTangent -e -weightedTangents true $name;
		keyTangent -lock off $name;
		keyTangent -e -a -index $i -wt true $name;
		keyTangent -e -a -index $i -oa $out_angle -ow $out_weight $name;
		keyTangent -e -a -index $i -ia $in_angle -iw $in_weight $name;

If you want to do something similar and import, you need to make sure in Settings/Animation the Rotation Interpolation is set to Independent Euler-angle curves, otherwise you get a mess with the rotations.

0 Likes