Re: Catching all changes in a scripted custom property

Date : Tue, 27 May 2008 10:14:02 +0100
To : XSI(at)Softimage.COM
From : "Alan Jones" <skyphyr(at)gmail.com>
Subject : Re: Catching all changes in a scripted custom property
Hi Patrick,

On Mon, May 26, 2008 at 7:54 PM, Patrick Boucher
<pboucher(at)patrickboucher.com> wrote:
> If you're in Python you can add this (or something like this) code to
> the _OnInit callback of your property:
>
>        # Inject event functions in global scope
>        g = globals()
>        prop = PPG.Inspected(0)
>        for p in prop.Parameters:
>                funcName = prop.Type + '_' + p.Name + '_OnChanged'
>                g[funcName] = MyProperty_anyParam_onChanged
>
> And only have one single function to deal with all your onChanged events:
>
> def MyProperty_anyParam_onChanged():
>        Application.LogMessage('test')

Awesome! :) thanks Patrick - exactly what I was after.

Thanks Kim, unfortunately the language isn't my choice :(

Cheers,

Alan.
---
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.