Dear 3D coders,
I am making a simple script to help someone out, but running in to this: the node has a bunch of output ports, Port1, Port2, Port3 etc, and I use the exec() statement to calculate a value for the variables Port1 etc. I use a counter to name the Ports and assign the value of an array in a loop, so i am not directly assigning a value with 'Port1=whatever".
Outcode=“Port”+str(counter+1)+" = TheArray[counter]"
If I check the value for Port1, it is fine, but I get an error:
NameError: Could not find port value for ‘Port1’ in node ‘Python’.
The whole idea is not to have to assign values to ports in the code, but to have the code still work when the user adds more ports manually following the same naming convention.