pyunity.loader module¶
Utility functions related to loading and saving PyUnity meshes and scenes.
This will be imported as pyunity.Loader
.
-
pyunity.loader.
LoadMesh
(filename)[source]¶ Loads a .mesh file generated by SaveMesh. It is optimized for faster loading.
Parameters: filename (str) – Name of file relative to the cwd Returns: Generated mesh Return type: Mesh
-
pyunity.loader.
LoadObj
(filename)[source]¶ Loads a .obj file to a PyUnity mesh.
Parameters: filename (str) – Name of file Returns: A mesh of the object file Return type: Mesh
-
class
pyunity.loader.
Primitives
[source]¶ Bases:
object
Primitive preloaded meshes. Do not instantiate this class.
-
pyunity.loader.
SaveMesh
(mesh, name, filePath=None)[source]¶ Saves a mesh to a .mesh file for faster loading.
Parameters: - mesh (Mesh) – Mesh to save
- name (str) – Name of the mesh
- filePath (str, optional) – Pass in __file__ to save in directory of script, otherwise pass in the path of where you want to save the file. For example, if you want to save in C:Downloads, then give “C:Downloadsmesh.mesh”. If not specified, then the mesh is saved in the cwd.
-
pyunity.loader.
components
= {'AABBoxCollider': <class 'pyunity.physics.core.AABBoxCollider'>, 'AudioListener': <class 'pyunity.audio.AudioListener'>, 'AudioSource': <class 'pyunity.audio.AudioSource'>, 'Camera': <class 'pyunity.render.Camera'>, 'Light': <class 'pyunity.core.Light'>, 'MeshRenderer': <class 'pyunity.core.MeshRenderer'>, 'SphereCollider': <class 'pyunity.physics.core.SphereCollider'>, 'Transform': <class 'pyunity.core.Transform'>}¶ List of all components by name