Handling Time Dependencies in Python Script Nodes

   Views 415   Replies 3   Subscribers 0
User Avatar
Member
8 posts
Joined: July 2019
Offline
Hello,

I'm in the process of developing an HDA for our in-house AOVs, and I'm handling everything through the Sdf API. The issue I'm facing is that it generates all renderProduct productName time samples at once, which creates time dependencies. This causes Houdini to cook the node for each frame, even when it's not necessary.

I could modify my code to generate these value clips only for the current frame instead of the entire render range, but that seems less efficient. Is there a way to inform Houdini that this Python script node, despite creating time dependencies, is not actually time-dependent?

Thank you for your help!
User Avatar
Member
225 posts
Joined: Jan. 2015
Offline
I encountered this myself. I ended up reading the framerange metadata and created frame samples from that range. Only way I found that did not create time dependency.
Edited by Heileif - April 19, 2025 06:59:29
User Avatar
Member
9130 posts
Joined: July 2007
Offline
Creating timesamples shouldn't make your node time dependent, in fact I believe this is a preferred way and many nodes author timesamples for the whole range without introducing Houdini timedependency

What can make the node time dependent is if it depends on the actual houdini scene time, or any of the nodes/data it samples from the scene is time dependent

But I'd assume creating timesamples from scratch or based on incoming stage timesamples should not create node time dependency
Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
8 posts
Joined: July 2019
Offline
Thank you for your help! I am now certain that the time dependencies were not caused by setting the time sample. After reviewing my code a few days later with a fresh perspective, I realized the issue was due to calling the eval() function on some parameters. It all makes sense now. I suspect Heileif might have encountered the same issue and was fixed when reading range from metadata.
  • Quick Links