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
as its callback script.
This function is defined in a PythonModule in the Scripts tab of the Asset properties as
and refers to a python node with the following code:
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:
which we call in a similar way using a button.
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!