Can a Parameter Interface Callback in one Node call a function in a Python Node passing KWARGS?

   1262   2   1
User Avatar
Member
14 posts
Joined: Feb. 2019
Offline
Hi,

Hopefully the question makes sense.

I have a Parameter Interface in one Node and would like to set it's Callback script to invoke a function declared in a Python Node passing the KWARGS argument to the calling Node reference can be extracted. Have tried all sorts of variations.

At the moment I have always relied on using the Asset Interface,
having hou.phm().updateCalcs(kwargs)
as the Callback Script and then something along the lines of:

def fooFunc(kwargs):
    import hou
    node = kwargs['npde']

    # do something hopefully smart
    return

in the Asset Module which works just fine. Would like to move some of the code functionality though into Python Nodes to be ultimately included in my Asset.

Hopefully this all makes sense.

Many Thanks,

Shaun
User Avatar
Member
900 posts
Joined: Feb. 2016
Offline
Hello,
so you just want a library of functions stored in a python sop node to be called by your digital asset interface?
Don't know if that's the way to do it.


This doc might help you:
https://www.sidefx.com/docs/houdini/hom/locations.html [www.sidefx.com]
Edited by Andr - Sept. 27, 2019 03:05:29
User Avatar
Member
37 posts
Joined: Aug. 2015
Offline
Not sure why you want to use a python node. If you want to centralize python code for general use across multiple nodes you should really just write an external python module [www.sidefx.com]. Put it in your environment under scripts/python ie:

C:\Users\<YOU>\Documents\houdini17.5\scripts\python

Then you can simply import it wherever you want to use it and use kwargs to pass info about who/what called your function.
  • Quick Links