Browse Source

Store Layer keys, not objects...

pull/8/head
Adam Johnson 10 years ago
parent
commit
ecc5bf277d
  1. 4
      korman/exporter/manager.py
  2. 8
      korman/exporter/material.py

4
korman/exporter/manager.py

@ -200,13 +200,13 @@ class ExportManager:
location = self._pages[bl.plasma_object.page]
return self._nodes[location].key
def get_textures_page(self, layer):
def get_textures_page(self, key):
"""Gets the appropriate page for a texture for a given plLayer"""
# The point of this is to account for per-page textures...
if "Textures" in self._pages:
return self._pages["Textures"]
else:
return layer.key.location
return key.location
def has_coordiface(self, bo):
if bo.type in {"CAMERA", "EMPTY", "LAMP"}:

8
korman/exporter/material.py

@ -352,10 +352,10 @@ class MaterialConverter:
key = _Texture(texture=texture, use_alpha=has_alpha)
if key not in self._pending:
print(" Stashing '{}' for conversion as '{}'".format(texture.image.name, str(key)))
self._pending[key] = [layer,]
self._pending[key] = [layer.key,]
else:
print(" Found another user of '{}'".format(texture.image.name))
self._pending[key].append(layer)
self._pending[key].append(layer.key)
def _export_texture_type_none(self, bo, hsgmat, layer, texture):
# We'll allow this, just for sanity's sake...
@ -431,7 +431,7 @@ class MaterialConverter:
print(" Adding to Layer(s)")
for layer in layers:
print(" {}".format(layer.key.name))
print(" {}".format(layer.name))
page = mgr.get_textures_page(layer) # Layer's page or Textures.prp
# If we haven't created this plMipmap in the page (either layer's page or Textures.prp),
@ -447,7 +447,7 @@ class MaterialConverter:
pages[page] = mipmap
else:
mipmap = pages[page]
layer.texture = mipmap.key
layer.object.texture = mipmap.key
def get_materials(self, bo):
return self._obj2mat[bo]

Loading…
Cancel
Save