[script] redefine and customize gui controls

[script] redefine and customize gui controls

Postby ikam » Wednesday, 31.October 2012, 16:02

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)
ikam
Operator
Operator
 
Posts: 911
Joined: Friday, 14.October 2011, 13:00
Location: France

Re: [script] redefine gui controls

Postby Skinnytorus » Wednesday, 31.October 2012, 17:10

Very handy. Thanks for sharing! :)
Skinnytorus
Operator
Operator
 
Posts: 1300
Joined: Monday, 06.February 2012, 17:46

Re: [script] redefine gui controls

Postby ikam » Wednesday, 31.October 2012, 18:24

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;
}
ikam
Operator
Operator
 
Posts: 911
Joined: Friday, 14.October 2011, 13:00
Location: France

Re: [script] redefine and customize gui controls

Postby Skinnytorus » Wednesday, 31.October 2012, 18:34

Cool! Thanks again.
Skinnytorus
Operator
Operator
 
Posts: 1300
Joined: Monday, 06.February 2012, 17:46


Return to Tutorials



Who is online

Users browsing this forum: No registered users and 17 guests

cron