F カーブキーの左の値をDoubleとして設定したり、戻したりします。
/*
This example illustrates how to create an fcurve with a key and then how to change
the value of the left hand-side of the key.
*/
NewScene( null, false );
// Create a null
var n = Application.ActiveSceneRoot.AddNull();
// Get the posx parameter from the null
var posx = n.posx;
// Create an fcurve on posx
var fc = posx.AddFCurve2( new Array(1,0), siStandardFCurve );
// Get the first key
var fckey = fc.Keys(0);
// Set the value of the first key
fckey.Value = 5;
Application.LogMessage( "fckey(" + fckey.Index + ").Value before = (" + fckey.Left + "," + fckey.Right + ")" );
// Make the left/right values different
fckey.Left = 4;
fckey.Right = 6;
Application.LogMessage( "fckey(" + fckey.Index + ").Value after = (" + fckey.Left + "," + fckey.Right + ")" );
// Expected results:
//INFO : fckey(0).Value before = (5,5)
//INFO : fckey(0).Value after = (4,6)
|
'
' This example illustrates how to create an fcurve with a key and then how to change
' the value of the left hand-side of the key.
'
NewScene , false
' Create a null
set n = Application.ActiveSceneRoot.AddNull()
' Get the posx parameter from the null
set posx = n.posx
' Create an fcurve on posx
set fc = posx.AddFCurve2( array( 1.00, 0 ), siStandardFCurve )
' Get the first key
set fckey = fc.Keys(0)
' Set the value of the first key
fckey.Value = 5
Application.LogMessage "fckey(" & fckey.Index & ").Value before = (" & fckey.Left & "," & fckey.Right & ")"
' Make the left/right values different
fckey.Left = 4
fckey.Right = 6
Application.LogMessage "fckey(" & fckey.Index & ").Value after = (" & fckey.Left & "," & fckey.Right & ")"
' Expected results:
'INFO : fckey(0).Value before = (5,5)
'INFO : fckey(0).Value after = (4,6)
|
# # This example illustrates how to create an fcurve with a key and then how to change # the value of the left hand-side of the key. # # You can access the Softimage constants by importing them from the win32com.client module # from win32com.client import constants as c Application.NewScene( "", False ) # Create a null null = Application.ActiveSceneRoot.AddNull() # Get the posx parameter from the null posx = null.posx # Create an fcurve on posx fc = posx.AddFCurve2( [ 1.00, 0 ], c.siStandardFCurve ) # Get the first key fckey = fc.Keys(0) # Set the value of the first key fckey.Value = 5 Application.LogMessage( 'fckey(%d).Value before = (%d,%d)' % (fckey.Index,fckey.Left,fckey.Right) ) # Make the left/right values different fckey.Left = 4 fckey.Right = 6 Application.LogMessage( 'fckey(%d).Value after = (%d,%d)' % (fckey.Index,fckey.Left,fckey.Right) ) # Expected results: #INFO : "fckey(0).Value before = (5,5)" #INFO : "fckey(0).Value after = (4,6)" |