bnp contains simple numpy utilities for Blender.
Latest version: 0.4.1
You can easily read Blender's objects with numpy!
- Copy
bnp/bnp
to$YOUR_BLENDER_PATH/scripts/addons_contrib
manually
e.g. $YOUR_BLENDER_PATH
: C:/Program Files/Blender Foundation/Blender 2.83/2.83
- OK: C:/Program Files/Blender Foundation/Blender 2.83/2.83/scripts/addons_contrib/bnp/init.py
- NG: C:/Program Files/Blender Foundation/Blender 2.83/2.83/scripts/addons_contrib/bnp/bnp/init.py
If you have some errors when you import numpy, please run following commands.
- Download get-pip.py in
$YOUR_FAVORITE_DIRECTORY
% cd $YOUR_FAVORITE_DIRECTORY
% $BLENDER_PYTHON_PATH/python get-pip.py
with administrator mode orsudo
% $BLENDER_PIP_PATH/pip install numpy
with administrator mode orsudo
e.g.
$YOUR_FAVORITE_DIRECTORY
:C:/Users/YOUR_ACCOUNT/Downloads
$BLENDER_PYTHON_PATH
:C:/Program Files/Blender Foundation/Blender 2.83/2.83/python/bin
import bnp
vertices = bnp.objname2np("Cube")
print(vertices) # (vtx_num, 3)
bnp.scene.put_cubes(vertices)
You can find more examples at https://github.com/j20232/bnp/tree/master/examples
To check examples, please open *.blend
(sample scenes) files in your file browser.
Don't open *.blend
files from Blender.exe
because this library doesn't work due to the permission.
-
Numpy converter
- Translation matrices of
bpy.types.Object
andbpy.types.Armature
- Vertex positions of
bpy.types.Mesh
- Skinning weights (vertex weights) of
bpy.types.Object
- Blend shapes (shape keys) of
bpy.types.Object
- Camera parameters from
bpy.types.Camera
- Translation matrices of
-
Clear unused objects in your Scene
-
Green box: box deformed with Blender's LBS
-
White boxes: vertices calculated with bnp's LBS
-
You can easily add blend shapes (shape keys) and insert the keyframes to the scene
-
You can easily write rendered images and gbuffers as
.png
,.bmp
,.jpg
,.exr
,.hdr
and.mp4
-
Left: GLTF default shading
-
Right: PBR shading based on cgbookcase.com
-
You can easily load PBR textures!
- Please get them from FREE PBR, textures.com and so on
You can render images with offscreen mode as follows:
$ blender.exe -b .\004_set_camera_and_render_image.blend -P ..\examples\004_set_camera_and_render_image.py
https://bnp.readthedocs.io/en/latest/
- Blender 2.83.0 (or later)
- numpy: 1.19.0 (or later)
GPL-3.0 (based on Blender)
If bnp violates any licenses, I'll delete this repository immediately.
Please let me know if there're problems.
mocobt