Application.GetPrim( "Null" ) Application.SetMarking( "kine.local.pos,kine.global.pos" ) Application.AddToMarking( "kine.local.ori" ) markings = Application.GetMarking() for i in markings: Application.LogMessage( i )
次の例では、Python で ISIVTCollection を使用する方法を示すために GetKeyInfo コマンドを使用します。GetKeyInfo コマンドには戻り値がありませんが、9 つの出力引数を次の順番で使用します。Parameter、LeftValue、RightValue、LeftTanParam、LeftTanValue、RightTanParam、RightTanValue、RightSegKind、Constraints。これらの引数が ISIVTCollection オブジェクトとして返されます。
from win32com.client import constants as c Application.NewScene( Application.ActiveProject, 0 ) root = Application.ActiveSceneRoot # Set up an fcurve on a null oObj = root.AddNull() aKeys = ( 1, -5.0, 25, 7.0, 50, 2.0 ) oFCurve = oObj.posx.AddFCurve2( aKeys, c.siDefaultFCurve ) # The GetKeyInfo command uses these output parameters (in order) # Parameter LeftValue RightValue LeftTanParam LeftTanValue RightTanParam # RightTanValue RightSegKind Constraints ivtInfo = Application.GetKeyInfo( oFCurve, 1 ) Application.LogMessage( "# of items: " + str(ivtInfo.Count) ) # You can loop through the info for entry in ivtInfo : Application.LogMessage( str(entry) ) # You can get the info by index i = ivtInfo.Count-1 while i >= 0 : Application.LogMessage( "Item" + str(i+1) + " = " + str(ivtInfo(i)) ) i = i - 1 # You can get the info by name Application.LogMessage( "Parameter: " + str(ivtInfo.Value("Parameter")) ) Application.LogMessage( "LeftValue: " + str(ivtInfo.Value("LeftValue")) ) Application.LogMessage( "RightValue: " + str(ivtInfo.Value("RightValue")) ) Application.LogMessage( "LeftTanParam: " + str(ivtInfo.Value("LeftTanParam")) ) Application.LogMessage( "LeftTanValue: " + str(ivtInfo.Value("LeftTanValue")) ) Application.LogMessage( "RightTanParam: " + str(ivtInfo.Value("RightTanParam")) ) Application.LogMessage( "RightTanValue: " + str(ivtInfo.Value("RightTanValue")) ) Application.LogMessage( "RightSegKind: " + str(ivtInfo.Value("RightSegKind")) ) Application.LogMessage( "Constraints: " + str(ivtInfo.Value("Constraints")) )