Re: find parameters that are linked by expression

Date : Mon, 08 Oct 2007 11:00:27 +0200
To : XSI(at)Softimage.COM
From : Guillaume Laforge <guillaume(at)alamaison.fr>
Subject : Re: find parameters that are linked by expression
Hi Martin,

You can find the connected "object A" of an expression operator with the Target propertie.

To find a parameter with an expression using the object A, you must search for all the parameters in your scene. If a parameter expression (parameter source) use "object A" as a target then it is the parameter you want.

Example :

//****************************
MyParam = Dictionary.GetObject("null").posx;

gl_FindExpressionTarget0(MyParam);


function gl_FindExpressionTarget0(MyParam) { var allObjects = ActiveSceneRoot.FindChildren( );

   oEnumObjects = new Enumerator( allObjects ) ;
   for (;!oEnumObjects.atEnd();oEnumObjects.moveNext() )
   {
       var obj = oEnumObjects.item() ;
       var oParams = obj.Parameters;

       oEnum = new Enumerator( oParams ) ;
       for (;!oEnum.atEnd();oEnum.moveNext() )
       {
           var oParam = oEnum.item() ;
           if(oParam == obj.roty)
           {
               if(oParam.Source)
               {
                   var oExpr =oParam.Source;
                   var oTarget = oExpr.InputPorts(0).Target2.FullName;
                   if(oTarget == MyParam)
                   {
                       LogMessage( oParam )
                   }
               }
           }
       }
   }
}
//*****************************

Hope this help,

Cheers

Guillaume Laforge | La Maison



Martin Matzeder a écrit :
Hi,

let's say I control a parameter by a simple "null1.kine.global.posx" expression. is there a way by scripting to that I can find out what parameter is controlled by the null1.kine.global.posx parameter?

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