Can we use PulpScript to redirect variable access?

From what I understand you're trying to build a variable name from variables, which was discussed here: Reference variables within variable names? and currently isn't possible.

What you could do instead which might reduce your code a little, is have a different event for each tool that sets up it's variables, something like so

on getParams do
  t_idx = frame
  setupTool = "setup_tool_{t_idx}"
  call setupTool
end

on setup_tool_0 do
  t_name = "camera"
  t_cost = 1
  t_valid = _c_tool_0
end
1 Like