On this page | |
Inheritance |
|
Overview ¶
For example, you might take a reference to a geometry node’s output:
>>> mygeo = hou.node("/obj/geo1/sphere1").geometry()
If after you take the reference something changes which causes the node to recook, and the recook fails, the geometry referred to by mygeo
is now invalid. Trying to access it will raise this exception.
>>> points = mygeo.points() hou.InvalidGeometry: ...
Tips and notes ¶
-
If you call
.geometry()
on a node that’s currently in error, you will getNone
instead of an invalid hou.Geometry object. -
You can check if a
Geometry
object is valid before you use it with hou.Geometry.isValid.if mygeo.isValid(): points = mygeo.points()
-
A Geometry reference turning invalid might happen if you grab geometry in code “outside” the cooking mechanism. If your code runs as part of the cook (for example, in a Python SOP), a valid
Geometry
reference should stay valid for the duration of your script.
¶
Methods from hou.Error ¶
description()
→ str
Return a description of the class of exception. The description is not related to the exception instance.
exceptionTypeName()
→ str
Return the name of the exception type. Instances of different
subclasses of hou.Error will return different names. Instances of the
base class will return "Error"
.
You can also use str(e.__class__)
to get the name of the subclass.
instanceMessage()
→ str
Return a message specific to the exception instance.