hou.Geometry class

All Methods Replaces

See also: hou.Point, hou.Prim

Methods

addAttrib(self, type, name, default_value, transform_as_normal=False) → Attrib

Not documented yet

addGlobalAttrib(self, name, size, default_value)

Not implemented yet

addPointAttrib(self, name, size, default_value)

Not implemented yet

addPrimAttrib(self, name, size, default_value)

Not implemented yet

addTransformableGlobalAttrib(self, name, size, default_value)

Not implemented yet

addTransformablePointAttrib(self, name, size, default_value)

Not implemented yet

addTransformablePrimAttrib(self, name, size, default_value)

Not implemented yet

addTransformableVertexAttrib(self, name, size, default_value)

Not implemented yet

addVertexAttrib(self, name, size, default_value)

Not implemented yet

attribType(self) → hou.attribType enum value

Not documented yet

attribValue(self, name) -> int, float, string, or tuple OR attribValue(self, attrib)int, float, str, or tuple

Not documented yet

averagePointAttribValue(self, attrib_name, index)

Not implemented yet

averagePointAttribValueByType(self, attrib_type, index)

Not implemented yet

averagePrimAttribValue(self, attrib_name, index)

Not implemented yet

averagePrimAttribValueByType(self, attrib_type, index)

Not implemented yet

averageVertexAttribValue(self, attrib_name, index)

Not implemented yet

averageVertexAttribValueByType(self, attrib_type, index)

Not implemented yet

boundingBox(self) → BoundingBox

Not documented yet

centroid(self) → Vector3

Not implemented yet

createBezierCurve(self) → BezierCurve

Not implemented yet

createBezierSurface(self) → BezierSurface

Not implemented yet

createMetaball(self) → Metaball

Not implemented yet

createNURBSCurve(self) → NURBSCurve

Not implemented yet

createNURBSSurface(self) → NURBSSurface

Not implemented yet

createPoint(self) → Point

Not documented yet

createPolygon(self) → Polygon

Not documented yet

createVolume(self) → Volume

Not implemented yet

deletePrims(self, prims, keep_points=False)

Delete a sequence of primitives. You would typically call this method from the code of a Python-defined SOP.

Raises hou.GeometryPermissionError if this geometry is not modifiable.

keep_points

if True, the primitive will be deleted but its points will remain.

To delete a single primitive, pass in a list with one primitive.

# Delete every other primitive:
prims = [p for p in geo.prims() if p.number() % 2 == 0]
geo.deletePrims(prims)

# Delete the first primitive:
geo.deletePrims([geo.prims()[0]])
findClosestPoint(self, pos3) → Point or None

Not implemented yet

findClosestPrim(self, pos3) → Prim or None

Not implemented yet

findGlobalAttrib(self, name) → Attrib or None

Not documented yet

findParticleById(self, particle_id) → Point or None

Not implemented yet

findPointAttrib(self, name) → Attrib or None

Not documented yet

findPointGroup(self, group_name) → PointGroup or None

Not implemented yet

findPointGroups(self, pattern) → tuple of PointGroups

Not implemented yet

findPrimAttrib(self, name) → Attrib or None

Not documented yet

findPrimGroup(self, group_name) → PrimGroup or None

Not implemented yet

findPrimGroups(self, pattern) → tuple of PrimGroups

Not implemented yet

findVertexAttrib(self, name) → Attrib or None

Not documented yet

floatAttribValue(self, name) -> float OR floatAttribValue(self, attrib) → float

Not documented yet

floatListAttribValue(self, name) -> tuple of floats OR floatListAttribValue(self, attrib) → tuple of floats

Not documented yet

freeze(self) → Geometry

Not documented yet

globalAttribs(self) → tuple of Attribs

Not documented yet

globPoints(self, patern) → tuple of hou.Point

Not implemented yet

intAttribValue(self, name) -> int OR intAttribValue(self, attrib) → int

Not documented yet

intListAttribValue(self, name) -> tuple of ints OR intListAttribValue(self, attrib) → tuple of ints

Not documented yet

iterPoints(self) → iter of hou.Point

Return a generator that iterates through all the points in the geometry.

