groverburger / g3d

Simple and easy 3D engine for LÖVE.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issue with :addModel

NyxGames opened this issue · 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)