From 63940b96d01c59b92eefabb1f6a0e810740886f6 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 22 Jul 2019 23:21:11 +0300 Subject: [PATCH] Fixed Materials --- hifi_tools/__init__.py | 2 +- hifi_tools/ext/modified_fbx_tools/mod_export_fbx_bin.py | 3 +++ hifi_tools/utils/helpers/materials.py | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/hifi_tools/__init__.py b/hifi_tools/__init__.py index 86b9209..e1cee36 100644 --- a/hifi_tools/__init__.py +++ b/hifi_tools/__init__.py @@ -20,7 +20,7 @@ bl_info = { "name": "Metaverse Toolkit Blender Add-on", "author": "Matti 'Menithal' Lahtinen", - "version": (1, 5, 3), + "version": (1, 5, 4), "blender": (2, 80, 0), "location": "File > Import-Export, Materials, Armature", "description": "Blender tools to allow for easier Content creation for Metaverses, such as High Fidelity", diff --git a/hifi_tools/ext/modified_fbx_tools/mod_export_fbx_bin.py b/hifi_tools/ext/modified_fbx_tools/mod_export_fbx_bin.py index 5e81b87..e66f5a8 100644 --- a/hifi_tools/ext/modified_fbx_tools/mod_export_fbx_bin.py +++ b/hifi_tools/ext/modified_fbx_tools/mod_export_fbx_bin.py @@ -527,10 +527,13 @@ def fbx_data_from_scene(scene, depsgraph, settings): # Note: with nodal shaders, we'll could be generating much more textures, but that's kind of unavoidable, # given that textures actually do not exist anymore in material context in Blender... ma_wrap = HifiShaderWrapper(ma, is_readonly=True) + print("Material", ma, ma.name) for sock_name, fbx_name in HIFI_SPECIFIC_SOCKETS_FBX: tex = getattr(ma_wrap, sock_name) + print("Texture:", tex, sock_name) if tex is None or tex.image is None: continue + blender_tex_key = (ma, sock_name) data_textures[blender_tex_key] = (get_blender_nodetexture_key(*blender_tex_key), fbx_name) diff --git a/hifi_tools/utils/helpers/materials.py b/hifi_tools/utils/helpers/materials.py index 35687ac..9bca66f 100644 --- a/hifi_tools/utils/helpers/materials.py +++ b/hifi_tools/utils/helpers/materials.py @@ -227,7 +227,7 @@ def __init__(self, material, is_readonly=True, use_nodes=True): material, is_readonly, use_nodes) def update(self): - super(PrincipledBSDFWrapper, self).update() + PrincipledBSDFWrapper.update(self) print("HifiShaderWrapper", self.use_nodes, self.node_principled_bsdf) @@ -247,6 +247,7 @@ def emission_set(self, value): # Will only be used as gray-scale one... def emission_texture_get(self): + print("Emission Texture Get", self.use_nodes, self.node_principled_bsdf) if not self.use_nodes or self.node_principled_bsdf is None: return None return ShaderImageTextureWrapper(