Describes data file to load.
This is a generic resource description type for loading resources that are not textures, programs and scenes. That loaded class is used depends on the
kindor the file extension.
Currently used to load:
# Describe a text file. Text loader is used based on file extension DataDescription(path='data/text.txt') # Describe a json file. Json loader is used based on file extension DataDescription(path='data/data.json') # Describe a binary file. Specify a binary loader should be used. DataDescription(path='data/data.bin', kind='binary')
- DataDescription.__init__(path=None, kind=None, **kwargs)
Initialize the resource description.
- Keyword Arguments:
path (str) – Relative path to the resource
kind (str) – The resource kind deciding loader class
**kwargs – Additional custom attributes
The path to a resource when a single file is specified
The resolved path by a finder.
The absolute path to the resource can optionally be assigned by a loader class.
All keywords arguments passed to the resource
optional name for the resource
Assigning a label is not mandatory but can help when aliasing resources. Some prefer to preload all needed resources and fetch them later by the label. This can he a lot less chaotic in larger applications.
default resource kind.
kindis directly matched with the
kindin loader classes.
This property also supports assignment and is useful if the
kindis detected based in the the attribute values.
description.kind = 'something'
The loader class for this resource.
This property is assigned to during the loading stage were a loader class is assigned based on the kind.
- DataDescription.default_kind = None
The default kind for this resource type
- DataDescription.resource_type = 'data'
A unique identifier for the resource type