Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#D3D-5979] Various plugin fixes #25

Merged
merged 4 commits into from
Feb 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion addons/io_sketchfab_plugin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
'author': 'Sketchfab',
'license': 'GPL',
'deps': '',
'version': (1, 3, 0),
'version': (1, 3, 1),
"blender": (2, 80, 0),
'location': 'View3D > Tools > Sketchfab',
'warning': '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ def create(gltf, material_idx, vertex_color):

if bpy.app.version >= (2, 80, 0):
mat.use_backface_culling = (pymaterial.double_sided != True)
# Use multiple layers for transparency
mat.show_transparent_back = False

if pymaterial.extensions is not None and 'KHR_materials_pbrSpecularGlossiness' in pymaterial.extensions.keys():
BlenderKHR_materials_pbrSpecularGlossiness.create(gltf, pymaterial.extensions['KHR_materials_pbrSpecularGlossiness'], mat.name, vertex_color)
Expand Down
5 changes: 4 additions & 1 deletion addons/io_sketchfab_plugin/pack_for_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ def prepare_assets(export_settings):
images.add(n.image)

if export_settings['selection'] and ob.type == 'MESH':
if not Version.get_selected(ob) or not Version.get_visible(ob):
# Add relevant objects to the list of objects to remove
if not Version.get_visible(ob): # Not visible
hidden.add(ob)
elif not Version.get_selected(ob): # Visible but not selected
Version.set_visible(ob, False)
hidden.add(ob)

Expand Down
10 changes: 9 additions & 1 deletion khronos-gltf.patch
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,13 @@ index 16a4242..02fd847 100644
+
self.log = log.logger
self.log_handler = log.hdlr


@@ -159,7 +163,7 @@ class glTFImporter():
# glTF file
if not self.is_glb_format:
self.content = None
- with open(self.filename, 'r') as f:
+ with open(self.filename, 'r', encoding='utf8') as f:
content = f.read()
try:
self.data = gltf_from_dict(json.loads(content, parse_constant=glTFImporter.bad_json_value))