[Solved] Object variables don't have value/string versions...?

Why don’t object variables, when used in expressions, have separate ‘value’ and ‘string’ versions?

image

Global and scene variables do:

image

Using a string object variable in this way results in: ToString(OBJECT.Variable(VARIABLE)). Whereas using a string scene variable with ‘Text of a scene variable’ results in: VariableString(VARIABLE).

So without typing it manually, is there no way to get OBJECT.VariableString(VARIABLE)?

What do you mean? How would you expect the expression to work? Here’s what I get :

When you type the expression manually, yes, it works and shows the available options in the drop down. But when you use the Expression Editor it only shows the option to use the variable ‘value’, not the ‘string’ as well.

So I guess I’m wanting my first screenshot to show the same sort of options as my second screenshot.

It seems both string / numerical versions are intended to be used in the expression editor, as two options show up when searching, but both yield the numerical expression:

Ah, interesting! Thanks for pointing this out @OongusBoongus. They do seem to be different, as selecting each one gives a slightly different result:

image

I.e. One uses VariableString() while the other uses ToString(). So presumably the former is the string version and the latter is the value version.

So this appears to be a bug in that they both don’t show up in the main list…

1 Like

Yeah I never tested them, just assumed based on name they were both numerical. Good to know it is just a display issue! Just filed a bug report:

Thanks @OongusBoongus. I just filed my own bug report, mainly because I wanted to provide a PR as well:

EDIT: Marking this as solved as we found the issue and I’m sure it’ll be fixed in due course.

3 Likes