File tree Expand file tree Collapse file tree 1 file changed +22
-2
lines changed
Expand file tree Collapse file tree 1 file changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -1770,8 +1770,28 @@ Dictionary GLTFAccessor::to_dictionary() const {
17701770 }
17711771 dict[" componentType" ] = component_type;
17721772 dict[" count" ] = count;
1773- dict[" max" ] = max;
1774- dict[" min" ] = min;
1773+ switch (component_type) {
1774+ case COMPONENT_TYPE_NONE: {
1775+ ERR_PRINT (" glTF export: Invalid component type 'NONE' for glTF accessor." );
1776+ } break ;
1777+ case COMPONENT_TYPE_SIGNED_BYTE:
1778+ case COMPONENT_TYPE_UNSIGNED_BYTE:
1779+ case COMPONENT_TYPE_SIGNED_SHORT:
1780+ case COMPONENT_TYPE_UNSIGNED_SHORT:
1781+ case COMPONENT_TYPE_SIGNED_INT:
1782+ case COMPONENT_TYPE_UNSIGNED_INT:
1783+ case COMPONENT_TYPE_SIGNED_LONG:
1784+ case COMPONENT_TYPE_UNSIGNED_LONG: {
1785+ dict[" max" ] = PackedInt64Array (Variant (max));
1786+ dict[" min" ] = PackedInt64Array (Variant (min));
1787+ } break ;
1788+ case COMPONENT_TYPE_SINGLE_FLOAT:
1789+ case COMPONENT_TYPE_DOUBLE_FLOAT:
1790+ case COMPONENT_TYPE_HALF_FLOAT: {
1791+ dict[" max" ] = max;
1792+ dict[" min" ] = min;
1793+ } break ;
1794+ }
17751795 dict[" normalized" ] = normalized;
17761796 dict[" type" ] = _get_accessor_type_name ();
17771797
You can’t perform that action at this time.
0 commit comments