Skip to content

Instantly share code, notes, and snippets.

@redglasses67
Last active December 23, 2022 21:15
Show Gist options
  • Save redglasses67/87c2bf78af79b18174d3b5da5d2b7868 to your computer and use it in GitHub Desktop.
Save redglasses67/87c2bf78af79b18174d3b5da5d2b7868 to your computer and use it in GitHub Desktop.
アニメーションの開始終了フレームを取得
import maya.api.OpenMayaAnim as oma2
# アニメーションの開始終了フレームを取得
animationStartTime = oma2.MAnimControl.animationStartTime() # アニメーションの開始フレーム
print("animationStartTime = {} - {}".format(animationStartTime, animationStartTime.asUnits(animationStartTime.uiUnit())))
animationEndTime = oma2.MAnimControl.animationEndTime() # アニメーションの終了フレーム
print("animationEndTime = {} - {}".format(animationEndTime, animationEndTime.asUnits(animationEndTime.uiUnit())))
minTime = oma2.MAnimControl.minTime() # 再生範囲の開始フレーム
print("minTime = {} - {}".format(minTime, minTime.asUnits(minTime.uiUnit())))
maxTime = oma2.MAnimControl.maxTime() # 再生範囲の終了フレーム
print("maxTime = {} - {}".format(maxTime, maxTime.asUnits(maxTime.uiUnit())))
currentTime = oma2.MAnimControl.currentTime() # 現在のフレーム
print("currentTime = {} - {}".format(currentTime, currentTime.asUnits(currentTime.uiUnit())))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment