Алексей Ванжула

vux

About Me

Expertise
Developer
Location
Not Specified

Connect

Recent Forum Posts

Python/Hscript Select Visible Geometry only April 17, 2019, 6:08 p.m.

ant_5555
Thanks for the input.

Unfortunatelly, I got that far and that is setting the toggle on only.

What I am after is a script to do the actual selection of the visible faces only.

This may not be entirely possible in Houdini yet, but it would be nice.

Shelf script:
scene_viewer = hou.ui.paneTabOfType(hou.paneTabType.SceneViewer)
pwd = scene_viewer.pwd()
if pwd.childTypeCategory() == hou.sopNodeTypeCategory():
    sop = pwd.displayNode()
    if sop is not None:
        sop = sop.createOutputNode('groupexpression')
        view_normal = hou.Vector3(0, 0, 1) * scene_viewer.curViewport().viewTransform().transposed().inverted()
        sop.parm('groupname1').set('viewprims')
        sop.parm('snippet1').set('dot(prim_normal(0, @elemnum, 0.5, 0.5), {%f, %f, %f}) > 0' % (view_normal[0], view_normal[1], view_normal[2]))
        sop.setCurrent(True, True)
        sop.setDisplayFlag(True)
        sop.setRenderFlag(True)
        sop.setHighlightFlag(True)
        scene_viewer.enterCurrentNodeState()

Python/Hscript Select Visible Geometry only April 17, 2019, 8:36 a.m.

scene_viewer = hou.ui.paneTabOfType(hou.paneTabType.SceneViewer)
scene_viewer.setPickingVisibleGeometry(True)

Booleans with smooth edges April 3, 2019, 4:23 p.m.

Sirvoxelot
cool thanks! looks pretty good!
does it work with steam indie 17.5?
yes