Last active
March 4, 2020 11:45
-
-
Save loonghao/54704c86a187b979caa295b05b3dc119 to your computer and use it in GitHub Desktop.
Export houdini point attribute
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
import hou | |
import json | |
from pprint import pprint | |
node = hou.selectedNodes()[0] | |
for frame in range(810, 1510): | |
geo = node.geometryAtFrame(frame) | |
filename = r"c:\cgfx_rnd\point_data\{}.{}.json".format(node.name(), frame) | |
print filename | |
with open(filename, "w") as json_object: | |
data = {} | |
for point in geo.iterPoints(): | |
data[point.number()] = { | |
attrib.name(): point.attribValue(attrib) | |
for attrib in geo.pointAttribs() | |
} | |
json.dump(data, json_object, indent=4) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment