SOLVED: Importing a Base.tox from older versions messes up parameters enable expressions

hsv_to_rgb_CHOP.tox (1.4 KB)
Importing a custom component from an older version of TouchDesigner (v077 build18260) into a more modern version (v099 2022.25370 in my case) gives a peculiar issue when it comes to enabling expressions.

In my case I downloaded the hsv_to_rgb_CHOP.tox at this link and after changing some stuff both internally and on the custom parameters I wanted to had a TOGGLE custom parameter to enable the HUE parameter so I added the enable expression me.par.Toggle == 1 which endend up giving me the following error:

Enable expression errors:
Error: (tscript) Bad data type for function or operation (Parameter: Hue (0-360)) (/project1/hsv_to_rgb_CHOP)

Recreating the Base COMP fixed the issue and made the component work just fine

This is a 2012 .tox set to use Tscript. You can see the “T” at the top right of the parameter dialog in your screenshot. It means the COMP is in Tscript mode.

We are now using Python. Your expression is Python.

Internally the expressions are also using Tscript.

Not a bug.

What you want to do is take inspiration from some HSV to RGB maths you can likely find on Google or StackOverflow and port them to CHOP or a mix of CHOP + Python… or have the base set to Python (what you did by recreating it) but keep the Expression CHOP in Tscript inside.