I'm working on a batch loader for 3D models. Currently my code works by being pointed at a folder and iterating through every .obj model it finds. The obj are names in the syntax of "animation name + animation frame",
currently... When an obj is identified, the filename is parsed, and if it is the first occurrence of a particular name, for example, "run", it uses
variable_instance_set(id, model_name, ds_grid_create(3,1));
array_push(animations_list,variable_instance_get(id, model_name));
To create a DS grid to store the frames of animations for later processing, then pushes the grid reference into an array so it can be looked up.
Now... For debugging purposes the problem i'm running into, is if I try to generate a debug message for string(animations_list[0]) I get "ref ds_grid 1" as output, and if I use nameof instead of string I get "animations_list[0]".
Is there a way I can retrieve the string I used to initialize the ds_grid with?
All relevant code below
animations_list=[];
show_debug_message("path: "+path);
var model = file_find_first(path+"*.obj",fa_none);
var string_store;
var model_name;
var animation_number;
while(model!="")
{
string_store=sanitize_model_string(model);
model_name=string_letters(string_store);
animation_number=real(string_digits(string_store));
if (!variable_instance_exists(id, model_name))
{
variable_instance_set(id, model_name, ds_grid_create(3,1));
array_push(animations_list,variable_instance_get(id, model_name));
ds_grid_set(variable_instance_get(id,model_name),0,0,model_name);
ds_grid_set(variable_instance_get(id,model_name),1,0,animation_number);
ds_grid_set(variable_instance_get(id,model_name),2,0,model);
}
else
{
ds_grid_resize(variable_instance_get(id,model_name),3,ds_grid_height(variable_instance_get(id,model_name))+1);
ds_grid_set(variable_instance_get(id,model_name),0,ds_grid_height(variable_instance_get(id,model_name))-1,model_name);
ds_grid_set(variable_instance_get(id,model_name),1,ds_grid_height(variable_instance_get(id,model_name))-1,animation_number);
ds_grid_set(variable_instance_get(id,model_name),2,ds_grid_height(variable_instance_get(id,model_name))-1,model);
}
model=file_find_next();
}