How to convert from .obj to .egg

I’m attempting to convert a .obj file to a .egg. Python’s obj2egg doesn’t work with textures and I’m running into issues with treeform’s converter. Has anyone done this recently?

If you want to upload your file to the Panda3d engine, you do not need to
convect the file egg. You can use assimp library.

from panda3d.core import *
from direct.showbase.ShowBase import ShowBase

loadPrcFileData("", "load-file-type p3assimp")

class MyApp(ShowBase):

    def __init__(self):

        ShowBase.__init__(self)

        model = self.loader.load_model("untitled.obj", )
        model.reparent_to(self.render)

app = MyApp()
app.run()

Wonderful! It was taking a simple model years to render but it rendered instantly after I added model.ls(). Thank you :smiley:

It is not necessary, forgot to remove. :grinning:
And as far as I remember, the panda without Assimp is supporting obj.

Ahh you’re right it is unnecessary, I guess it only takes a long time when it’s rendering it for the first time

I come up with a “OSError: Could not load file” message. (I’m on macOS Big Sur) does this method still work?

There may be a problem with the wrong file path. Make sure that you have specified the path correctly.