vrdObject¶
-
class
vrdObject
¶
This is the base class for all decoupled objects in VRED.
Summary¶
Functions¶
-
vrdObject.
asType
(type)¶ Tries to convert a vrdObject to a different type.
Parameters: type (vrdObject) – The type to convert to. Returns: The converted vrdObject. Check with vrdObject.isNull() if the conversion succeeded. Return type: vrdObject
-
vrdObject.
getObjectId
()¶ Returns the internal object id.
Returns: The object identifier. Return type: integer
-
vrdObject.
isNull
()¶ Determines if the object is null.
An object is null if its internal object has not been set so that its object id is 0. This is the case for all default constructed vrdObjects.
An object is not null, when its internal object becomes invalid. For that specialized checks like vrdSceneObject.isValid() are needed.
Returns: True if null, False otherwise. Return type: bool
-
vrdObject.
isType
(type)¶ Determines whether the specified object is of a specific type.
Example: To check if a specific object has a type derived from vrdMaterial, you can call this:
if (someObject.isType(vrdMaterial)): print("material found!")
Note, to check only the concrete type, use:
# Matches only nodes that are a vrdTransformNode, # does not match nodes with type derived from vrdTransformNode: if (type(someObject) == vrdTransformNode): print("transform node found!")
Parameters: type (vrdObject) – The object type Returns: True if the specified object is type, False otherwise. Return type: bool