DAT exports with expressions

Is it possible to have a DAT that exports expressions onto parameters?
I recall it being possible with TScript using backticks at some point in the past. But is there a python equivalent?

For example, if you have a COMP with a parameter Foo, containing a CHOP bar with a channel x, is it possible to have a DAT that pushes an expression of op('./bar')['x'] onto that parameter using exports?

Or to export an expression like me.name + 'abc' onto a string parameter and have it interpret that as an expression rather than that literal text?

Not that I know of, but how about putting in your par expression something like:

eval(get your expression from the dat)

1 Like

I don’t think you can do it exactly like that, but there are a couple paths:

  1. watch your DAT with a datexec and push the expression onto the par whenever it changes
  2. use an evaluate DAT with the expressions on it and watch the resulting table with the par expression

You probably already know, but OP.evalExpression lets you evaluate an expression as if it were on a parameter on OP

1 Like

That makes sense.

I’ve used the eval DAT option, but it has limitations if you’re exporting onto multiple ops which would have instance-specific behavior.

I think I’m going to go with the push option since that’ll make bidrectional sync easier for this particular use case.

1 Like