Browse Source

Only create a Textures PRP if it is requested.

pull/381/head
Adam Johnson 1 year ago
parent
commit
705d145114
  1. 14
      korman/exporter/manager.py

14
korman/exporter/manager.py

@ -159,9 +159,14 @@ class ExportManager:
pfm.filename = replace_python2_identifier(age) pfm.filename = replace_python2_identifier(age)
# Textures.prp # Textures.prp
# FIXME: unconditional creation will overwrite any existing textures PRP. This should # TODO: #145 load any already existing Textures PRP and resave it.
# be addressed by a successful implementation of #145. if bpy.context.scene.world.plasma_age.use_texture_page:
self.create_page(age, "Textures", -1, builtin=True) self.create_page(age, "Textures", -1, builtin=True)
elif self.getVer() <= pvPots:
self._exporter().report.warn(
"No textures page was created - be sure this Age has one "
"or the game may crash!"
)
def create_page(self, age, name, id, *, builtin=False, external=False): def create_page(self, age, name, id, *, builtin=False, external=False):
location = plLocation(self.mgr.getVer()) location = plLocation(self.mgr.getVer())
@ -328,10 +333,9 @@ class ExportManager:
def get_textures_page(self, key: plKey) -> plLocation: def get_textures_page(self, key: plKey) -> plLocation:
"""Gets the appropriate page for a texture for a given plLayer""" """Gets the appropriate page for a texture for a given plLayer"""
# The point of this is to account for per-page textures... # The point of this is to account for per-page textures...
if bpy.context.scene.world.plasma_age.use_texture_page: if not bpy.context.scene.world.plasma_age.use_texture_page:
return self._pages["Textures"]
else:
return key.location return key.location
return self._pages.get("Textures", key.location)
def _pack_agesdl_hook(self, age): def _pack_agesdl_hook(self, age):
output = self._exporter().output output = self._exporter().output

Loading…
Cancel
Save