Jump to content

Reload Geometry


jmquintela

Recommended Posts

Hi, 

I try to run a python script on the Post render script on a File Cache node to make shure the node data gets updated when passing to the text node( I'm having this problem when doing a chain of fetchs in a rop ) ..

I add this on the script box  ... execfile("$JOB/scripts/reload.py") ...   and  check Python lenguaje , and the script has this  :

import hou
 
hou.parm("reload").pressButton()

iis not working, what I'm doing wrong?

Edited by jmquintela
Link to comment
Share on other sites

I had a similar issue recently and this was how I got it working.  It probably is way more than needed, but it works like a charm.

You have to put the below on a default python module on the node you want to work with.  Then load the reload.py as another python module.  This code links the two. 

import importlib.util
spec = importlib.util.spec_from_file_location("foo", "path/to/your/script.py")
GE = importlib.util.module_from_spec(spec)
spec.loader.exec_module(GE)

def callback():
    GE.foo()

Then the callback is 
hou.phm().callback()

in your case, you would use hou.node('path/to/your/node').phm().callback()

Link to comment
Share on other sites

  • 2 weeks later...

Apparently I didn't test it enough, I just set a few node and a simple rop... but when I try a fetch chain with batch between them it didn't work.... also How can I print something to console form the reload.py file so I can debug if the script is running properly..?? 

I attach all files in a zip ..  remember too the reset the $JOB path..

reloadtest.zip

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...