Re: enumControls and siControlCombo...

Date : Sat, 8 Apr 2006 01:21:07 -0700
To : XSI(at)Softimage.COM
From : "Steven Caron" <carons(at)gmail.com>
Subject : Re: enumControls and siControlCombo...
so .Item was it..

i was looking right at that property of a collection. to bad the example didn't show anything actually using that property and why its helpful.

i see that it accepts integers or string types :)

thanks a ton francois!

steven

On 4/7/06, francois.painchaud(at)sympatico.ca < francois.painchaud(at)sympatico.ca> wrote:
This should do the trick:

var findCams = ActiveSceneRoot.findChildren("",siCameraPrimType);
var theCam = "Camera"
LogMessage( findCams.Item(theCam).FullName );
LogMessage( findCams.Item(theCam).parameters("aspect").value );
                     ^^^^^^^^^^^^

Francois

> De: "Steven Caron" <carons(at)gmail.com>
> Date: 2006/04/08 sam. AM 01:06:34 GMT-04:00
> À: XSI(at)Softimage.COM
> Objet: Re: enumControls and siControlCombo...
>
> i apolgize again. i think that was confusing.
>
> i have self-installed property. i have defined its many parameters.
> "cameras" being one of them....
>
> var cams = oProp.addParameter3("cameras", siString);
>
> i have defined its layout and defined "cameras" as...
>
> rLayout.addEnumControl("cameras",Array(),"Cameras",siControlCombo)
>
> i have filled it with information in my OnInit callback...
>
> function indigoRenderOptions_OnInit(){
>     var rLayout = PPG.PPGLayout;
>     var combo = rLayout.item("cameras");
>     var findCams = application.activesceneroot.findChildren
> ("",siCameraPrimType);
>     var cams = new Array();
>     for(i=0;i<findCams.count;i++){
>         var currentCam = findCams(i).fullname;
>         cams.push(currentCam);
>         cams.push(i);
>     }
>     //update the array in the ppg...
>     combo.UIItems = cams;
>
>     var theCam = PPG.rendercam.Value;
>     PPG.aspectratio.value = findCams(theCam).parameters("aspect").value;
>
>     PPG.Refresh();
>
>     return true;
> }
>
> that parameter is a string. and i cannot use it in as an index in my
> findCams collection. i know you can use strings in collections but it
> doesn't like how i am passing it
>
> thanks for your help
>
> steven
>
>
> On 4/7/06, francois.painchaud(at)sympatico.ca < francois.painchaud(at)sympatico.ca>
> wrote:
> >
> > How is your parameter "cameras" defined (i.e. need more code snippets)?
> >
> > Francois
> >
> > > De: "Steven Caron" < carons(at)gmail.com>
> > > Date: 2006/04/08 sam. AM 12:38:18 GMT-04:00
> > > À: xsi(at)Softimage.COM
> > > Objet: Re: enumControls and siControlCombo...
> > >
> > > so was looking closer..
> > >
> > > PPG.cameras.Value returns a string...
> > >
> > > how can i get this parameter as an integer to use with as collection's
> > > index?
> > >
> > > On 4/7/06, Steven Caron <carons(at)gmail.com> wrote:
> > > >
> > > > wow that was nice... i wasn't done :)
> > > >
> > > >
> > > > so i have a dropdown box that lists all the camera's in the scene...
> > > >
> > > > //get the cams...
> > > > var root = application.activeSceneRoot;
> > > > var findCams = root.findChildren("",siCameraPrimType);
> > > > var combo = layout.item("cameras");
> > > > var cams = new Array();
> > > >
> > > > //then i build an array to be passed to the combo.UIItems
> > > >     for(i=0;i<findCams.count;i++){
> > > >         var currentCam = findCams(i).fullname;
> > > >         cams.push(currentCam);
> > > >         cams.push(i);
> > > >     }
> > > > //update controlCombo...
> > > > combo.UIItems = cams;
> > > >
> > > > //now i have some proxy params that need to be filled
> > > > //with the params from the current camera in the drop down
> > > > var theCam = PPG.cameras.Value ;
> > > > PPG.aspectratio.value = findCams(theCam).parameters("aspect").value;
> > > >
> > > > for some reason the string that i get back from PPG.cameras.Valuedoesn't
> > > > want to be used in the findCams collection.
> > > >
> > > > why is this?
> > > >
> > > > how can i read the current value of the drop down and use that to make
> > > > sure i am looking at the right camera?
> > > >
> > > > thanks


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