Jump to content
Drughi

Resimulate script

Recommended Posts

Hi!

I want to share a little shelf tool script wich is pressing the Reset Simulation Button for you while beeing in a Dopnet or Solver. I found it to be very useful. 

Hope it is helpful to someone. If you have suggestions on doing it in a cleaner, better way - let me know. I'm still learning Python. :) 

Cheers!

#Resim by Johannes Heintz
import os
path =  hou.ui.paneTabOfType(hou.paneTabType.NetworkEditor,0).pwd().path()
test = 0

while test < 10:
    test += 1
    node = hou.node(path)
    if node.parm("resimulate"):
        test = 10
        button = path + "/resimulate"
        hou.parm(button).pressButton()
        print "WORKED"
    else:
        path = os.path.dirname(path)

 

Edited by Drughi
  • Thanks 1

Share this post


Link to post
Share on other sites

here's another way ;)

hou.currentDopNet().parm('resimulate').pressButton()

 

Edited by 3dome
  • Like 1

Share this post


Link to post
Share on other sites

Ah cool! Thanks. Didn't know this function. Good to know, but good for dops only.

Share this post


Link to post
Share on other sites
3 hours ago, Drughi said:

Ah cool! Thanks. Didn't know this function. Good to know, but good for dops only.

which is interesting since a solver is a dopnet + bottom right it is selected as the current one. maybe a bug? RFE it?

Share this post


Link to post
Share on other sites

you can also press P in the scene view and it will bring up a parameter window displaying the top level parameters of the dopnet. Then just press reset simulation

  • Like 1

Share this post


Link to post
Share on other sites
11 hours ago, Jesper Rahlff said:

you can also press P in the scene view and it will bring up a parameter window displaying the top level parameters of the dopnet. Then just press reset simulation

Nice! But it seems this also doesn't work with sop solvers.

Share this post


Link to post
Share on other sites
On 11/30/2018 at 1:29 AM, Drughi said:

Nice! But it seems this also doesn't work with sop solvers.

yeah unfortunately it does not work with sop solvers, which one can wonder about..

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

×