Inconsistant feedback from opinput expression

Hello,

I have this strange behavior, looks like a bug, or at least a strong inconsistant behavior, because I cannot explain why I get these results otherwise (except if I made a big mistake soemwhere :S).

In the Textport I use the opinput expression to get the name of a chop input connected to a chop. In a very simple example (attached), I connected a Constant chop (constant1) to an Animation op (animation1) and to a Null chop (null1).

When I ask for the input of the Null I get what I am looking for:

root -> cc /container1 root -> echo `opinput("null1", 0)` constant1 root ->

When I ask for the input of the Animation I don’t get any result:

root -> echo `opinput("animation1", 0)` root ->

According to the documentation ([url]TouchDesigner Documentation) and as I understand it, I should get the name of the input whatever operator I ask the input to. I have a similar lack of return from the function if I manually add a second In chop to animation1.

Someone can help me on that, please?

Thank you very much.
opinput_trouble.tox (1.13 KB)

The regular input to a COMP is at the top/bottom of it, not the ones on the right/left. Those are called COMP inputs. I think you can query them if you use the opinput expression on the in* nodes that are inside the animation COMP.

Could you please add some details and idealy some code please? I have troubles to see what you mean. :confused:

Thx

Well, I kind of see what you mean but it is still not clear at all for me:

  • the In operator inside the Animation op is already connected to a timeline Chop named index, so when I call opinput on it I get this node:

root -> echo `opinput("animation1/in", 0)` index root ->

  • the Animation operator doesn’t have any top nor bottom inputs, so why the existing one is not returned?

The way I see it from what you says is that there is something confusing in the way top/bottom and left/right plugs are used and accessed by the expressions, is that right?

COMPs are different from other nodes in that their ‘native’ inputs and outputs are at the top and bottom. That is to say, input that are the same type as the node itself. Some COMPs don’t have any, but other such as Panels and Object COMPs do.
The opinput expression is meant to query native inputs, not the left/right inputs on COMPs that can be any other node type. Hope that clears it up a bit