Dynamic paths for nodes referencing

Hello there,

When one references some node in some parameter of another node and then one changes the path, one has this pop up window asking the user what to do with the changed path.

I am wondering how does TouchDesigner does this? I have this project called TDMorph where I use the absolute paths of parameters to create dynamic UIs and stuff, which is not the most flexible way to address things. Is there any method to incorporate TouchDesigner’s ability to detect path changes into custom projects?

Thank you!

The closest would be to use an OP Execute DAT, which can monitor changes to an operator’s path or name.

It’s a bit tricky though, as once the path or name change, the OP Execute DAT ‘Monitor OPs’ parameter is now pointing to a non-existent node.

it might be worth looking into OP.id
opid = op(“myNode”).id
and then to set parameters you can do
op(opid).par
renaming will keep IDs intact, but they will change on restart and I think also if nodes are cut/pasted to a new location

Another idea. when you add a par/node to TDMorph you could create a uuid tag (at the node) and use opfind DAT and it’s callbacks to find all nodes with a uuid tag and store then in your extension. then you just use the uuid to lookup the current node path

I know the problem to well. When i have control over the creation of comps i tend to give them UUIDs as the global OP shortcut so refferencing gets simpler. Then the idea is to just do all param work with custom pars to net fall in the trap of broken refferences.
Another way would be to give every newly created OP a UUID as a name but thats hard to do with the touch workflow we know.

I opened a RFE a while ago asking about a UUID Member/constitent ID for op’s

Thank you guys for your responses! I see there’s not a straightforward way of doing this.
Ideally I would like to build:

  1. A persistent across savings and reliable addressing system.
  2. Avoid assignment of things to nodes outside the TDMorph system, so that everything is 100% self contained without affecting users networks in any way.
  3. Avoid things that can be changed by the user.

With this in mind:

@rob the OP Execute DAT is not really viable in this case since there’s many many things to keep track of dynamically and it would be really cumbersome to create something reliable around this approach.

@Achim id’s are not really viable because of point 1

The tags idea though sounds interesting… although this means writing a tag to every node that is referenced by TDMorph, which conflicts with points 2 and 3 (although tags are hidden enough that is not so vulnerable to user change perhaps…)

@alphamoonbase Definitely not a fan of Global shortcuts because of points 2 and 3. Same for the approach of a uuid via a name, which is highly undesirable.

The very best way would be indeed a TouchDesigner assigned consistent UUID over projects. Just like the op(‘node’).id but consistent. So @alphamoonbase I’m seconding that RFE! :slight_smile:

1 Like