Skip to content

Commit

Permalink
glTF exporter: Do not export special attributes, used internally by B…
Browse files Browse the repository at this point in the history
…lender
  • Loading branch information
julienduroure committed Nov 2, 2022
1 parent c4dddb8 commit addeb64
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion io_scene_gltf2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
bl_info = {
'name': 'glTF 2.0 format',
'author': 'Julien Duroure, Scurest, Norbert Nopper, Urs Hanselmann, Moritz Becher, Benjamin Schmithüsen, Jim Eckerlein, and many external contributors',
"version": (3, 4, 43),
"version": (3, 4, 44),
'blender': (3, 3, 0),
'location': 'File > Import-Export',
'description': 'Import-Export as glTF 2.0',
Expand Down
10 changes: 9 additions & 1 deletion io_scene_gltf2/blender/com/gltf2_blender_default.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,12 @@

BLENDER_IOR = 1.45
BLENDER_SPECULAR = 0.5
BLENDER_SPECULAR_TINT = 0.0
BLENDER_SPECULAR_TINT = 0.0


SPECIAL_ATTRIBUTES = {
".select_vert",
".select_edge",
".select_poly",
"material_index"
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from io_scene_gltf2.blender.exp import gltf2_blender_gather_skins
from io_scene_gltf2.io.com import gltf2_io_constants
from io_scene_gltf2.blender.com import gltf2_blender_conversion
from io_scene_gltf2.blender.com import gltf2_blender_default


def extract_primitives(blender_mesh, uuid_for_skined_data, blender_vertex_groups, modifiers, export_settings):
Expand Down Expand Up @@ -137,6 +138,11 @@ def prepare_data(self):
def define_attributes(self):
# Manage attributes + COLOR_0
for blender_attribute_index, blender_attribute in enumerate(self.blender_mesh.attributes):

# Excluse special attributes (used internally by Blender)
if blender_attribute.name in gltf2_blender_default.SPECIAL_ATTRIBUTES:
continue

attr = {}
attr['blender_attribute_index'] = blender_attribute_index
attr['blender_name'] = blender_attribute.name
Expand Down

0 comments on commit addeb64

Please sign in to comment.