Skip to content

Commit

Permalink
Merge pull request #25 from sketchfab/various-fixes_D3D-5979
Browse files Browse the repository at this point in the history
[#D3D-5979] Various plugin fixes
  • Loading branch information
loicSketchfab authored Feb 1, 2021
2 parents c2c0be9 + b12c92a commit 7296fa4
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
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))

0 comments on commit 7296fa4

Please sign in to comment.