GLTFContent
-
class
compas.files.GLTFContent[source] Bases:
objectClass for managing the content of a glTF file.
- Attributes
scenes (dict) – Dictionary containing (int,
compas.files.GLTFScene) pairs.default_scene_key (int or None) – Key of the scene to be displayed on loading the glTF.
nodes (dict) – Dictionary containing (int,
compas.files.GLTFNode) pairs.meshes (dict) – Dictionary containing (int,
compas.files.GLTFMesh) pairs.cameras (dict) – Dictionary containing (int,
compas.files.data_classes.CameraData) pairs.animations (dict) – Dictionary containing (int,
compas.files.data_classes.AnimationData) pairs.skins (dict) – Dictionary containing (int,
compas.files.data_classes.SkinData) pairs.materials (dict) – Dictionary containing (int,
compas.files.data_classes.MaterialData) pairs.textures (dict) – Dictionary containing (int,
compas.files.data_classes.TextureData) pairs.samplers (dict) – Dictionary containing (int,
compas.files.data_classes.SamplerData) pairs.images (dict) – Dictionary containing (int,
compas.files.data_classes.ImageData) pairs.extras (object)
extensions (object)
Methods
__init__()Initialize self.
add_child_to_node(parent_node[, child_name, …])Creates a
compas.files.GLTFNodeand adds this node to the children ofparent_node.add_mesh(mesh)Creates a
compas.files.GLTFMeshobject from a compas mesh, and adds this to the content.add_mesh_to_node(node, mesh)Adds an existing mesh to
nodeifmeshis a valid mesh key, or throughadd_meshcreates and adds a mesh tonode.add_node_to_scene(scene[, node_name, …])Creates a
compas.files.GLTFNodeand adds this node to the children ofscene.add_scene([name, extras])Adds a scene to the content.
Raises an exception if
compas.files.GLTFContent.nodesis not a disjoint union of rooted trees.get_node_faces(node)Returns the faces of the mesh at
node, if any.get_node_vertices(node)Returns the vertices of the mesh at
node, if any.get_nodes_from_scene(scene)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.