Welcome to od|forum

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

Sign in to follow this  
Followers 0
Noobini

Hide Points

so I butchered the Delete button and got the Hide functionality...dunno much about scripting...just pruned out whatever wasn't needed...so can't say the script is foolproof.
 

import toolutils
import soptoolutils

# find out curr context
active_pane = toolutils.activePane(kwargs)
if active_pane is not None and \
    active_pane.type() == hou.paneTabType.ContextViewer:
    active_pane = active_pane.sceneViewer()

if active_pane is None or active_pane.type() != hou.paneTabType.SceneViewer:
    raise hou.Error("The tool was not invoked in the scene viewer.")

# we determine what selection type we should consider (ie, OBJ, SOP,
#  DOP, POP) based on the viewer network path and the child type
scene_viewer = active_pane
child_type   = scene_viewer.pwd().childTypeCategory()

if child_type == hou.sopNodeTypeCategory():
    # geometry context: hide the component (points, edges, primitives)
    prompt = toolutils.selectionPrompt(hou.sopNodeTypeCategory())
    # we cannot consume the selection here as the tool we launch will
    # need to use it, i.e., we act as a preliminary select state here.
    selection = scene_viewer.selectGeometry(prompt=prompt,
                                            consume_selections=False)
    type = selection.geometryType()
    if type == hou.geometryType.Primitives \
             or type == hou.geometryType.Points \
             or not selection.primitiveTypes():
        node = soptoolutils.genericTool(kwargs, 'attribexpression')
        node.parm('preset1').set(5)
        node.parm('snippet1').set('ch("vis")')

 

 

Edited by Noobini

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
Sign in to follow this  
Followers 0