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_texture.py
parent19385dbc57f566e27914a361768d3aa6dad95ec6 (diff)
glTF importer: Implement a user extension system
Diffstat (limited to 'io_scene_gltf2/blender/imp/gltf2_blender_texture.py')
-rw-r--r--io_scene_gltf2/blender/imp/gltf2_blender_texture.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/io_scene_gltf2/blender/imp/gltf2_blender_texture.py b/io_scene_gltf2/blender/imp/gltf2_blender_texture.py
index ddeb5bfc..2a41c28e 100644
--- a/io_scene_gltf2/blender/imp/gltf2_blender_texture.py
+++ b/io_scene_gltf2/blender/imp/gltf2_blender_texture.py
@@ -18,6 +18,7 @@ from .gltf2_blender_image import BlenderImage
from ..com.gltf2_blender_conversion import texture_transform_gltf_to_blender
from io_scene_gltf2.io.com.gltf2_io import Sampler
from io_scene_gltf2.io.com.gltf2_io_constants import TextureFilter, TextureWrap
+from io_scene_gltf2.io.imp.gltf2_io_user_extensions import import_user_extensions
def texture(
mh,
@@ -31,6 +32,9 @@ def texture(
"""Creates nodes for a TextureInfo and hooks up the color/alpha outputs."""
x, y = location
pytexture = mh.gltf.data.textures[tex_info.index]
+
+ import_user_extensions('gather_import_texture_before_hook', mh.gltf, pytexture, mh, tex_info, location, label, color_socket, alpha_socket, is_data)
+
if pytexture.sampler is not None:
pysampler = mh.gltf.data.samplers[pytexture.sampler]
else:
@@ -166,6 +170,8 @@ def texture(
# Outputs
mh.node_tree.links.new(uv_socket, uv_map.outputs[0])
+ import_user_extensions('gather_import_texture_after_hook', mh.gltf, pytexture, mh.node_tree, mh, tex_info, location, label, color_socket, alpha_socket, is_data)
+
def set_filtering(tex_img, pysampler):
"""Set the filtering/interpolation on an Image Texture from the glTf sampler."""
minf = pysampler.min_filter