Jump to content
jon3de

skip rendering frames based on parameter value

Recommended Posts

I have a switch with some inputs. Swtich input is linked to $F to loop through.

For all of the inputs I created a detail attribute "type" e.g. "sphere" / "torus" / "box". The null node reads the detail attribute and writes the value in its parameter.

 

I want to setup the rendering in a way that it will skip the render if the null node detects that I am rendering a "box". I thought of doing that with a pre frame script that checks the parameter of the null node if its == "box" and then skip the render. 

What would be the best way to  skip the render here? Is there a hscript or python expression for that? 

Jon

image.thumb.png.543cbea9a2d6b3e469ebea5fe39908ff.png

skipFramesByAttributeValue.hip

Share this post


Link to post
Share on other sites

Hi, try this in your pre-frame script

read_node = hou.node('/obj/skip_frames_based_on_attribute/read_Detail_attribute')

path  = read_node.path()

value = read_node.evalParm(path+"/obj_type")

switch = hou.node("/obj/skip_frames_based_on_attribute/switch1")

if "box" in value:
    offsetvalue = switch.evalParm("offset")
    offsetvalue +=1
    switch.setParms({"offset":"%d"%offsetvalue})
    

image.png.7ae8b4ab292c04f05d78ef56867e724c.png

 

Also i had to do some change for the switch sop.

image.png.3b5c45b83e2c3e7d2eb97382d14579b6.png

 

Cheers,

  • Thanks 1

Share this post


Link to post
Share on other sites

Hey Jeremiah, thank you for your post. 

If I got it correct, in your file the renderer does not skip or abort the rendering prozess for that frame it just renders the next object in the switch. And  then in the next Frame it renders that object again. Which is not what I want. 

Lets say I render this project for the first time. I have rendered frames 1 - 10 and I have  10 ifd files on disk .

Then I have to rerender the images because of some adjustments on the sphere and the torus. I want to be able to send the whole sequenz to the farm again but the script should prevent oversaving the ifds where it detects that there is the e.g. "box" attribute on it. 

This scene file is a small simplified part of an automated pipeline Im working on with thousands of images. Maybe my plan will sound a little bit strange :)

Share this post


Link to post
Share on other sites

maybe you could try a different approach, like creating an array with the frames you want to render and then use a few lines of python as discussed here

 

  • Thanks 1

Share this post


Link to post
Share on other sites

Hi Dominik, 

That sounds not to bad. I will dig into that. Since Im rendering with Deadline I could also create the array with a python script and paste that in the override Frames parameter in the deadline Submission Dialog. That could work. 

image.thumb.png.f35225163e8ec7a7c9208d37e867d016.png

Thank you!!

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

×