09th / YABEE

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

uv-map export problems #18

Closed derselbst closed 9 years ago

derselbst commented 9 years ago

Hi,

there seem to be some issues with UV-Map export. When a uv-name is exported that contains space(s), panda's egg parser throws a syntax error. You may want to try yourself by exporting the windows of the castle using this blend file: http://blenderartists.org/forum/showthread.php?353711-Princess-Peach-Castle-Demo&p=2758299&viewfull=1#post2758299

Another issue occurs when there are multiple uv-maps specified for the same object. You should see what I mean when exporting the castle or the terrain.

Yabee at rev. 4493206b987e3813862c924aab339e4a67e232d7 Blender 2.74

09th commented 9 years ago

Hi I pushed two fixes. Pls try it.

derselbst commented 9 years ago

ok, so far so good. blender 2.74 randomly crashes when exporting, although i didnt experienced any problems with 2.69. probably a blender issue.

However: try to export the castle. open it in pview. you should see its (nearly) black. why? the default uv-map of it is "CastleAtlas", since its default, no name is given in the egg file. yet its texture "CastleAtlas_lit.jpg" specifies it by name.

09th commented 9 years ago

Ok. Another fix pushed.

Also, specular texture In this model is used by unusual way, which is not supported. If you whish to get more or less correct result, you should edit exported egg file:

  1. Replace envtype of the specular texture to GLOSS or MODULATE_GLOSS
  2. Add the alpha file entry for the specular texture: alpha-file { "./same/file/as/your/specular/texture.jpg" } in result you'll have something like
...

<Texture> Texture.007 {
  "./textures/CastleAtlas_spec2.jpg"
  <Scalar> alpha-file { "./textures/CastleAtlas_spec2.jpg" }
  <Scalar> envtype { GLOSS }
  <Scalar> minfilter { LINEAR_MIPMAP_LINEAR }
  <Scalar> magfilter { LINEAR_MIPMAP_LINEAR }
  <Scalar> wrap { REPEAT }
}

...

And keep in mind that GLOSS envtype requires autoshaders

As for crashes: seems that packed textures is too large to export automatically, try to disable "copy texture files" flag in the export options, and then unpack textures manually.