Welcome to od|forum

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

Sign in to follow this  
Followers 0
vtrvtr

python Hrender from different path [solved]

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

Share this post


Link to post
Share on other sites

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

 

1 person likes this

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0