VL Expr node

heyhey,

A quick test, trying to bring back the Expr node in VL.
It’s making use of programmatic input pin creation, as demoed in the “Create Pins Programmatically” help patch, and a vvvvery cool expression evaluation nuget :

It can do cool stuff like

Not a nuget because it’s just a simple node, but feel free to tweak and use wherever you like!

To use that, you’ll just have to install the aforementioned nuget :

nuget install CodingSeb.ExpressionEvaluator

And there you go!

Expr.vl (45.4 KB)

9 Likes

.
You could add it to VL.Addons

1 Like

Will make a PR tomorrow!

1 Like

This is now available with VL.Addons. Thanks.

2 Likes

Hey @sebescudie, is there way to wrap this node in a process or operation to get a node that throws an exception/error (the node shows violet border around it like you can see in the pic below) if Expr node failed to resolve?

I can see a way to create an exception using Exception > Create but don’t know a node that can help me raise the exception.

Another issue I encountered when going about wrapping this I couldn’t find a way to expose dynamic pins. Do you know a way of exposing them?

Hey,

Back then I wrapped the part that evaluates the expression in a Try node.

Not sure if that was a good design decision or not to be honest. For now you can catch whether the evaluation worked or not with the Failure and Error Message output pins.

Regarding dynamic pins, I’m not sure how that’d work out but you could try right-click/Configure the Expr node and enable Connect To Signature. This way, pins that don’t have anything connected to them will automatically create Inputs/Outputs on the wrapping node.

I actually tried Connect To Signature and it seems to not pick up dynamic pins. That’s why I asked.

For now you can catch whether the evaluation worked or not with the Failure and Error Message output pins.

Yes I know I can recognize an error using Failure boolean. I rather want to rethrow this exception and not let it silently fail.

It seems to work here, did you set the Generic flag on the wrapper? Adding an extra variable later works as well.

Edit To manually throw an Exception, enable the Advanced aspect in the node browser and look for Throw (Message)

Okay let me check. Did you create an Operation node or a Process node to wrap Expr?

A Process node.

Welp, that solves it, thanks! Throw was hidden under experimental, and given Exception node is present in advanced I expected Throw node to be present there too.