Fix passing of file extension string.

Previously only the first letter of the string was passed to c, now it passes the whole extension.
pull/5164/head
Marco Feuerstein 2023-06-29 14:51:16 +02:00
parent 03934128fc
commit d1edaa949b
1 changed files with 2 additions and 1 deletions

View File

@ -311,6 +311,7 @@ def load(filename,
Scene object with model data Scene object with model data
''' '''
from ctypes import c_char_p
if hasattr(filename, 'read'): if hasattr(filename, 'read'):
# This is the case where a file object has been passed to load. # This is the case where a file object has been passed to load.
# It is calling the following function: # It is calling the following function:
@ -324,7 +325,7 @@ def load(filename,
model = _assimp_lib.load_mem(data, model = _assimp_lib.load_mem(data,
len(data), len(data),
processing, processing,
file_type) c_char_p(file_type.encode(sys.getfilesystemencoding())))
else: else:
# a filename string has been passed # a filename string has been passed
model = _assimp_lib.load(filename.encode(sys.getfilesystemencoding()), processing) model = _assimp_lib.load(filename.encode(sys.getfilesystemencoding()), processing)