Mechanical Blender - Fork https://mechanicalblender.org
Go to file
Jaume Bellet 7f73f363b3 Rename file to MB_0014.h, build failed. 2023-11-19 19:27:54 +01:00
.gitea Gitea: add note that developers must opt-out of inclusion in AUTHORS 2023-08-18 09:23:43 +10:00
.github
build_files CMake: Allow building with system Vulkan and ShaderC 2023-11-10 18:10:41 +01:00
doc Merge branch 'blender-v4.0-release' 2023-11-01 10:33:27 +02:00
extern Merge branch 'blender-v4.0-release' 2023-10-31 18:17:46 +01:00
intern Merge branch 'blender-v4.0-release' 2023-11-10 09:19:03 +01:00
locale I18N: Updated translations from git/weblate repository. 2023-11-06 13:09:17 +01:00
release Merge branch 'blender-v4.0-release' 2023-11-08 14:59:16 +01:00
scripts allows loading and unload images from python 2023-11-18 17:06:22 +01:00
source Rename file to MB_0014.h, build failed. 2023-11-19 19:27:54 +01:00
tests Build: correct package name & code-comment for WESTON in lib/ 2023-11-09 14:57:09 +11:00
tools Cleanup: spelling in comments 2023-11-09 09:54:28 +11:00
.clang-format clang-format: set BraceWrapping::AfterControlStatement to "MultiLine" 2023-05-02 09:37:08 +10:00
.clang-tidy
.editorconfig
.git-blame-ignore-revs Cleanup: add commit to .git-blame-ignore-revs 2023-05-03 20:31:11 +10:00
.gitignore Ignore build files for VS and VS Code 2023-03-07 17:38:34 +01:00
AUTHORS AUTHORS: add 3 new developers 2023-11-02 16:09:11 +11:00
CMakeLists.txt Tests: add WIITH_TESTS_BATCHED option to execute Blender once per test 2023-11-08 18:41:33 +01:00
COPYING
GNUmakefile Makefile: remove redundant directory changing 2023-09-29 16:44:31 +10:00
README.md Custom info about branch on README.md 2023-11-19 00:57:53 +01:00
make.bat Windows: Propagate errors in make.bat 2023-08-16 19:29:47 +02:00
pyproject.toml pyproject: remove tools/pyproject.toml 2023-03-01 22:18:28 +11:00

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.