@@ -804,6 +804,8 @@ bool GltfImporter::Load(
804
804
805
805
if (joint_indices->component_type == cgltf_component_type_r_8u)
806
806
{
807
+ if (!jointStride) jointStride = sizeof (uint8_t ) * 4 ;
808
+
807
809
for (size_t v_idx = 0 ; v_idx < joint_indices->count ; v_idx++)
808
810
{
809
811
*jointDst = dm::vector<uint16_t , 4 >(jointSrc[0 ], jointSrc[1 ], jointSrc[2 ], jointSrc[3 ]);
@@ -815,6 +817,9 @@ bool GltfImporter::Load(
815
817
else
816
818
{
817
819
assert (joint_indices->component_type == cgltf_component_type_r_16u);
820
+
821
+ if (!jointStride) jointStride = sizeof (uint16_t ) * 4 ;
822
+
818
823
for (size_t v_idx = 0 ; v_idx < joint_indices->count ; v_idx++)
819
824
{
820
825
const uint16_t * jointSrcUshort = (const uint16_t *)jointSrc;
@@ -837,6 +842,8 @@ bool GltfImporter::Load(
837
842
838
843
if (joint_weights->component_type == cgltf_component_type_r_8u)
839
844
{
845
+ if (!weightStride) weightStride = sizeof (uint8_t ) * 4 ;
846
+
840
847
for (size_t v_idx = 0 ; v_idx < joint_indices->count ; v_idx++)
841
848
{
842
849
*weightDst = dm::float4 (
@@ -851,6 +858,8 @@ bool GltfImporter::Load(
851
858
}
852
859
else if (joint_weights->component_type == cgltf_component_type_r_16u)
853
860
{
861
+ if (!weightStride) weightStride = sizeof (uint16_t ) * 4 ;
862
+
854
863
for (size_t v_idx = 0 ; v_idx < joint_indices->count ; v_idx++)
855
864
{
856
865
const uint16_t * weightSrcUshort = (const uint16_t *)weightSrc;
@@ -867,6 +876,9 @@ bool GltfImporter::Load(
867
876
else
868
877
{
869
878
assert (joint_weights->component_type == cgltf_component_type_r_32f);
879
+
880
+ if (!weightStride) weightStride = sizeof (float ) * 4 ;
881
+
870
882
for (size_t v_idx = 0 ; v_idx < joint_indices->count ; v_idx++)
871
883
{
872
884
*weightDst = (const float *)weightSrc;
0 commit comments