Re: [scripting] Adding an FCurve to a Linked Parameter via OM?

Date : Sun, 09 Dec 2007 12:51:26 +0100
To : XSI(at)Softimage.COM
From : Julien Stiegler <julien.stiegler(at)free.fr>
Subject : Re: [scripting] Adding an FCurve to a Linked Parameter via OM?
PS :
in fact this is clearly specified in the sdk doc for *FCurve *:
"'Important: FCurve values are in frames, 'but the relationship between parameter 'values considers units of seconds."
And there is even an example (in vb)



Julien Stiegler wrote:

Hey, I am glad it helped you..
this should be in the documentation (but I don't think it is..).
best regards
Julien

Julian Johnson wrote:

Julien - your example works perfectly. Thanks very much. So I guess the horizontal scale, for some reason, is always represented as frame/framerate. This snippet does the job for me...

import win32com.client

def disp(ob):
return win32com.client.Dispatch(ob)

oPlayControl = Application.ActiveProject.Properties("Play Control")
Rate = oPlayControl.Parameters("Rate").Value

oRoot = Application.ActiveSceneRoot
oCube = oRoot.AddGeometry( "cube", "MeshSurface" )
oSphere = oRoot.AddGeometry( "sphere", "MeshSurface" )
oParam = oSphere.Parameters('posx')
oExpr = disp(oParam.AddExpression('l_fcv(cube.kine.local.posx)'))
oFCurve = oExpr.Parameters('l_fcv').AddFCurve(20,)
oFCurve.AddKey(0*Rate,0)
oFCurve.AddKey(20*Rate,20)

Julian
---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi




---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi




--- Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body: unsubscribe xsi


Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available.
This site supposedly brought to you by Benjamin Grosser and the Imaging Technology Group.