Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mottosso authored Feb 28, 2022
1 parent c83c137 commit f584173
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions cmdx.py
Original file line number Diff line number Diff line change
Expand Up @@ -3250,24 +3250,24 @@ def findAnimatedPlug(self):
Example:
>>> _new()
>>> node = createNode("transform")
>>> node["tx"].findAnimatedPlug().plug() == node["tx"].plug()
>>> node["tx"].findAnimatedPlug().path() == node["tx"].path()
True
# Constraint
>>> node["tx"] = {0:1} # Dummy keys so a pairBlend is created
>>> parent = createNode("transform")
>>> _ = cmds.parentConstraint(str(parent), str(node))
>>> blend = ls(type="pairBlend")[0]
>>> node["tx"].findAnimatedPlug().plug() == blend["inTranslateX1"].plug()
>>> node["tx"].findAnimatedPlug().path() == blend["inTranslateX1"].path()
True
# Animation layers
>>> layer = encode(cmds.animLayer(at=node["tx"].path()))
>>> node["tx"].findAnimatedPlug().plug() == blend["inTranslateX1"].plug()
>>> node["tx"].findAnimatedPlug().path() == blend["inTranslateX1"].path()
True
>>> cmds.animLayer(str(layer), e=True, preferred=True)
>>> animBlend = ls(type="animBlendNodeBase")[0]
>>> node["tx"].findAnimatedPlug().plug() == animBlend["inputB"].plug()
>>> node["tx"].findAnimatedPlug().path() == animBlend["inputB"].path()
True
# Animation layer then constraint
Expand All @@ -3277,10 +3277,10 @@ def findAnimatedPlug(self):
>>> parent = createNode("transform")
>>> _ = cmds.parentConstraint(str(parent), str(node))
>>> animBlend = ls(type="animBlendNodeBase")[0]
>>> node["tx"].findAnimatedPlug().plug() == animBlend["inputA"].plug()
>>> node["tx"].findAnimatedPlug().path() == animBlend["inputA"].path()
True
>>> cmds.animLayer(str(layer), e=True, preferred=True)
>>> node["tx"].findAnimatedPlug().plug() == animBlend["inputB"].plug()
>>> node["tx"].findAnimatedPlug().path() == animBlend["inputB"].path()
True
"""
Expand Down Expand Up @@ -5153,15 +5153,15 @@ def _python_to_mod(value, plug, mod):
# Support for animation keys
>>> mod.set_attr(node["ty"], {1: 0.0, 5: 2.0, 10: 0.0})
>>> mod.doIt()
>>> int(node["ty"].read(time=UiUnit()(5)))
>>> int(node["ty"].read(time=time(5)))
2
"""

assert isinstance(plug, Plug), "plug must be of type cmdx.Plug"

if isinstance(value, dict) and __maya_version__ > 2015:
times, values = list(map(UiUnit(), value.keys())), value.values()
times, values = list(map(time, value.keys())), value.values()
plug = plug.findAnimatedPlug()
curve_typ = _find_curve_type(plug)
curve = plug.input(type=curve_typ)
Expand Down

0 comments on commit f584173

Please sign in to comment.