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_material.py
parent19385dbc57f566e27914a361768d3aa6dad95ec6 (diff)
glTF importer: Implement a user extension system
Diffstat (limited to 'io_scene_gltf2/blender/imp/gltf2_blender_material.py')
-rwxr-xr-xio_scene_gltf2/blender/imp/gltf2_blender_material.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/io_scene_gltf2/blender/imp/gltf2_blender_material.py b/io_scene_gltf2/blender/imp/gltf2_blender_material.py
index 077f5af6..1a5be06f 100755
--- a/io_scene_gltf2/blender/imp/gltf2_blender_material.py
+++ b/io_scene_gltf2/blender/imp/gltf2_blender_material.py
@@ -18,6 +18,7 @@ from ..com.gltf2_blender_extras import set_extras
from .gltf2_blender_pbrMetallicRoughness import MaterialHelper, pbr_metallic_roughness
from .gltf2_blender_KHR_materials_pbrSpecularGlossiness import pbr_specular_glossiness
from .gltf2_blender_KHR_materials_unlit import unlit
+from io_scene_gltf2.io.imp.gltf2_io_user_extensions import import_user_extensions
class BlenderMaterial():
@@ -30,6 +31,8 @@ class BlenderMaterial():
"""Material creation."""
pymaterial = gltf.data.materials[material_idx]
+ import_user_extensions('gather_import_material_before_hook', gltf, pymaterial, vertex_color)
+
name = pymaterial.name
if name is None:
name = "Material_" + str(material_idx)
@@ -56,6 +59,8 @@ class BlenderMaterial():
else:
pbr_metallic_roughness(mh)
+ import_user_extensions('gather_import_material_after_hook', gltf, pymaterial, vertex_color, mat)
+
@staticmethod
def set_double_sided(pymaterial, mat):
mat.use_backface_culling = (pymaterial.double_sided != True)