Page 1 of 1

[script] redefine and customize gui controls

PostPosted: Wednesday, 31.October 2012, 16:02
by ikam
Hi

script code to redefine a gui control, it can be used to extend limits or change step value for examples (take care, it could crash wz with some op, normally limits have a reason to be...)

I put the code here as I never remember the syntax.

for example here I redefine the center parameter of rotate op (bitmap), because it's limited to -4..4

Code: Select all
gui {
float myCenter[2](-100..100 step 0.001);
}
Center = myCenter;


you can now use myCenter gui to control center (limits are now -100..100)

Re: [script] redefine gui controls

PostPosted: Wednesday, 31.October 2012, 17:10
by Skinnytorus
Very handy. Thanks for sharing! :)

Re: [script] redefine gui controls

PostPosted: Wednesday, 31.October 2012, 18:24
by ikam
yes script is powerfull to customize operators with your presets :)
you can add flags and conditions too.


Code: Select all
gui {
float myCenter[2](-100..100 step 0.001);
float myAngle(-100..100 step 0.001);
flags rotate90("no|yes");
}

Center = myCenter;
Angle = myAngle;

if(rotate90 == 0)
{
  angle = 0;
}
else
{
  angle = 0.25;
}

Re: [script] redefine and customize gui controls

PostPosted: Wednesday, 31.October 2012, 18:34
by Skinnytorus
Cool! Thanks again.