Skip to content

A demo on running Blender with a Python script for generating and rendering a scene.

License

Notifications You must be signed in to change notification settings

TomasHubelbauer/blender-script

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Blender Script

  1. Add Blender to %PATH% and run pip install bpy
  2. Open the repository in VS Code
  3. Open script.py and render.png in split view side by side
  4. Open the VS Code terminal
  5. Run npx nodemon --exec blender --background --python script.py
  6. Observe the render.png preview refresh after each save
  7. Debug by either:
  • Removing --background
  • Splitting terminal and running blender --python script.py
  • Pressing F12 in Blender to preview render

Stalking Blender Operations' Corresponding Python

As per https://www.youtube.com/watch?v=45WZWqmpRQE, open up the Scripting workspace and do your work, observe the console to see the Python code for each operation that you carry out.

To-Do

Figure out how to get autocompletion for bpy

https://github.com/TomasHubelbauer/blender-python-intellisense

Set up a GitHub Actions workflow which installs Blender and runs the script

blender --python script.py on every push and push render.png to the repository.

About

A demo on running Blender with a Python script for generating and rendering a scene.

Topics

Resources

License

Stars

Watchers

Forks

Languages