[Python] Getting the input node of a digital asset. It doesn't update.

   3853   1   1
User Avatar
Member
900 posts
Joined: Feb. 2016
Offline
I'm working inside the python module of a digital asset.
I need to retrieve the upstream node connected to the input of the digital asset.

The code I'm using is the following:

def getinput():
  hdaNode = hou.pwd()
  inputNode = hdaNode.inputs()

This code is invoked by a button parm with callbackscript hou.phm().getinput()

The problem with this code is that it registers the particular input nodeA that is connected to digital asset at the moment of the saving of the digital asset.

When I connect another nodeB, it would return always nodeA, unless I save the properties of the digital asset when nodeB is connected.

Any idea how to update it?
Edited by Andr - Jan. 22, 2019 19:07:16
User Avatar
Member
900 posts
Joined: Feb. 2016
Offline
opsss…. I've found the solution.

inputNode = hdaNode.inputs() was originally outside getinput(), and indeed it would not update.
  • Quick Links