Skip to content

Commit

Permalink
Merge pull request #1976 from KhronosGroup/fix_1974
Browse files Browse the repository at this point in the history
Fix #1974 conversion for some attribute types
  • Loading branch information
julienduroure authored Sep 6, 2023
2 parents 810bb18 + c9a5cf6 commit f7f45ba
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions addons/io_scene_gltf2/blender/com/gltf2_blender_conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ def get_numpy_type(attribute_component_type):
def get_attribute_type(component_type, data_type):
if gltf2_io_constants.DataType.num_elements(data_type) == 1:
return {
gltf2_io_constants.ComponentType.Float: "FLOAT"
gltf2_io_constants.ComponentType.Float: "FLOAT",
gltf2_io_constants.ComponentType.UnsignedByte: "INT" # What is the best for compatibility?
}[component_type]
elif gltf2_io_constants.DataType.num_elements(data_type) == 2:
return {
Expand All @@ -142,7 +143,8 @@ def get_attribute_type(component_type, data_type):
elif gltf2_io_constants.DataType.num_elements(data_type) == 4:
return {
gltf2_io_constants.ComponentType.Float: "FLOAT_COLOR",
gltf2_io_constants.ComponentType.UnsignedShort: "BYTE_COLOR"
gltf2_io_constants.ComponentType.UnsignedShort: "BYTE_COLOR",
gltf2_io_constants.ComponentType.UnsignedByte: "BYTE_COLOR" # What is the best for compatibility?
}[component_type]
else:
pass
Expand Down

0 comments on commit f7f45ba

Please sign in to comment.