pysdic-blender
Rendering of synthetic images for pysdic with Blender (Cycles):
shading, shadows and the reflections of materials, as a complement of pysdic.generate_synthetic_image
(exact gray levels of the texture, without lighting).
Why a separate package
Blender as a Python module (bpy) supports exactly one version of Python per release of Blender
(Blender 5.1: Python 3.13). Keeping it out of pysdic lets pysdic support several versions of Python,
while pysdic-blender follows the version of Python of Blender.
Installation
python3.13 -m venv .venv && source .venv/bin/activate
pip install pysdic-blender # installs pysdic and bpy
Usage
from pysdic_blender import (BlenderCamera, BlenderExperiment, BlenderMesh, BlenderSpotLight,
get_matte_paint_material)
experiment = BlenderExperiment(background_strength=0.1)
experiment.add_camera("left", BlenderCamera(left_camera)) # pysdic.Camera, OpenCV pinhole model
experiment.add_spotlight("spot", BlenderSpotLight.looking_at([0, -200, 600], [0, 0, 0], energy=5e5))
experiment.add_mesh("specimen", BlenderMesh(mesh, texture=speckle), material=get_matte_paint_material())
for frame, displacement in enumerate(displacements):
experiment.update_mesh("specimen", BlenderMesh(mesh, displacement=displacement))
intensity = experiment.render("left", n_samples=256) # (H, W) linear intensity
Requirements on the pysdic objects:
- the camera:
PerspectiveExtrinsic,PinholeIntrinsicwithout skew, no distortion (render without the distortion, then apply it withpysdic.distort_image); - the mesh: a 3D
triangle_3mesh (with a UV map for a texture).
The conversions (BlenderCamera, BlenderMesh, ...) do not import bpy: it is imported at the
creation of the first BlenderExperiment.
Metadata
Release files for pysdic-blender 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pysdic_blender-1.0.0.tar.gz | 45.1 kB | Without provenance | Details for pysdic_blender-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pysdic_blender-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for pysdic_blender-1.0.0-py3-none-any.whl |
Total release size: 96.1 kB
Release files / pysdic_blender-1.0.0.tar.gz
| Download URL | pysdic_blender-1.0.0.tar.gz |
|---|---|
| Size | 45.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7522a0571c317487a268efdea790528a39d02b0a7c9be2678d1bdec6374b206d
|
|
BLAKE2b-256 checksum How to use checksums |
d2ea3d7d68f9342180a9caf3689c405d5b747dc53aa26970855f3a09e1a567f2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / pysdic_blender-1.0.0-py3-none-any.whl
| Download URL | pysdic_blender-1.0.0-py3-none-any.whl |
|---|---|
| Size | 51.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7a612bb3b3296808a5c6359f0fb4573b6cb52c6ad5e212dbe5adc3061bad91e8
|
|
BLAKE2b-256 checksum How to use checksums |
ca82a5ef7e678b8f802c46c8dbbd27c48ed4f873e5ecc19a723ec256f9b921ea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Security for pysdic-blender 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.