Jump to content

Execute render with python


Rikrok

Recommended Posts

I'm trying to write out multiple variations of the same object as fbx's (I have to use fbx), the object is set to change every frame. Unfortunately when you set a frame range on the the Filmbox FBX ROP you don't get multiple fbx's, you just get one with a point cache.

I put a script on the object to change the start and end frame of the ROP to the current frame (which works), followed by
hou.parm('/out/filmboxfbx1/execute').pressButton()
Which when pressing play writes out a bunch of fbx's but unfortunately they're all empty; the script gives an infinite recursion in evaluation error.

I then tried making a tool that runs a script
for n in range (1, 101):
       hou.setFrame(n)

       hou.parm('/out/filmboxfbx1/execute').pressButton()

This only writes out 1 frame. I even tried using threading and sleep incase it was because it was executing the render button too quickly, no dice.

Does anyone know how I can achieve this?

Link to comment
Share on other sites

The issue is with the Filmbox ROP - if you tell it to write more than one frame it will under no circumstances write out multiple fbx's; it assumes you want one fbx with a cache. Therefore I need to set it to write one frame, render, change the frame, render, etc.

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