GlennimusPrime Posted June 15, 2023 Share Posted June 15, 2023 Hello! I'd like to dynamically create an array in VEX that contains a list of all the node names that are piped into a merge. Example: I'd like to use some VEX inside the crowd transition node that can call on an array of string names that all come from the pink crowd state nodes that are piped into the merge. Is this possible at all? Quote Link to comment Share on other sites More sharing options...
ryew Posted June 15, 2023 Share Posted June 15, 2023 I suspect this might be a task better suited for python versus VEX, and likely both easier and quicker that way- you might want to drop this question in the "Scripting" subforum here for better visibility from the coding gurus Quote Link to comment Share on other sites More sharing options...
Fenolis Posted June 27, 2023 Share Posted June 27, 2023 Create a Python SOP, paste the following code: nodeParm = hou.pwd().evalParm("spare_input0") node = hou.node(nodeParm) geo = hou.pwd().geometry() nodeInputs = node.inputs() geo.addAttrib(hou.attribType.Global, "inputs", [""]) inputs = [] for i in range(len(nodeInputs)): inputs.append(nodeInputs[i].type().name()) geo.setGlobalAttribValue("inputs", inputs) Add a Spare Input on the Python SOP and drag the node you want to query into the field. The Python SOP will generate a Detail attribute with a list of node types that are connected to the specified SOP. 2 Quote Link to comment Share on other sites More sharing options...
GlennimusPrime Posted July 2, 2023 Author Share Posted July 2, 2023 Thanks for the tips @Fenolis. Getting a little closer, but not quite what I was after. This method does show me some relevant info, but not an array list of node names. I'll leave this for now, as I was initially looking for a quick solution to something. I can see now it's a bit more complex than I initially thought. I can get by on this particular job by entering the node names manually. Quote Link to comment Share on other sites More sharing options...
Fenolis Posted July 4, 2023 Share Posted July 4, 2023 @GlennimusPrime The line you would want to modify is inputs.append(nodeInputs[i].type().name()) It pulls the type of the nodes, meaning the OTL definition. If you wanted the names as you see them in the Network Panel, modify it to: inputs.append(nodeInputs[i].name()) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.