Last active
July 18, 2017 11:04
-
-
Save takavfx/c14a1072a61f2a8f60978e085347f5fb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node = hou.pwd() | |
geo = node.geometry() | |
import random | |
inputs = node.inputs() | |
resultgeo = hou.Geometry(geo) | |
gcutter = hou.Geometry() | |
sops = hou.sopNodeTypeCategory() | |
boolean = sops.nodeVerb('boolean::2.0') | |
boolean.setParms({'booleanop':3}) | |
transform = sops.nodeVerb('xform') | |
for i in range(6): | |
transform.setParms({'t':(random.random() * 0.2, random.random() * 0.2, random.random() * 0.2), 'r':(random.random() * 120, random.random() * 324, random.random() * 360)}) | |
transform.execute(gcutter, [inputs[1].geometry()]) | |
boolean.execute(resultgeo, [resultgeo, gcutter]) | |
node.geometry().clear() | |
node.geometry().merge(resultgeo) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment