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:
version
currently only version 1.0.0 is a valid valuename
library name, It is highly recommended to make it as unique as possibleauthor
author’s name / nickdescription
library descriptionlib_version
library version, a semantic versioning compatible version stringmodel_list
list of dictionaries containing model metadata, explained below.
Model information¶
To define a model, you have to use dictionary, containing following set of keys:
hash
model SHA1 hash encoded as base64, if not of a valid length, will be recalculated and replacedversion
model version, a semantic versioning compatible version stringauthor
model author’s name / nickdescription
model descriptionfile
file path, relative to folder containing__lib__.yaml
filetags
model tag list, later they can be used to find all models with matching tag, tags don’t have to be uniquescale
indicates how the model is scaled in comparison to real size.icon
path to an icon file for this model, relative to folder containing__lib__.yaml
file
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