Custom shelf script won't prompt after the first run.

   1300   0   1
User Avatar
Member
29 posts
Joined: Feb. 2015
Offline
Trying to make a shelf button like the other dynamic ones and running into an issue.

import toolutils
import doptoolutils
import doprbdtoolutils

sceneviewer = toolutils.activePane(kwargs)
prompt = “Select Packed RBD object to rivet. Press Enter to Continue.”
seldata = sceneviewer.selectDynamics(prompt = prompt,
allow_objects = True,
allow_modifiers = False,
allow_multisel = False)

if len(seldata) == 1:
rivet_obj = doptoolutils.getDopDataCreator(seldata)

prompt = “Select RBD objects to rivet to. Press Enter to Continue.”
selobjects = sceneviewer.selectDynamics(prompt = prompt,
allow_objects = True,
allow_modifiers = False,
allow_multisel = True)

if len(selobjects) == 1:
rivet_target = doptoolutils.getDopDataCreator(seldata)

rivet_obj.setCurrent(True, True)
sceneviewer.enterCurrentNodeState()

The following code only asks on the first “selectDynamics” after that it just skips past asking every time I call it. It remembers what I had selected unless I restart Houdini. This is the case even if I set the “seldata” variable to None at the end of the script. No matter what I do, I can't get it to enter the selection mode again.
  • Quick Links