@@ -3209,16 +3209,20 @@ void GLTFDocument::_set_texture_transform_uv1(const Dictionary &p_dict, Ref<Base
32093209 if (extensions.has (" KHR_texture_transform" )) {
32103210 if (p_material.is_valid ()) {
32113211 const Dictionary &texture_transform = extensions[" KHR_texture_transform" ];
3212- const Array &offset_arr = texture_transform[" offset" ];
3213- if (offset_arr.size () == 2 ) {
3214- const Vector3 offset_vector3 = Vector3 (offset_arr[0 ], offset_arr[1 ], 0 .0f );
3215- p_material->set_uv1_offset (offset_vector3);
3212+ if (texture_transform.has (" offset" )) {
3213+ const Array offset_arr = texture_transform[" offset" ];
3214+ if (offset_arr.size () == 2 ) {
3215+ const Vector3 offset_vector3 = Vector3 (offset_arr[0 ], offset_arr[1 ], 0 .0f );
3216+ p_material->set_uv1_offset (offset_vector3);
3217+ }
32163218 }
32173219
3218- const Array &scale_arr = texture_transform[" scale" ];
3219- if (scale_arr.size () == 2 ) {
3220- const Vector3 scale_vector3 = Vector3 (scale_arr[0 ], scale_arr[1 ], 1 .0f );
3221- p_material->set_uv1_scale (scale_vector3);
3220+ if (texture_transform.has (" scale" )) {
3221+ const Array scale_arr = texture_transform[" scale" ];
3222+ if (scale_arr.size () == 2 ) {
3223+ const Vector3 scale_vector3 = Vector3 (scale_arr[0 ], scale_arr[1 ], 1 .0f );
3224+ p_material->set_uv1_scale (scale_vector3);
3225+ }
32223226 }
32233227 }
32243228 }
0 commit comments