GLTFContent
- class compas.files.GLTFContent[source]
Bases:
object
Class for managing the content of a glTF file.
- Attributes
scenes (dict) – Dictionary containing (int,
GLTFScene
) pairs.default_scene_key (int or None) – Key of the scene to be displayed on loading the glTF.
nodes (dict) – Dictionary containing (int,
GLTFNode
) pairs.meshes (dict) – Dictionary containing (int,
GLTFMesh
) pairs.cameras (dict) – Dictionary containing (int,
CameraData
) pairs.animations (dict) – Dictionary containing (int,
AnimationData
) pairs.skins (dict) – Dictionary containing (int,
SkinData
) pairs.materials (dict) – Dictionary containing (int,
MaterialData
) pairs.textures (dict) – Dictionary containing (int,
TextureData
) pairs.samplers (dict) – Dictionary containing (int,
SamplerData
) pairs.images (dict) – Dictionary containing (int,
ImageData
) pairs.extras (object)
extensions (object)
Methods
Creates a
GLTFNode
and adds this node to the children ofparent_node
.Adds an image to the content.
Adds a material to the content.
Creates a
GLTFMesh
object from a compas mesh, and adds this to the content.Adds an existing mesh to
node
ifmesh
is a valid mesh key, or throughadd_mesh
creates and adds a mesh tonode
.Creates a
GLTFNode
and adds this node to the children ofscene
.Adds a scene to the content.
Adds a texture to the content.
Raises an exception if
compas.files.GLTFContent.nodes
is not a disjoint union of rooted trees.Returns the index of the material.
Returns the node with a specific name.
Returns the faces of the mesh at
node
, if any.Returns the vertices of the mesh at
node
, if any.Returns dictionary of nodes in the given scene, without a specified root.
Returns a tuple containing a dictionary of positions and a list of tuples representing edges.
Removes orphaned objects.
Walks through all nodes and updates their transforms and positions.
Walks through the scene tree and updates transforms and positions.