In our digital asset which we export to UE4, I wanted to add a button that runs some python code.
After discovering that it doesn't work, I tried to move a box using Python for testing, but couldn't get it to work.
I tried the following:
The button has
hou.phm().MovePython()
This function is defined in a PythonModule in the Scripts tab of the Asset properties as
def MovePython(): print "Move called" exec(hou.node('/obj/geo1/python1').parm('python').eval()) MoveBox()
def MoveBox(): objPath = "/obj/geo1/box1/tx" parm = hou.parm(objPath) origVal = parm.eval() parm.set(origVal + 0.1)
I also tried a more direct approach by defining the following function in the same PythonModule:
def MoveGraph(): print "MoveGraph called" objPath = "/obj/geo1/box1/tx" parm = hou.parm(objPath) origVal = parm.eval() parm.set(origVal + 0.1)
When pressing either of the buttons in the Houdini Editor, the box moves as expected, however, when doing the same in the Unreal Editor, the box does not move.
Is there a solution to this problem, or is this a limitation of the way Houdini interacts with Unreal Engine?
Thanks in advance!