Page 1 of 1

Redefining a Variable Node via a script

PostPosted: Thu Sep 11, 2014 7:18 pm
by alexbright
I’m trying to change what Variable a Variable node is referencing using a custom script and the “WDNodeSetParam” script

Here is my problem, if I have a Variable called “Hello” with the current value of “World”, and I use the "WDNodeSetParam,NodeID,ParamID,Value” script to try and reassign what variable the node is referencing, instead of actually getting the variable there, I get the current Value stored in the variable. So if I used “WDNodeSetParam,1,1,Hello”, then The Variable node 1, would have the value of “world” stored in Peram 1, rather then my variable.

Is there a different script I should be using, or is there some way to escape the variable?

Thanks in advance,

Alex Bright

Re: Redefining a Variable Node via a script

PostPosted: Thu Sep 11, 2014 10:28 pm
by Dennis Kuypers
Hello Alex,

there currently is no way of "escaping a variable name". Literals (plain) are not distinguishable from variable names. That is one drawback of the way the Widget Designer makes things easy for the user.

I can think of two workarounds to solve this (I have not tested any of them as I am not at the office right now):

1. Create another variable (for example hello_var) with the value "hello". So when using the script with hello_var it will resolves to actual "hello" variable name.
2. Write the variable name in hex, you can use this tool to convert it:Textconverter tool You should get something like [h68h65h6Ch6Ch6F]. Try using this as the variable name

Regards
Dennis

Re: Redefining a Variable Node via a script

PostPosted: Thu Sep 11, 2014 11:11 pm
by alexbright
Option1 works, creating a proxy variable does in fact insert the correct text.

Option2 (while I like it) does not work. It inserts the actual text "[h68h65h6Ch6Ch6F]" rather then hello... Which I found surprising.

I'm talking about 60 variables, so this creating these proxy variables isn't necessarily the answer I wanted to hear.

If you can think of anything else, please let me know.

Thank you!
Alex

Re: Redefining a Variable Node via a script

PostPosted: Fri Sep 12, 2014 3:27 pm
by alexbright
Markus from tech support had the answer using Node Commands.

The following script will insert the the value "hello" into into index 1 of node 1, without any of it's context.

node1.1@hello