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