Skip to content

Commit

Permalink
Fixed Materials
Browse files Browse the repository at this point in the history
  • Loading branch information
Menithal committed Jul 22, 2019
1 parent 980a98e commit 63940b9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion hifi_tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 3 additions & 0 deletions hifi_tools/ext/modified_fbx_tools/mod_export_fbx_bin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
3 changes: 2 additions & 1 deletion hifi_tools/utils/helpers/materials.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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(
Expand Down

0 comments on commit 63940b9

Please sign in to comment.