PyR3.meshlib¶
All files used as examples are contained in this repository, under corresponding relative paths.
LibraryManager class contained in this sub-package is designed to work as high-level tool to retrieving static models from specially prepared libraries.
How to create libraries¶
The core of every library is a __lib__.yaml file, containing all
library metadata, including list of models within library. Library
assets can be structured however you want them to, as long as you are
able to provide paths to them, relative to __lib__.yaml file
directory.
__lib__.yaml file contents¶
__lib__.yaml file is a static configuration file written in YAML.
This file have to contain following keys in top-level dictionary:
versioncurrently only version 1.0.0 is a valid valuenamelibrary name, It is highly recommended to make it as unique as possibleauthorauthor’s name / nickdescriptionlibrary descriptionlib_versionlibrary version, a semantic versioning compatible version stringmodel_listlist of dictionaries containing model metadata, explained below.
Model information¶
To define a model, you have to use dictionary, containing following set of keys:
hashmodel SHA1 hash encoded as base64, if not of a valid length, will be recalculated and replacedversionmodel version, a semantic versioning compatible version stringauthormodel author’s name / nickdescriptionmodel descriptionfilefile path, relative to folder containing__lib__.yamlfiletagsmodel tag list, later they can be used to find all models with matching tag, tags don’t have to be uniquescaleindicates how the model is scaled in comparison to real size.iconpath to an icon file for this model, relative to folder containing__lib__.yamlfile
Example __lib__.yaml file:
version: 1.0.0
name: Example Lib
author: Argmaster
description: ''
lib_version: 1.0.0
model_list:
- hash: e+kOrn6hL4tcJIHHwYWNLTbhzzY=
version: 1.0.0
author: Argmaster
description: ''
tags:
- CommonTag
- Example
- Example2
icon: __default_icon__
file: subfolder/model2.glb
scale: 10.0
- hash: +B4LrpYDjvu3t74iPTBsdYfBbx0=
version: 1.0.0
author: Argmaster
description: ''
tags:
- CommonTag
- Example
- Example1
icon: __default_icon__
file: model1.glb
scale: 1.0