Jump to content

evaluating python script every frame


Johannes Saam

Recommended Posts

Hey dudes,

I know its sounds simple but i am not really sure how to attack a python problem i have efficently.

I have camera information stored in one single file for a sequence. Now i wanna create a custom camera hda that reads that file. I tried different ideas so far without enough success. For example using an expression to setWorldTransform of a camera node inside my hda. Worked great but as soon as i make that otl live, changing its content created a permission error. I tried a python script in the hda onUpdate... but change of time does not seam to trigger it. I know i could wirte functions in the hdaModule() but how would that update it?

So the basic question is, i have ONE file for a sequence inside there is a world space matrix and some other parameters, i have a python API to read the file and get the values out. How do i go about creating an otl that is fast and updates every frame.

Thanks!

jo

Link to comment
Share on other sites

To make a node time dependent if it isn't already you just need to have a call to hou.frame() in your cook code. Since you are most likely already doing this in order to index into your sequence you shouldn't have to worry.

Link to comment
Share on other sites

  • 5 weeks later...

I know it has been a month since the last reply, but would it be an option to load the file in to memory? Like hou.session, or a sub-routine that reads in the data from the file and builds a animation curve?

Whats the point of reading data from it on every frame? Unless the file is adjusted by another process...

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