groverburger/g3d

Issue with :addModel

NyxGames opened this issue · 1 comments

Having issues with the :addModel function. I call Scene:addModel() previously, multiple times, and it works perfectly fine, but now I'm getting the error: ss3d/engine.lua:255: attempt to call field 'insert' (a nil value)

The code is called from
print(pathModel) Scene:addModel(pathModel)

It prints "table: xxxxxx", but then gives me the error on the next line

It seems the Scene:addModel() function does not accept paths. Try to load the model into the correct lua table structure first, the Engine supplies functions for the commonly used .obj file format.

An example from where the url "assets/alakazam.obj" gets loaded into the scene:

AlakazamModel = Engine.newModel(Engine.loadObj("assets/alakazam.obj"), DefaultTexture)
Scene:addModel(AlakazamModel)