Jump to content

Python: Continuous cooking / realtime mode


Jason

Recommended Posts

Hi all,

I'm playing about with some python which I'd like to cook within the event loop of Houdini. I'd like to cause certain SOPs to cook all the time, as I'm trying to do some kind of realtime stuff.

Has anyone done this before? Should I try to dirty a SOP so that it'll cook? Should I force-cook a SOP? Does anyone have any ideas or experience doing that from within the event loop?

Thanks.

Jason

Link to comment
Share on other sites

Wooo. Interesting.

I see...

hou.ui.addEventLoopCallback()

hou.ui.triggerUpdate()

hou.Node.cook(...)

So....

Doing this

def rtCook():
    hou.node("/obj/geo1/add1").cook(True)

hou.ui.addEventLoopCallback(rtCook)

Is making my Add SOP cook like a busy little bee.

I require sleep but hopefully this inspires various evilness.

Link to comment
Share on other sites

  • 2 weeks later...

Neat!

Two questions...

What do you use to navigate the HOM to search for functions like the three you mention? You say "I see...", but what did you do to see those?

Do you see anything that will limit the recooking to only happen when something changes (like an object is moved, or a viewport is tumbled.

Thanks!

-caleb

[edit: "Peon" - nice!]

Wooo. Interesting.

I see...

hou.ui.addEventLoopCallback()

hou.ui.triggerUpdate()

hou.Node.cook(...)

So....

Doing this

def rtCook():
    hou.node("/obj/geo1/add1").cook(True)

hou.ui.addEventLoopCallback(rtCook)

Is making my Add SOP cook like a busy little bee.

I require sleep but hopefully this inspires various evilness.

Edited by caleb
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...