Jump to content

Shelf Tool from OTL Scripted Button


abvfx

Recommended Posts

Hey guys, 

So the curvegroom sop has a "scripted select" button for selecting primitives to groom.

This is not to be mistaken with the standard reselect command with `. It it a different animal upon inspection of the asset.

select (1).jpg

Because of this, i am unable to define a hotkey for it with the standard hotkey manager. But if i were to make the function a shelf tool then i could set a custom hotkey for it.

However my python skills are somewhat lacking and was wondering if anyone knew of the how to create this seemingly simple button.  

Any help would be greatly appreciated. 

 

Edited by abvfx
Link to comment
Share on other sites

import toolutils
import furtoolutils

node = hou.selectedNodes()[0]

sv = toolutils.sceneViewer()
selection = sv.selectGeometry("Select Curves To Groom", 0, True, False, False)

kwargs['node'] = node
furtoolutils.startGrooming(kwargs, tool="groomsurface")

if(len(selection.selectionStrings())) :
    node.parm("group").set(selection.selectionStrings()[0])
    
node.parm('stroke_changedsel').set(True)

 

 

This should handle it. 

 

Edited by MrScienceOfficer
Won't throw error on empty selection anymore
Link to comment
Share on other sites

Tom. Thank you. 

 

It works perfectly. I have bound this function to a key and it now works flawlessly.  I changed "groomsurface" to "groomscreen" as that is what i use most often.  

 

Thank you so much. 

 

 

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