no effect when using 456.py

   2068   3   2
User Avatar
Member
2 posts
Joined: Aug. 2017
Offline
hello,

I am trying to run some commands when opening a scne in houdini, and thought of using 456.py for this.

however whatever the command I write there, nothing happens, even when I try to print a couple of words :

print('scene loaded')

I have the same behavior in Houdini Core and Houdini FX.

I also use 123.py and houdinicore.py for other commands, and both are loading and behaving correctly. They are all located in $HSITE/houdini18.5/scripts and pythonrc.py (also working) is located in $HSITE/houdini18.5/python2.7libs

my only issue is with 456.py, also located in $HSITE/houdini18.5/scripts

any ideas ?
User Avatar
Member
8045 posts
Joined: Sept. 2011
Offline
monarchtv
hello,

I am trying to run some commands when opening a scne in houdini, and thought of using 456.py for this.

however whatever the command I write there, nothing happens, even when I try to print a couple of words :

print('scene loaded')

I have the same behavior in Houdini Core and Houdini FX.

I also use 123.py and houdinicore.py for other commands, and both are loading and behaving correctly. They are all located in $HSITE/houdini18.5/scripts and pythonrc.py (also working) is located in $HSITE/houdini18.5/python2.7libs

my only issue is with 456.py, also located in $HSITE/houdini18.5/scripts

any ideas ?

Is there another 456.py in the path somewhere? I think Houdini only sources one of them.
User Avatar
Member
37 posts
Joined: Sept. 2014
Offline
Also check you $HOUDINI_PATH, if there is a folder in there that adding
/scripts/456.py
to it will use the first instance there as well.
User Avatar
Member
2 posts
Joined: Aug. 2017
Offline
that was the issue. after some digging I saw that a couple of plugins we use have their own 456.py. Our own file gets ignored as soon as one of these is enabled.
is there a way to load several 456.py?
I started looking at scene file events to execute scripts when houdini opens/loads a scene but I did not get how/where to set eventcallback like the one example in the doc :

def scene_event_callback(event_type):
    hou.ui.displayMessage("An event of type {} occured".format(event_type))

hou.hipFile.addEventCallback(scene_event_callback)

should I add it the the python2.7libs/pythonrc.py file to be executed by houdini for every scene event?
Edited by monarchtv - Oct. 16, 2021 06:52:22
  • Quick Links