Wrapper for xNormal
Project description
xNormal Wrapper
This is a wrapper for the program xNormal that allows for easy scripting and automation.
It is licensed under BSD
For any issues feel free to contact me at:
contact@theorangeduck.com
Basic Usage
The below generates a normal map and ambient occlusion map for the piano meshes.
import xNormal
xNormal.run("piano_high.obj", "piano_low.obj", "piano.png",
width=256, height=256, gen_normals = True, gen_ao = True)
Extended Usage 1
The belows shows some more features.
First the path is set. By default the wrapper assumes xNormal.exe
is in the PATH variable.
Secondly it generates a normal map with a switch coordinate system and an AO map with fewer rays and jitter. Finally is generates a convexity map.
For a full list of options have a look in the source code where they are listed and easy to see.
Finally it stores the errorcode of xNormal in case of something being wrong.
import xNormal
xNormal.path = "C:\\Program Files\\xNormal\\3.19.3\\x64\\xNormal.exe"
err = xNormal.run("piano_high.obj", "piano_low.obj", "piano.png", width = 256, height = 256,
gen_normals = True, normals_x = "+X", normals_y = "-Z", normals_z = "+Y",
gen_ao = True, ao_rays = 64, ao_jitter = True,
gen_convexity = True, convexity_scale = 0.75)
Extended Usage 2
Scripting xNormal goes via the form of supplying it with a configuration file. These can be generated and saved for later use.
To build a configuration file xNormal.config
it must be supplied with a list of high mesh options, a list of low mesh options and a list of generation options.
import xNormal
high_config = xNormal.high_mesh_options("piano_high.obj", scale = 2.0)
low_config = xNormal.low_mesh_options("piano_low.obj", scale = 2.0)
generation_config = xNormal.generation_options("piano.png", gen_normals = True)
config = xNormal.config([high_config], [low_config], generation_config)
f = open("later.xml", 'w')
f.write(config)
f.close()
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file xNormal-1.1.1.tar.gz
.
File metadata
- Download URL: xNormal-1.1.1.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0.post20200210 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4624339495e79a70ddee6d177e71a3e626cbbace616c4251f958a7818b6c2185 |
|
MD5 | 8a2437779921cfca1f430ef4119bdbd3 |
|
BLAKE2b-256 | d15331988f2014a2c8a1c980033064ba252c079dc93bd9d7bb4e162f6afd6254 |
File details
Details for the file xNormal-1.1.1-py3.7.egg
.
File metadata
- Download URL: xNormal-1.1.1-py3.7.egg
- Upload date:
- Size: 10.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0.post20200210 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1abefffd706b426044262f6f76770fc732c4827578a6a8ddb7378bb299d7c594 |
|
MD5 | 156e0d27d6333a795c814a19988d0f84 |
|
BLAKE2b-256 | ec8bd0c2bfbca63764f1a1b0d08e6c033fc7fa42d34ed8b99a1b6c6d63c7b24d |
File details
Details for the file xNormal-1.1.1-py3-none-any.whl
.
File metadata
- Download URL: xNormal-1.1.1-py3-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0.post20200210 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b8340f22600a12a06a39da3c7bf514a2c258e07968e85c3d8dddb0a77073db78 |
|
MD5 | 3627490792528fb5576b2a8a919867dd |
|
BLAKE2b-256 | 6b1e7e7a68704f3f810085bf0ca3aaf3df4df61fe1833c66470d71f8ebcc1d7a |