The aim of package viskillz-glb is to encode GLB assets representing Mental Cutting Test exercises, created with the use of our viskillz-blender package.
We recommend two options to download and install a Python interpreter:
-
Download and install a Python interpreter directly.
-
Download Miniconda and create an environment
-
Create an environment with name
mct(the name can be changed):conda create --name mct python=3.10 -
Activate the environment (to access command
pipin command-line):conda activate mct
For further commands and configuration, see the official Conda Cheat Sheet.
-
We have added the dependencies to file requirements.txt. Thus, you can install the requirements using the following pip command:
pip -r requirements.txt
Alternatively, you can install the dependencies manually:
-
Install package
viskillz-commonThe wrapper script uses functions of our package
viskillz-common. Thus, install this package directly from our GitHub repository, using the followingpipcommand:pip install git+https://github.com/viskillz/viskillz-common#egg=viskillz-common -
Install package
wakepyTo prevent your computer from falling asleep during the rendering or exporting process, we use package
wakepyin the wrapper script. Install this package using the followingpipcommand:pip install wakepy
The easiest way to install our package is to execute the following pip command, downloading the latest version from our GitHub repository:
pip install git+https://github.com/viskillz/viskillz-glb#egg=viskillz-glb
Our package was developed and tested in an environment having the following properties:
- Conda version: 4.14.0
- Python interpreter version: 3.10.6
wakepyversion: 0.5.0- OS: Windows 11 Home
Our package contains a command-line runner, that can be invoked using the following command:
viskillz-glb <path-of-configuration>
With the use of the command-line runner, users can specify their workflow in a JSON document, specifying the following goals:
-
material- Adds the reference material to the given group(s) of assets. The material is defined in moduleviskillz.mct.glb.constants.Parameters:
src: the path of the folder that contains the original assetsdist: the path of the folder in which the script writes the assets having the new materialgroups: the list of IDs specifying that which groups should be processed
Example:
{ "type": "material", "src": "00-original", "dist": "01-material", "groups": [1, 3, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24] } -
clean- Removes metadata from the given group(s) of assets.Parameters:
src: the path of the folder that contains the original assetsdist: the path of the folder in which the script writes the assets without their metadatagroups: the list of IDs specifying that which groups should be processed
Example:
{ "type": "material", "src": "01-material", "dist": "02-cleaned", "groups": [1, 3, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24] } -
texture- Removes the textures from the given group(s) of assets.Parameters:
src: the path of the folder that contains the original assetsdist: the path of the folder in which the script writes the assets without the texturesgroups: the list of IDs specifying that which groups should be processed
Example:
{ "type": "material", "src": "02-cleaned", "dist": "03-non-textured", "groups": [1, 3, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24] } -
encode- Encodes the given group(s) of assets. Each execution consumes a set of plain assets and executes the sequence of the required invocations of the encoding functions.Parameters:
src: the path of the folder that contains the original assetsdist: the path of the folder in which the encoded documents should be writtengroups: the list of IDs specifying that which groups should be processedlevel: the level of the encoding (1,2,3, or4)
Example:
{ "type": "encode", "src": "02-cleaned", "dist": "911-encoded", "groups": [1, 3, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15 ,16, 17, 18, 19, 20, 21, 22, 23, 24], "level": 1 } -
decode- Decodes the given group(s) of assets.Parameters:
src: the path of the folder that contains the encoded documentsdist: the path of the folder in which the decoded assets should be writtengroups: the list of IDs specifying that which groups should be processedlevel: the level of the encoding (1,2,3, or4)
Example:
{ "type": "decode", "src": "911-encoded", "dist": "912-decoded", "groups": [1, 3, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15 ,16, 17, 18, 19, 20, 21, 22, 23, 24], "level": 1 } -
validate- Validates the given group(s) of assets.Parameters:
src: the path of the folder that contains original assetsdist: the path of the folder that contains the decoded assetsgroups: the list of IDs specifying that which groups should be processedepsilon: the threshold to be used in the comparison
Example:
{ "type": "validate", "src": "02-cleaned", "dist": "912-decoded", "groups": [1, 3, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15 ,16, 17, 18, 19, 20, 21, 22, 23, 24], "epsilon": 0.00000005 }
The JSON document contains two properties:
working-directory: the path of the working directorygoals: the goals that should be executed in the given order
{
"working-directory": "d:\\tmp\\0-glb",
"goals": [
{
"type": "material",
"src": "00-original",
"dist": "01-material",
"groups": [1, 3, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15 ,16, 17, 18, 19, 20, 21, 22, 23, 24]
},
{
"type": "clean",
"src": "01-material",
"dist": "02-cleaned",
"groups": [1, 3, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15 ,16, 17, 18, 19, 20, 21, 22, 23, 24]
},
{
"type": "texture",
"src": "02-cleaned",
"dist": "03-non-textured",
"groups": [1, 3, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15 ,16, 17, 18, 19, 20, 21, 22, 23, 24]
}
]
}