Closed francoisruty closed 5 years ago
Think that is fixed in master already, but I'll take a look just in case.
cool, many thanks! Do you know when will the next release come out?
Hopefully today. Worst case tomorow. I'll close this issue when the release is out
This looks suspicious. That method is not a static or classmethod. I'm guessing /input/uv.obj
will be interpreted as the self
argument while the path
argument is not properly set.
model = WindowConfig.load_scene("/input/uv.obj")
If you don't use a WindowConfig
instance you need to go thought the resources module. I'm still working on docs for that.
from moderngl_window import resources
from moderngl_window.meta import SceneDescription
scene = resources.scenes.load(SceneDescription(path='scenes/crate.obj'))
The load_scene
implementation in WindowConfig
is probably also a good reference.
If you created your own window and context, also make sure you register it.
moderngl_window.activate_context(ctx=my_moderngl_contect)
And of course also register a search path for your resources
from moderngl_window import resources
resources.register_dir('this/is/where/my/data/is')
resources.register_dir('another/location')
.. because all paths sent to the resource system are relative to one or multiple search paths.
Thanks, so here is what happened.
I was trying to get the example in https://github.com/moderngl/moderngl/blob/master/examples/loading_obj_files.py working. I'm working on a test script so I didn't want the multiple imbricated classes, that's why I didn't have the self argument.
The problem was indeed that:
Many thanks for your help!
Awsome. Will be more docs very soon. That is pretty much pri 1 at the moment 😄
Finally added a section about it here : https://moderngl-window.readthedocs.io/en/latest/guide/custom_usage.html
Be free to yell if you see improvements.