Jump to content

Hrender from different path [solved]


vtrvtr

Recommended Posts

Hello

I'm trying to make a little script that would check which frame was the last one rendered and then would continue the rendering process if necessary. It's a Windows machine

The easiest way I could think of doing it was simply using the subprocess module to call the hrender script with the proper arguments, but I having some trouble

The relevant code is 

 

def main():
    last_known_frame = get_last_frame(RENDER_DIR)
    if last_known_frame is not None:
        hrender_command = "hrender -e -f {} {} -d {} {}.hip".format(last_known_frame, END_FRAME, OUTPUT_DRIVER, PROJECT_NAME)
        os.chdir("V:\Programs\Side Effects Software\Houdini 15.5.607\\bin")
        subprocess.call([hrender_command], shell=True)

However, I get a "hrender -e -f... is not a recognized as an internet command..." 

I tried using subprocess.call(["hrender", hrender_command], shell=True), with the proper path to the HIP file, but then it calls it like they were two different arguments, which isn't the case

So three questions

  • Is what I'm doing possible? What am I doing wrong?
  • Is there a better way? 

Regarding the second question, I superficially searched how to use HOM on a generic script but apparently you need to assign PATH variables and such on Windows, it looks like a mess I would prefer to avoid if possible

 

Thank you

Edited by vtrvtr
Solved
Link to comment
Share on other sites

  • 2 weeks later...

In case someone wonders this in the future

You can use hython.exe in the /bin/ folder as the interpreter. In my case I was using Sublime so I created a build to the interpreter and that's all you need to do. hou will be available. 

Then you can execute the script with hython with a .bat file or whatever

 

  • Like 1
Link to comment
Share on other sites

  • 2 months later...

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...