Hi, i made a Python Script to read vertex color information from .obj files:
input sample: “v -38.000000 0.000000 -32.000000 0.549020 0.384314 0.266667”
#hashtag added on purpose
node = hou.pwd()
geo = node.geometry()
#Cd = geo.addAttrib(hou.attribType.Point, “Cd”, (0.0, 0.0, 0.0))
input_file = open('C
Users/Linder/Desktop/World out/to2.obj')
for i, line in enumerate(input_file):
new_point = hou.Geometry.createPoint(geo)
pos = line.split()
hou.Point.setPosition(new_point, map(float, pos))
# geo.points()
.setAttribValue(“Cd”, map(float, pos))
input_file.close()
This script import creates 90,000 points in about 0.05 s, but when I delete the hashtag from setAttribValue() to assign the color, it takes forever.
Any solutions?
It is possible to create the point and the color at the same time?
Thanks in advance.