Jump to content
PlatinumFishy

Limit one parameter using another?

Recommended Posts

 

To be more specific I am trying to make parameter1 equal parameter2 when parameter2 is larger than Parameter1

if(param2 > param1)

    param1 = param2;

 

^^this but in the parameter menu

Share this post


Link to post
Share on other sites
Posted (edited)

you can simply clamp param2 by param1, can't you?

@param1 = 0.2; //0.2 being value you want to clamp to but it can be anything

@param2 = clamp(@param2, 0, @param1);

Edited by davpe

Share this post


Link to post
Share on other sites
Posted (edited)

Sorry if I wasn't clear. I know how to do it in vex, hscript, etc. but I am trying to do this on a control null node. So within the actual parameter interface.

 

Edited by PlatinumFishy

Share this post


Link to post
Share on other sites
6 hours ago, PlatinumFishy said:

Sorry if I wasn't clear. I know how to do it in vex, hscript, etc. but I am trying to do this on a control null node. So within the actual parameter interface.

 

In the interface, I am not sure a parameter can refer to himself in the expression.

Therefore, I think your need to create a third parameter that will take min of both values, and use this value instead of parameter2 OR, create a new parameter where you set a value of « parameter 2 » (altough this is a dummy paramater), and in parameter 2 you take min of parameter1 and the value of new parameter...

To create another parameter on a node you need to click on the cog, and edit parameter interface. There you can create a parameter with the type you want.

Share this post


Link to post
Share on other sites
8 hours ago, PlatinumFishy said:

 

To be more specific I am trying to make parameter1 equal parameter2 when parameter2 is larger than Parameter1

if(param2 > param1)

    param1 = param2;

 

^^this but in the parameter menu

Hello Andrew !

In this condition param1 never will bee smaller then param2. If this is OK for you then see hip.

params.hipnc

Share this post


Link to post
Share on other sites

Isnt there a python way to limit sliders? So "red radius" can never be set higher than "blue radius". Without having a third parameter that does the clamping?

Share this post


Link to post
Share on other sites

Hi Konstantin!

Maybe there is solution with python for it but I know python not good unfortunately.  In my hip red radius may be bigger but not smaller. Whereas blue radius may be smaller but not bigger. I don't know what exactly the goal Andrew wants to achieve is.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×