Community
Maya Programming
Welcome to Autodesk’s Maya Forums. Share your knowledge, ask questions, and explore popular Maya SDK topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Native point-level animation?

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
Anonymous
805 Views, 4 Replies

Native point-level animation?

Hello,

I am trying to write an importer plugin for Maya. The objects I'd like to import can be point-level animated and I would like to compute some animation frames at import time and to bake them into the generated native Maya object.

My goal is to write a pure importer plugin that can be switched off after importing the object. That's why embedding point-level animation into the native Maya object is important to me. I saw the SDK encouraged writing a time-dependent node whose geometry should be reconstructed upon current time change, like in animCubeNode.cpp. But that's not what I am looking for since writing my plugin this way would require it to be loaded as long as the animation is played.

 

I suppose my problem is like what Maya does when it loads an animated FBX file. My question is : can something similar be achieved through the SDK?

 

Thanks!

Tags (2)
4 REPLIES 4
Message 2 of 5
naiqi.weng
in reply to: Anonymous

Hi,

 

With Maya API, you will be able to set mesh vertices positions using MFnMesh class. In your situation, you could create a mesh node first, the import the data and set the mesh vertices positions based on the data. However in Maya, animation is always coupled with "time" node, which means, anything that's animated has connection with "time" node in dependency graph. If you would like to cache the animation, there are several options, you could be using alembic file format or GPU cache to cache the animation data(please see the Maya documentation for more information, also you could be using MEL command "AbcImport" to accomplish the import operation with alembic file format), or you could use MPxCacheFormat to create your own custom cache format.  We have an example XMLGeometryCache project for MPxCacheFormat in the devkit folder with Maya installation. Let me know if this helps.

Message 3 of 5
Anonymous
in reply to: naiqi.weng

Hi naiqi.weng,

 

Thank you very much for your answer.

We could actually be able to write .mc cache files on disk at import time (like in FBX format) but how could we then tell Maya that the object we created is animated, and that reading such a cache file to animate the object is necessary every time time changes?

In 3ds Max there seems to exist an Autodesk core plugin that reads point-cache files. Maybe this is also the case with Maya?

 

Best regards,

Yves-Olivier

Message 4 of 5
naiqi.weng
in reply to: Anonymous

Hi, Yves-Olivier

 

When you say "how could we then tell Maya that the object we created is animated, and that reading such a cache file to animate the object is necessary every time time changes?", I am guessing you want to achieve the "import the cache file" operation within your C++ code? I didn't find a corresponding command to import geometry cache file, so I turned on "Echo all commands" in script editor and found whenever you import geometry cache, Maya is actually calling "attachGeometryCache" , which is a run time command. In your C++ code, you can use MGlobal::executeCommand() to execute this command.

Message 5 of 5
Anonymous
in reply to: naiqi.weng

Hi naiqi.weng,

 

Imitating Maya's script commands is indeed a very nice idea. I could successfully import an animation this way, thanks for your help!

I wish something similar existed in 3dsMax!

 

Best

Yves-Olivier

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report