Hi all,
I’m about to embark on what is effectively a rewrite of the Maya-native animation import/export format “ATOM” based on a few facts that I’m hoping you can disprove.
cmds.file(i=True)
)cmds.file
for passing options to a MEL command(1) is rather self-explanatory. Is there any other way to import ATOM without using cmds.file
? Or any way of preserving undo? I think not.
(2), this seems to only be an issue with the HumanIK Maya integration.
Try it for yourself.
C:\Program Files\Autodesk\Maya2018\Examples\Animation\Rigs\rp_antonia_rigged_HIK_arnold.ma
rp_antonia_rigged_Ctrl_HipsEffector
Autodesk would like for you to go here and download the HIK examples, but I’ve attached the above rig to this email, unmodified, for your convenience. But the same holds true for any HIK rig, even the ones you generate using the HIK tools in Maya.
The exported file will contain your animation (but not accurately, more on that below), but the import will not succeed.
What I’ve found is that there is a special node associated with HumanIK node, called keyingGroup which blocks the import of animation, for both ATOM and old-school .anim formats. I assume there is a callback on any file import operation to remove/undo anything done to nodes connected to the “.affectors” array attribute on this node.
Something you can try for yourself with this.
cmds.delete(cmds.ls(type="keyingGroup")
(3) ATOM cannot export HumanIK reliably. What does that mean?
Using the same setup you have up there, set a key on the forearm. Then export the whole Ctrl_Reference group, with the full hierarchy.
Now look in that ATOM file, and you’ll find that not only is the forearm included. But the upper arm too! When you try and import this (using the above “hack”), you’ll find that both your forearm and upperarm now contain the same keys (and that the poor guy looks broken).
What does this mean? That ATOM cannot reliably export the right animation from the right nodes. I cannot fathom how, but there it is, in the flesh.
For completeness, here’s the full command I used.
file -import -type "atomImport" -ra true -namespace "test" -options ";;targetTime=3;option=scaleReplace;match=string;;selected=childrenToo;search=;replace=;prefix=;suffix=;mapFile=C:/Users/marcus/maya/data/;" "C:/Users/marcus/maya/data/test.atom";
(4), a Python API isn’t necessary, but would be convenient. Here’s how I currently export using ATOM.
from maya import cmds
fname = "/some/file.atom"
cmds.file(
fname,
type="atomExport",
force=True, # Overwrite
exportSelected=True,
options=(
"precision=8;"
"statics=1;"
"baked=True;"
"sdk=0;"
"constraint=0;"
"animLayers=0;"
"selected=childrenToo;"
"whichRange=2;"
"range=1:100;"
"hierarchy=none;"
"controlPoints=0;"
"useChannelBox=1;"
"options=keys;"
"copyKeyCmd="
"-animation objects"
"-option keys"
"-hierarchy none"
"-controlPoints 0"
),
)
And similarly for import.
cmds.file(
fname,
i=True, # import
type="atomImport",
options=(
"targetTime=2",
"option=scaleReplace",
"match=string",
"selected=childrenToo",
"mapFile=;",
)
)
..but would really like to avoid it. Partly because of poor syntax from passing strings to MEL, but mostly because using cmds.file
kindly and automatically clears Maya’s undo buffer, which means you cannot undo the animation you’ve imported.
So let’s start there. Ideally you’d tell me these things are simply not true, and that I’m using it wrong. Alternatively you’d tell me about this other project which solves exactly this. Worst and likely case is you’ll tell me you’ve also had issues with ATOM and ventured down the road of rewriting it well.
Last but not least, here are my requirements.
More or less what ATOM promises, apart from the last two.
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/1c1bd1ae-7f3e-46fc-8067-31517d1155d9o%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOCrPFoHK3NKuFMsVJK8vJ%2Bgy_%2BMtzkLZq9ZhCMJ35Wqbw%40mail.gmail.com.
David Moulder Technical Animator / Artist squi...@gmail.com Professional Profile | Mobile: +44 (0)7814033242 |
See who we know in common | Want a signature like this? |