2022-09-24 11:17 PM
If I change the vakue of a paramter, either via objects settings dialog or editable hotspot, can I get the value of the parameter before the change? Example I change the parameter x1 via editable hotspot. I want to store the value of x1 before the change so I can do some extra needed calculations. So I will have the x1 param with the new value and another param that will have the value of x1 before the change.
2022-09-25 01:45 AM
Use a shadow parameter for that.
2022-09-25 08:26 AM
Could you explain what a shadow parameter is and how to apply one?
2022-09-25 12:02 PM
It's called like that because you're shadowing one parameter to another, invisible one (for the user).
Just make two parameters for every parameter setting you'll need. One is hidden for the user ('X' it), the other one is the main input.
Pseudocode:
! ::Master or Param script::
if GLOB_MODPAR_NAME = "myparam" then
! do your calculations
...
! finally mirror the current value to the shadow parameter:
myshadowparam = myparam
endif
! … and set the parameter value
parameters myshadowparam = myshadowparam