Skip to main content
Inspiring
January 21, 2009
Question

Scale parameter

  • January 21, 2009
  • 3 replies
  • 2398 views
Hello everyone.
I m trying to create a parameter with 2 or 3 dimension.
Actually just like the scale parameter.
I tried to create it with
PF_ADD_POINT, but it does not work by default with 3 dimension.
How to specify that i want three dimensions? I did not fine any revelant field in paramDef.u.td...
the other problem is that i want to have %, can I specify % in the display parameter of point?
I also wold like to set the precision of my field.

I would like to be able to link my paremeter naturally to a transform scale. Wich succeed with a point parameter when we are in 2D, but fails when you swap to 3D layer...

any ideas?

3 replies

Community Expert
February 8, 2009
as far as i know, there's no 3D parameter that looks like what you describe.
many effects that need to define a point in 3D use a point param for the x and y and an additional slider for z.
I totally agree with you that it's a pain in the behind.
having to tie the x and y separately for the z and defining which channel goes where... it's a repeating head ache.

I can think of three solutions for you:
1. create a custom parameter.
you draw the param yourself so you can make it whatever you want.
2. instead of having a parameter that describes a 3D attribute, use a layer selector and read that layer's scale (or position).
you can even have a button on your effect that creates a null object and selects it automatically.
3. use a color param, it can hold 3 or 4 parameters with one keyframe.
in fact, you can use a color param with a custom interface and just draw the data there. the problem with a color param is that it's limited in range. it can't go negative or past 100%.

in my opinion a custom param is the way to go.
Known Participant
May 29, 2025

PF_ADD_POINT only support integer in paramSetup, how to feed in float intial value?

James Whiffin
Legend
June 3, 2025

You can convert the fixed value to float using the FIX_2_FLOAT macro

Inspiring
February 5, 2009
Thank you for the answer.
I can of course add three float sliders, and that s what I m doing right know.
But, if you want to link this parameter to a scale attribute of a layer, you will have to edit the expression, and you can not link directly with the UI. And you have three lines in your UI instead of one.
you will have to write something like:
temp1 = effect("MyEffect")("Scale 1");
temp2 = effect("MyEffect")("Scale 2");
temp3 = effect("MyEffect")("Scale 3");
[temo1, temp2, temp3]
in the expression field of your scale attribute.

I would like to be able to define a parameter the same way layer scale parameter is defined, so that user can use the "Expression pick whip" button...
Known Participant
February 5, 2009
How about using 3 float sliders?
PF_ADD_FLOAT_SLIDER
Then specify the range from 0-1 or 0-100.