Skip to main content

🚀 SceneProgExec: Blender Python Script & Package Manager

SceneProgExec is a command-line tool and Python module that enables seamless execution of Blender scripts and package management within Blender's isolated Python environment.

🔥 Features

✅ Execute Python scripts inside Blender
✅ Install Python packages in Blender's Python environment
✅ Perform a full reset (remove all third-party packages)
✅ Works both as a CLI tool and a Python module

📥 Installation

1️⃣ Install from PyPI

pip install sceneprogexec

OR Clone the Repository

git clone https://github.com/KunalMGupta/SceneProgExec.git
cd SceneProgExec
pip install .

2️⃣ Set Environment Variables

Before using SceneProgExec, set the required environment variables:

export BLENDER_PATH=/Applications/Blender.app/Contents/MacOS/Blender
export BLENDER_PYTHON=/Applications/Blender.app/Contents/Resources/5.0/python/bin/python3.11

To make this permanent, add the lines to your ~/.bashrc or ~/.zshrc:

echo 'export BLENDER_PATH=/Applications/Blender.app/Contents/MacOS/Blender' >> ~/.zshrc
echo 'export BLENDER_PYTHON=/Applications/Blender.app/Contents/Resources/5.0/python/bin/python3.11' >> ~/.zshrc
source ~/.zshrc

Important! In case running this inside a linux container install the following dependencies:

apt update
apt install -y libx11-6 libxi6 libxxf86vm1 libxrender1 libgl1 libxfixes3 libxkbcommon-x11-0

3️⃣ Run CLI Commands

Once installed, you can use sceneprogexec globally.


🛠️ Usage

🔹 Run a Python Script Inside Blender

sceneprogexec run my_script.py --target my_scene.blend

✅ Runs my_script.py inside Blender.


🔹 Install Packages Inside Blender

sceneprogexec install numpy pandas

✅ Installs numpy and pandas inside Blender’s Python.


🔹 Install Packages With a Hard Reset

sceneprogexec install numpy pandas --reset

✅ Removes all third-party packages before installing new ones.


🔹 Reset Blender's Python (Remove All Third-Party Packages)

sceneprogexec reset

🗑️ Deletes all third-party Python packages in Blender.


🏗️ Using as a Python Module

SceneProgExec can also be imported and used in Python scripts:

from sceneprogexec import SceneProgExec

executor = SceneProgExec()
executor.install_packages(["numpy"])
executor.run_script("my_script.py")
executor._delete_all_third_party_packages()  # Hard reset

script = """
import bpy
print("Hello, World!")
"""
executor(script, target="test.blend")

🚀 Automatic Cleanup

  • Temporary directory (blender_tmp) is deleted after execution.
  • No leftover logs or scripts clutter your system.

🛠️ Troubleshooting

❌ Blender not found?
Ensure BLENDER_PATH and BLENDER_PYTHON are correctly set. Run:

echo $BLENDER_PATH
echo $BLENDER_PYTHON

❌ Permission denied?
Try:

chmod +x /usr/local/bin/sceneprogexec

❌ Blender script fails to execute?
Check the log:

cat blender_tmp/blender_log.txt

📝 License

This project is licensed under the MIT License.


👨‍💻 Author

Developed by Kunal Gupta
GitHub: KunalMGupta


⭐ Support the Project

If you find this tool useful, give it a ⭐ on GitHub!

Metadata

Release files for sceneprogexec 0.2.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sceneprogexec 0.2.6
File Size Uploaded Provenance
sceneprogexec-0.2.6.tar.gz 6.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for sceneprogexec 0.2.6
File Interpreter ABI Platform
sceneprogexec-0.2.6-py3-none-any.whl Python 3 none any Details

Total release size: 14.2 kB

Release files / sceneprogexec-0.2.6.tar.gz

Download URL sceneprogexec-0.2.6.tar.gz
Size 6.9 kB
Tags Source
SHA-256 checksum
How to use checksums
a79c44870abf634b5339211cc35c60acfea44c78b4181309a4c3db213b87e100
BLAKE2b-256 checksum
How to use checksums
8259b5308adbc1c597588f38f9415ba34aeecd5db7526f8d2b83a0ce309468da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.9

Release files / sceneprogexec-0.2.6-py3-none-any.whl

Download URL sceneprogexec-0.2.6-py3-none-any.whl
Size 7.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7e18ce41639adcbd058c5218bcf7e6352a2c84198b8558744067291a4de52e86
BLAKE2b-256 checksum
How to use checksums
74532e3a3a8888ca4b4d9bc068801369da68276678a58ce8b61772057686017c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.9

Security for sceneprogexec 0.2.6

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page