View Full Version : interactive sliders in script with XSI

09 September 2004, 10:18 AM

I would like to create a diolog (in script) with a slider that moves for instance a cube in the X-axis (so without using a proxy parameter). I created a slider, but I need to create a button "apply" for instance to apply the changes involved by the value of the slider. Actually ,my cube doesn't move while the value of my slider changes, but I need more interactivity!! If anyone knows how to do this....



09 September 2004, 03:12 PM
You can't do this. You create the slider, set a value, and then the script uses the value to change the target parameter. There is no interactivity of that sort possible with scripts.

A workaround could be to create a script that creates a custom parameter set, you change it, and then you destroy the cpset...


09 September 2004, 09:34 AM
Hi Bernard,

Once again, you are the one who answer to me. The solution my developer found is to use Java script instead of VBscript, and to use the command on value change of the slider itself.
We also think about the custom parameter set, but we wanted to have our button and sliders in the same dialogs.
Here is the code used to create a slider that changes the value of a sphere radius.

var oPSet = ActiveSceneRoot.AddProperty("CustomProperty",false,"SphereRadius") ;
var oLayout = oPSet.PPGLayout ;
oPSet.AddParameter ("Radius", siFloat) ;
oLayout.AddItem("Radius") ;
oLayout.Logic = Radius_OnChanged.toString();
oLayout.Language = "JScript" ;
if ( !InspectObj( oPSet, null, null, siModal, false ) )
//CreateBones( oPSet ) ;
DeleteObj( oPSet ) ;
function Radius_OnChanged()
SetValue("sphere.sphere.radius", PPG.Radius.value, null);

Thanks again

CGTalk Moderation
01 January 2006, 08:00 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.