Jump to content

Creating Custom Shelf Buttons [SOLVED]


Recommended Posts

I've been working with particles a lot recently and find myself continuously needing to open the 'display options' window to switch between displaying particles as points or discs (so I can visualise the pscale in viewport).

NrC2X8i.jpg
Would these two display options be something I could add to the shelf as two buttons? Display particles as points and display particles as discs?
I have no knowledge of how to create shelf buttons.

Edited by GlennimusPrime
Link to comment
Share on other sites

Hi thanks @Fenolis I was hoping for an easy shelf button so I can quickly switch between the two ideally. I don't want to have to do the whole copy to points thing whenever I want to switch back and forth between points and discs. I know it's a quick setup to do that, but not ideal when doing this many times a day across multiple projects.

Link to comment
Share on other sites

This code should work, you can make a new shelf tool by right clicking in any empty shelf space and then choose 'New Tool...'

 

You can paste this in the 'Script' tab:

if hou.ui.curDesktop().paneTabOfType(hou.paneTabType.SceneViewer).curViewport().settings().particleDisplayType() == hou.viewportParticleDisplay.Points:
    hou.ui.curDesktop().paneTabOfType(hou.paneTabType.SceneViewer).curViewport().settings().particleDisplayType(hou.viewportParticleDisplay.Discs)
else:
    hou.ui.curDesktop().paneTabOfType(hou.paneTabType.SceneViewer).curViewport().settings().particleDisplayType(hou.viewportParticleDisplay.Points)

 

  • Like 1
Link to comment
Share on other sites

Hey John,

Thanks for the code. I have a question, does Houdini echo your actions somewhere? I remember in Softimage, every action I did, the python would echo that action, so it was easy to create scripts as you could grab the code from there.

Does Houdini have that kind of functionality?

6 hours ago, jkunz07 said:

This code should work, you can make a new shelf tool by right clicking in any empty shelf space and then choose 'New Tool...'

 

You can paste this in the 'Script' tab:


if hou.ui.curDesktop().paneTabOfType(hou.paneTabType.SceneViewer).curViewport().settings().particleDisplayType() == hou.viewportParticleDisplay.Points:
    hou.ui.curDesktop().paneTabOfType(hou.paneTabType.SceneViewer).curViewport().settings().particleDisplayType(hou.viewportParticleDisplay.Discs)
else:
    hou.ui.curDesktop().paneTabOfType(hou.paneTabType.SceneViewer).curViewport().settings().particleDisplayType(hou.viewportParticleDisplay.Points)

 

 

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...