Whereas hou.Geometry.points allocates and returns a tuple of all the points in the geometry, this method returns a generator object that will allocate hou.Point objects on demand.

If you're accessing a specific point by index and the geometry contains many points, it is faster to use iterPoints() than points(). If, however, you are iterating over all the points in the geometry, it is generally faster to use points() than iterPoints().

# This is preferred:
geo.iterPoints()[23]

# over this:
geo.points()[23]

# But this is preferred:
for point in geo.points():
    ...process point...

# over this:
for point in geo.iterPoints():
    ...process point...
iterPrims(self) → iter of hou.Prim

Return a generator that iterates through all the primitives in the geometry.

Whereas hou.Geometry.prims allocates and returns a tuple of all the primitives in the geometry, this method returns a generator object that will yield hou.Prim objects on demand.

If you're accessing a specific primitive by index and the geometry contains many primitives, it is faster to use iterPrims() than prims(). If, however, you are iterating over all the primitives in the geometry, it is generally faster to use prims() than iterPrims().

# This is preferred:
geo.iterPrims()[23]

# over this:
geo.prims()[23]

# But this is preferred:
for prim in geo.prims():
    ...process prim...

# over this:
for prim in geo.iterPrims():
    ...process prim...
metaballWeight(self, pos3)

Not implemented yet

pointAttribs(self) → tuple of Attribs

Not documented yet

pointFloatAttribValues(self, name) → tuple of float

Return a tuple of floats containing one attribute’s values for all the points.

This method only works on int or float attributes. If the attribute contains more than one element, each point will correspond to multiple values in the result. For example, if “Cd” is a float attribute of size 3 and there are 3 point with values (0.1, 0.2, 0.3), (0.5, 0.5, 0.5), and (0.8, 0.7, 0.6) then the result will be (0.1, 0.2, 0.3, 0.5, 0.5, 0.5, 0.8, 0.7, 0.6).

If the attribute name is invalid or the attribute is not an int or float (e.g. it’s a string attribute), this method raises hou.OperationFailed.

pointGroups(self) → tuple of PointGroups

Not implemented yet

points(self) → tuple of hou.Point

Returns a tuple of all the points in the geometry.

primAttribs(self) → tuple of Attribs

Not documented yet

primFloatAttribValues(self, name) → tuple of float

Return a tuple of floats containing one attribute’s values for all the primitives.

This method only works on int or float attributes. If the attribute contains more than one element, each primitive will correspond to multiple values in the result. For example, if “Cd” is a float attribute of size 3 and there are 3 primitives with values (0.1, 0.2, 0.3), (0.5, 0.5, 0.5), and (0.8, 0.7, 0.6) then the result will be (0.1, 0.2, 0.3, 0.5, 0.5, 0.5, 0.8, 0.7, 0.6).

If the attribute name is invalid or the attribute is not an int or float (e.g. it’s a string attribute), this method raises hou.OperationFailed.

primGroups(self) → tuple of PrimGroups

Not implemented yet

prims(self) → tuple of hou.Prim

Return a tuple of all the primitives in the geometry.

saveToFile(self, file_name)

Not documented yet

seamPoints(self, seam_half) → tuple of Points

Not implemented yet

setGlobalAttribValue(self, attrib_name, attrib_value) OR setGlobalAttribValue(self, attrib, attrib_value)

Not documented yet

sopNode(self) → SopNode

Not documented yet

stringAttribValue(self, name) -> string OR stringAttribValue(self, attrib) → string

Not documented yet

transform(self, matrix)

Not implemented yet

vertexAttribs(self) → tuple of Attribs

Not documented yet

Replaces

opsave command , bbox expression function , centroid expression function , detail expression function , detailattribsize expression function , details expression function , hasdetailattrib expression function , haspoint expression function , haspointattrib expression function , hasprim expression function , hasprimattrib expression function , hasvertexattrib expression function , metaweight expression function , nearpoint expression function , point expression function , pointavg expression function , pointgrouplist expression function , pointgroupmask expression function , pointlist expression function , points expression function , poppoint expression function , poppointid expression function , poppointnum expression function , prim expression function , primgrouplist expression function , primgroupmask expression function , primlist expression function , prims expression function , seampoints expression function , xyzdist expression function