09th / YABEE

Export models from the Blender to Panda3D game engine
MIT License
107 stars 39 forks source link

All textures are referenced with absolute(!) paths #29

Closed ghost closed 7 years ago

ghost commented 7 years ago

When doing the following (no extra steps in between):

  1. Open blender with new project
  2. CTRL+A to select everything, DEL to delete it to get a truly empty scene
  3. File > Import > .OBJ
  4. Pick an .OBJ file
  5. File > Export > Panda3D (.egg)
  6. Set Texture Processing to "Raw"
  7. Disable "Copy texture files"
  8. Click "Export to Panda3d EGG"

.. I get an .egg file with absolute texture paths. Of course that will horribly break on any player's computer. The original .OBJ has relative paths only (I can open it up in a text editor to check the actual source) and the resulting .egg only has fully absolute paths (again verified by opening it with a text editor).

Since this means that all texture references are useless, is there some good way to avoid this?

rdb commented 7 years ago

If you pick "raw", I think it just copies the paths you have in Blender verbatim. So if your Blender images reference absolute paths, those will be reflected in your .egg file. This is precisely what "raw" mode is designed to do.

To fix this, fix your Blender texture paths to be relative. You can do this by saving your .blend file, hitting Space and typing "relative" and then selecting "Make All Paths Relative".

Arguably it is a bug in the .obj importer that it imports paths as absolute to begin with.

ghost commented 7 years ago

Yea it seems to be either a blender core or .OBJ importer bug... meh