Jump to content
urlGrey

Stuck on cooking and HOM fundamental (Python)

Recommended Posts

 

Hey all,

Sorry to add another Python cooking question (I've seen a lot, searching), but here goes.  

I have two subnets, a 'source' (from an .fbx) and a 'target'.  The Objects in each correlate by name, and those in the source subnet are keyframe-animated.  I'm driving the target Objects via:

sourceMg = sourceNode.worldTransform()

# beep boop, additional calculations go here

targetNode.setWorldTransform(sourceMg)

It works great, but once Houdini caches the frame the script is no longer (apparently) cooked, which makes sense--I pasted my code into a Python Script Object for convenient testing, which I suppose is not its intended use.  If the HOM documentation is telling me what to do instead, however, I don't see it.  There's the 'Python object' page, but I don't know that this is quite the same.

In short: my script works as intended, but after the scene plays through once, Python stops moving the target nodes (I'm guessing because Houdini quits cooking it, since it's not doing anything Houdini expects it to do, like make geometry).  Where does a script like this belong?  I'm sure there's something embarrassingly obvious I'm missing--it's just a little extra confusing to me because I have to manipulate everything on the Object level.

Thanks in advance for the help!  If anything's unclear, lemme know :)

Share this post


Link to post
Share on other sites

Make sure to turn off "Cache Object Transform" on your targetNode. This should help. If not, use an old good trick with a hidden parameter with expression in it, which will trigger your node to cook. 

  • Like 2
  • Thanks 2

Share this post


Link to post
Share on other sites

 

Thank you SO much, Stalker!  It was the Cache Object Transform on the Python Object.  (!)

Whew, I'm glad I asked; I don't know how long it would've been before I thought to turn it off, there xD  Thanks again!

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

×