I am trying to create an animation nodes project where an empty will be used as an interactive controller for another object. I need to give the empty an initial position away from the origin as the position of the empty determines the size of a mesh.
For the sake of usability and simplicity, I am instancing the empty, rather requiring the user to manually create one and enter it into an object input node.
Here's my problem. I can give the initial position via a transformation output node. However, the empty will then return to those coordinates every time the node tree executes.
My best idea so far is to have some kind of value that indicates whether or not the current execution of the node tree is the first or not. If it is the first, then position the empty at the initial position (e.g. 1,1,0). If it is not the first execution of the node tree, then leave it where it is. However, I do not know if it's even possible to determine that within animation nodes.
I'm illustrating that idea in the image below by having a switch node determine whether to place the instanced empty at a pre-determined position, or allow it to be moved freely by the user. If I could somehow plug in a test for "is this the first execution of the node tree?" into the switch node, then this would work.
Any ideas, please?