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

Date : Sun, 02 Dec 2007 10:56:19 +0000
To : XSI(at)Softimage.COM
From : Julian Johnson <julian(at)exch.demon.co.uk>
Subject : Re: [scripting] Adding an FCurve to a Linked Parameter via OM?
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


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.