GlennimusPrime Posted October 1, 2021 Share Posted October 1, 2021 (edited) 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). 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 October 7, 2021 by GlennimusPrime Quote Link to comment Share on other sites More sharing options...
Fenolis Posted October 1, 2021 Share Posted October 1, 2021 "Display particles as Discs" is like copying a Primitive Circle/Sphere to Points. The Copy to Point SOP will assign pscale to primitive objects as well and should suit your visualization needs. Quote Link to comment Share on other sites More sharing options...
GlennimusPrime Posted October 7, 2021 Author Share Posted October 7, 2021 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. Quote Link to comment Share on other sites More sharing options...
jkunz07 Posted October 7, 2021 Share Posted October 7, 2021 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) 1 Quote Link to comment Share on other sites More sharing options...
GlennimusPrime Posted October 7, 2021 Author Share Posted October 7, 2021 Incredible! Thank you so much @jkunz07 This has really made my day! I really do spend a lot of time jumping in and out of the preferences window all day long. Quote Link to comment Share on other sites More sharing options...
Rence Posted October 7, 2021 Share Posted October 7, 2021 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) Quote Link to comment Share on other sites More sharing options...
jkunz07 Posted October 7, 2021 Share Posted October 7, 2021 Houdini has some support for this kind of functionality via hscript https://www.sidefx.com/docs/houdini/commands/commandecho.html but in my experience it isn't too helpful as very little feedback of ui is actually echoed Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.