Assimp::Importer::ReadFileFromMemory requires a pointer to the data. The data can be a char[], std::string, std::vector<uint8_t> or similar. Anything that holds raw data in contiguous memory and can provide a pointer to it (I have no idea what a “filearray” is). The pHint parameter should be the file extension; without this the library will have to deduce the format from the data, which typically requires that the format starts with some kind of signature.
Reading from memory is for when you have already loaded some file directly into memory and you want the library to parse and understand it. The “correct input” would be a pointer to where that data starts and the number of bytes in it.
i’m trying to write a simple c++ block of code , to import the file into a buffer and then pass the buffer to this method .
but i have difficulty to understand how to manage the c++ code .
can you provide me with some example or at least where i should look for an answer ?
for example i don’t understand the meaning of this error coming from assimp loader
Model (my_file) failed get loaded: File is too small
I don’t understand it either, because you didn’t provide the code/data that generated it. Without knowing what you did, the error message is without meaning.
in the same file , inside the main function make an object of the readFile function and give the model file as input to it
put the data and length of the buffer in 2 variables