forked from blender/blender
Mechanical Blender - Fork
https://mechanicalblender.org
|
||
---|---|---|
.gitea | ||
.github | ||
build_files | ||
doc | ||
extern | ||
intern | ||
locale | ||
release | ||
scripts | ||
source | ||
tests | ||
tools | ||
.clang-format | ||
.clang-tidy | ||
.editorconfig | ||
.git-blame-ignore-revs | ||
.gitignore | ||
AUTHORS | ||
CMakeLists.txt | ||
COPYING | ||
GNUmakefile | ||
README.md | ||
make.bat | ||
pyproject.toml |
README.md
Mechanical Blender
This branch allows to load an image to be used on other parts of a Python script (or Addon) but it does not need to be stored in Blender file data.
Example Python Script
import os
import bpy
import bpy.utils.images
img = None
def register():
global img
# Set path to an existing file
path = os.path.join(os.path.dirname(bpy.app.binary_path), 'image.png')
img = bpy.utils.images.load('my_image', path)
def unregister():
global img
if img != None:
bpy.utils.images.release(img['id'])
if __name__ == "__main__":
register()
See Documentation and Development Notes on Project's website.