Created
July 18, 2012 22:49
-
-
Save crydalch/3139492 to your computer and use it in GitHub Desktop.
Houdini hou.perfMon Example
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
# This is an example script which will load the given hip file and record the performance of two areas (voronoi fracturing, and the bullet sim). | |
# Run with 'hython 50k_shatter.py' | |
import hou, sys | |
# Load the hip file | |
hou.hipFile.load("massive_bldg.hip") | |
# Setup (create and start) fracture-only profile & event | |
profile = hou.perfMon.startProfile("Fracture25Pieces") | |
evnm = "Fracture25" | |
event = hou.perfMon.startEvent(evnm) | |
# Set the voronoi fracture to create 50,000 pieces. | |
# dont' forget to force cook | |
hou.parm('/obj/building/chunkcenters/npts').set(50000) | |
vnode = hou.node('/obj/building/voronoifracture1') | |
vnode.cook() | |
# Stop everything, and save out the files. | |
event.stop() | |
profile.stop() | |
profile.save("voronoiChop.hperf") | |
profile.exportAsCSV("voronoiChop.csv") | |
print "Finished fractur, ready to sim..." | |
# Setup sim-only profile | |
profile = hou.perfMon.startProfile("Sim25Pieces") | |
evnm = "Sim25" | |
event = hou.perfMon.startEvent(evnm) | |
# Begin sim by rendering output driver | |
hou.node('/obj/building/perf_render').render() | |
event.stop() | |
profile.stop() | |
profile.save("sim.hperf") | |
profile.exportAsCSV("sim.csv") | |
sys.exit(0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment