Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Duroure <julien.duroure@gmail.com>2022-01-20 21:05:09 +0300
committerJulien Duroure <julien.duroure@gmail.com>2022-01-20 21:05:09 +0300
commita5205b0289717dc418c1a6070c89039204a2e951 (patch)
tree6ed3a68f179c914e9dd352b74ea66bd02da9f24e /io_scene_gltf2/blender/imp/gltf2_blender_image.py
parent19385dbc57f566e27914a361768d3aa6dad95ec6 (diff)
glTF importer: Implement a user extension system
Diffstat (limited to 'io_scene_gltf2/blender/imp/gltf2_blender_image.py')
-rwxr-xr-xio_scene_gltf2/blender/imp/gltf2_blender_image.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/io_scene_gltf2/blender/imp/gltf2_blender_image.py b/io_scene_gltf2/blender/imp/gltf2_blender_image.py
index 3acf1786..0df6dc0e 100755
--- a/io_scene_gltf2/blender/imp/gltf2_blender_image.py
+++ b/io_scene_gltf2/blender/imp/gltf2_blender_image.py
@@ -20,6 +20,7 @@ import urllib.parse
import re
from ...io.imp.gltf2_io_binary import BinaryData
+from io_scene_gltf2.io.imp.gltf2_io_user_extensions import import_user_extensions
# Note that Image is not a glTF2.0 object
@@ -32,6 +33,9 @@ class BlenderImage():
def create(gltf, img_idx):
"""Image creation."""
img = gltf.data.images[img_idx]
+
+ import_user_extensions('gather_import_image_before_hook', gltf, img)
+
img_name = img.name
if img.blender_image_name is not None:
@@ -90,6 +94,8 @@ class BlenderImage():
if not is_placeholder and needs_pack:
blender_image.pack()
+ import_user_extensions('gather_import_image_after_hook', gltf, img, blender_image)
+
def _placeholder_image(name, path):
image = bpy.data.images.new(name, 128, 128)
# allow the path to be resolved later