Linked Params in Actions vs Python 2005-05-03 - By Patrick Boucher
Back Patrick Boucher wrote: > Hello all, > > In a scene I have Actions that contain linked parameters. I need to > get to these linked params through scripting but my script triggers > errors in XSI. Here is a simplified version of it: > > -- --- Start Script -- --- > Application.SelectObj("Sources.Animation.Model.SpherePosY", "", "") > > for i in Application.Selection: > for s in i.SourceItems: > Application.LogMessage(s.Type) > Application.LogMessage(Application.ClassName(s)) > Application.LogMessage(s.Active) > Application.LogMessage(s.Target) > src = s.Source > Application.LogMessage(s.Type) > -- --- End Script -- --- > > The code dies on the line before last. If the source is an FCurve > instead of an expression (linked param) it works allright. > > A test scene describing the issue is available at > http://www.buzzimage/~patrickb/L_Fcv_Bug.zip > > Any ideas??? >
Hmmm Yeah, script output might be nice!
-- --- Script Output -- --- Application.SelectObj("Sources.Animation.Model.SpherePosY", "", "") #INFO : ExpressionAnimItem #INFO : AnimationSourceItem #INFO : True #INFO : sphere.kine.local.posy #ERROR : Traceback (most recent call last): # File "<Script Block >", line 9, in ? # src = s.Source # File "C:\Python24\Lib\site-packages\win32com\client\dynamic.py", line 484, in __getattr__ # raise pythoncom.com_error, details #COM Error: Exception occurred. (0x-7ffdfff7) - [line 9] -- --- End Output -- ---
If you use Jerry's introspection trick you can clearly see that s should have a Source property. Introspection of s gives the following:
['Active', 'AddRef', 'Application', 'Categories', 'FullName', 'GetIDsOfNames', 'GetTypeInfo', 'GetTypeInfoCount', 'Help', 'Invoke', 'IsEqualTo', 'Name', 'Origin', 'OriginPath', 'Parent', 'QueryInterface', 'Release', 'SetAsFCurve', 'SetAsStatic', 'Source', 'Target', 'Type', 'UniqueName']
-- Patrick Boucher TD - Coder - Resident geek Buzz Image Group Tel 514.848.0579 Fax 514.848.6371
www.buzzimage.com www.xsi-blog.com --- Unsubscribe? Mail Majordomo@(protected) with the following text in body: unsubscribe xsi
|
|