コード例 #1
0
 def run(self):
     import toolutils
     import soptoolutils
     activepane = toolutils.activePane(kwargs)
     if activepane.type() == hou.paneTabType.SceneViewer:
         # Get the current context.
         sceneviewer = toolutils.sceneViewer()
         # Create a SOP container.
         container = soptoolutils.createSopNodeContainer(
             sceneviewer, "curve_object1")
         # Create the curve.
         newnode = soptoolutils.createSopNodeGenerator(
             container, "curve", None)
         # Turn on the highlight flag so we see the SOPs selected output.
         newnode.setHighlightFlag(True)
         if sceneviewer.isCreateInContext():
             newnode.setCurrent(True, True)
             sceneviewer.enterCurrentNodeState()
             toolutils.homeToSelectionNetworkEditorsFor(newnode)
         else:
             container.setCurrent(True, True)
             toolutils.homeToSelectionNetworkEditorsFor(container)
             activepane.setPwd(container.parent())
             activepane.setCurrentState("objcurve")
     elif activepane.type() == hou.paneTabType.NetworkEditor:
         soptoolutils.genericTool(kwargs, "curve")
     else:
         raise hou.Error("Can't run the tool in the selected pane.")
コード例 #2
0
    def run(self):
        import toolutils
        import soptoolutils

        kwargs['bbox'] = hou.BoundingBox(-1.0, -1., -.0, 1.0, 1., .0)
        sphere = soptoolutils.genericTool(kwargs, 'circle')
        sphere.parm("type").set("poly")
コード例 #3
0
    def run(self):
        import toolutils
        import soptoolutils

        size = 4.0
        kwargs['bbox'] = hou.BoundingBox(-size / 2.0, 0, -size / 2.0, size / 2.0, 0, size / 2.0)
        grid = soptoolutils.genericTool(kwargs, 'grid')
        grid.parm("sizex").set(size)
        grid.parm("sizey").set(size)
コード例 #4
0
 def run(self):
     import toolutils
     import soptoolutils
     rad = 0.5
     kwargs['bbox'] = hou.BoundingBox(-rad, -rad, -rad, rad, rad, rad)
     sphere = soptoolutils.genericTool(kwargs, 'sphere')
     sphere.parm("type").set("polymesh")
     sphere.parm("radx").set(rad)
     sphere.parm("rady").set(rad)
     sphere.parm("radz").set(rad)
コード例 #5
0
    def run(self):
        import toolutils
        import soptoolutils

        kwargs['bbox'] = hou.BoundingBox(-0.5, -0.5, -0.5, 0.5, 0.5, 0.5)
        sphere = soptoolutils.genericTool(kwargs, 'box')
        sphere.parm("type").set("polymesh")
        sphere.parm("divrate1").set(2)
        sphere.parm("divrate2").set(2)
        sphere.parm("divrate3").set(2)
コード例 #6
0
 def run(self):
     import toolutils
     import soptoolutils
     orad = 0.5
     irad = 0.25
     kwargs['bbox'] = hou.BoundingBox(-orad - irad, -irad, -orad - irad,
                                      orad + irad, irad, orad + irad)
     torus = soptoolutils.genericTool(kwargs, 'torus')
     torus.parm("type").set("poly")
     torus.parm("radx").set(orad)
     torus.parm("rady").set(irad)
コード例 #7
0
 def run(self):
     import toolutils
     import soptoolutils
     rad = 0.5
     height = 1.0
     kwargs['bbox'] = hou.BoundingBox(-rad, -height / 2., -rad, rad,
                                      height / 2., rad)
     tube = soptoolutils.genericTool(kwargs, 'tube')
     tube.parm("type").set("poly")
     tube.parm("radscale").set(rad)
     tube.parm("height").set(height)
コード例 #8
0
ファイル: eg_merge.py プロジェクト: evgeni17/egLib
def run(kwargs):
    selNodes = hou.selectedNodes()

    for node in selNodes:
        if not hou.NodeType.category(node.type()) == hou.sopNodeTypeCategory():
            hou.ui.displayMessage("Please select SOP-Level Nodes")
            return

    mrg = soptoolutils.genericTool(kwargs, 'merge')

    for x, node in enumerate(selNodes):
        mrg.setNextInput(node)

    mrg.setDisplayFlag(True)
    mrg.setRenderFlag(True)
コード例 #9
0
def run(kwargs):

    #Get Selected Node
    selNodes = hou.selectedNodes()

    #Create Node
    mrg = soptoolutils.genericTool(kwargs, 'polyextrude::2.0')

    #Set Parms
    curNode = kwargs["pane"].currentNode()
    curNode.parm('xformfront').set("1")
    curNode.parm('xformspace').set("global")

    #Set Display Flag
    mrg.setDisplayFlag(True)
    mrg.setRenderFlag(True)
コード例 #10
0
    def run(self):
        import soptoolutils

        soptoolutils.genericTool(kwargs, 'polyfill')
コード例 #11
0
# groupname.py
# Input code for group node in Houdini to auto name group
# based on node name

#########################################################
# Import relevant libs

import toolutils
import soptoolutils

# Set var to identify group node creation
grp = soptoolutils.genericTool(kwargs, 'groupcreate')

# Set parm to auto name the group based on the node name
grp.parm("groupname").set("`opname('.')`")
コード例 #12
0
import soptoolutils

selection = None
if type(kwargs['pane']) is hou.SceneViewer:
    viewer = kwargs['pane']
    selection = viewer.selectGeometry(geometry_types=(hou.geometryType.Primitives, hou.geometryType.Edges,))


n = soptoolutils.genericTool(kwargs, '$HDA_NAME')

if selection is not None:
    selstring = ''
    for sel in selection.selectionStrings():
        selstring += sel
        selstring += ' '
    
    if len(selstring) != 0:
        geotype = selection.geometryType()
        if geotype == hou.geometryType.Edges:
            n.setParms({'group':selstring, 'grouptype':'edges'})
        if geotype == hou.geometryType.Primitives:
            n.setParms({'group':selstring, 'grouptype':'prims'})
コード例 #13
0
import soptoolutils

# Store nodes that are selected
selNodes = hou.selectedNodes()

# Creates the merge node
mrg = soptoolutils.genericTool(kwargs, 'merge')

# Use a for loop and store each node in an iterable format using enumerate
for x, node in enumerate(selNodes):
    # Test the printing of selected nodes
    # node.name()
    # print node.name()

    # Attached a wire from each selected node to the new merge node
    # stored in the mrg variable
    mrg.setNextInput(node)

# Sets the display and render flags for merge
mrg.setDisplayFlag(True)
mrg.setRenderFlag(True)