Teapot geometry tool
Create a polygonal Utah teapot.
Info
| Compatibility |
Houdini 11.0 |
| Change Log |
Added the Teapot shelf tool. |
#
# Produced by:
# Graham Thompson
# captainhammy@gmail.com
# www.captainhammy.com
#
# Name: sop_teapot.shelf
#
# Comments: Create a polygonal Utah teapot using the Platonic Solids SOP.
#
# Version: 1.0
#
# Compatibility: Houdini 11.0
#
import toolutils
import soptoolutils
# Create a hou.BoundingBox with the dimentions of the teapot geometry.
kwargs['bbox'] = hou.BoundingBox(-0.9959, -0.4579, -0.6105, 0.9681, 0.4579, 0.6105)
# Generate the Platonic Solids SOP and set it to Utah teapot.
platonic = soptoolutils.genericTool(kwargs, 'platonic')
platonic.parm("type").set(6)
# Convert the teapot to polygons.
convert = platonic.createOutputNode("convert")
# Fuse the points together.
fuse = convert.createOutputNode("fuse")
fuse.setDisplayFlag(True)
fuse.setRenderFlag(True)
# Collapse the nodes into a subnet and set the name to be teapot.
subnet = platonic.parent().collapseIntoSubnet((platonic, convert, fuse))
subnet.setName("teapot1", True)
subnet.layoutChildren()
# If the tool was invoked from a viewer we need to check to see if
# Create In Context is enabled. If it isn't then we created a new
# geometry object and should change the name.
activepane = toolutils.activePane(kwargs)
if isinstance(activepane, hou.SceneViewer) and not activepane.isCreateInContext():
subnet.parent().setName("teapot_object1", True)