FIXED: Crash with python expression - TD 88 - 20560

Hello,

I have a systematic crash when using the following expression in a parameter:
op(‘record1’)[‘chan1’]

View the attached scene and screenshot for details.

This expression comes from the page[url]http://www.derivative.ca/wiki088/index.php?title=Python_Tips[/url].

What I tried to attempt with this expression is to get the output of the button, named out1, in the Record parameter of the Record CHOP. I know on this case there is an input for the record on the CHOP but that is just a sample case.
So could you please provide me the corresponding expression to do so?

Beside 2 suggestions:

  • It would be very convenient to have the build version number displayed in the title bar of TD so that it can be seen at a glance on screenshots or when TD is open ;

  • It would be really cool if the expression I am looking for, consisting in getting the output of an operator, could be obtained by UI manipulations. I explain myself: when I drop the Button OP onto the Record parameter the expression “/project1/ButtonToggle” appears in the Record value field. I would like to have a similar behavior when I drag and drop the output of the button onto a parameter: it would create an expression such as “/project1/ButtonToggle.outputs[out1]”. Visually it would appear as when we drad the output for an operator connection and the mouse cursor would change to the “+ and arrow” when it is over a parameter field.

I think this makes some sense.

Thank you
CrashWithPythonExpressiont.1.toe (7.74 KB)

Hello, thank you for the crash report, we are able to reproduce it here and will get it fixed.

To get the value out of the button you need to add an expression to the Record parameter that pulls in the information from the CHOP in the button.

In the attached example, I show how to do it by appending a Null CHOP to the button or by slightly changing the expression to fish out the information from inside the button.
PythonExpressiontForRecord.1.toe (7.35 KB)

Thanks for the examples, they are really instructive.

Indeed the expression I was looking for is:
op(‘ButtonToggle/out1’)[‘state’]

The second example with the Null CHOP is very interesting because it allows to get the name of the various channels held by the output.

By the way I have a waning message when I open the project you provided, is this normal?
I guess it is an initialization problem due to the value of the button at load time.