Browse Source

Allow version specific pages

This allows the artist to set specific export versions for PRPs,
enabling game version specific age features.
pull/112/head
Adam Johnson 6 years ago
parent
commit
731e65d1c2
Signed by: Hoikas
GPG Key ID: 0B6515D6FF6F271E
  1. 7
      korman/exporter/convert.py
  2. 5
      korman/properties/prop_world.py
  3. 1
      korman/ui/ui_world.py

7
korman/exporter/convert.py

@ -119,8 +119,8 @@ class Exporter:
# Grab a naive listing of enabled pages
age = scene.world.plasma_age
pages_enabled = frozenset([page.name for page in age.pages if page.enabled])
all_pages = frozenset([page.name for page in age.pages])
pages_enabled = frozenset((page.name for page in age.pages if page.enabled and self._op.version in page.version))
all_pages = frozenset((page.name for page in age.pages))
# Because we can have an unnamed or a named default page, we need to see if that is enabled...
for page in age.pages:
@ -164,8 +164,9 @@ class Exporter:
mgr.AddAge(age_info.export(self))
# Create all the pages we need
ver = self._op.version
for page in age_info.pages:
if page.enabled:
if page.enabled and ver in page.version:
mgr.create_page(age_name, page.name, page.seq_suffix)
mgr.create_builtins(age_name, age_info.use_texture_page)

5
korman/properties/prop_world.py

@ -146,6 +146,11 @@ class PlasmaPage(bpy.types.PropertyGroup):
enabled = BoolProperty(name="Export Page",
description="Export this page",
default=True)
version = EnumProperty(name="Export Versions",
description="Plasma versions this page exports under",
items=game_versions,
options={"ENUM_FLAG"},
default=set(list(zip(*game_versions))[0]))
# Implementation details...
last_name = StringProperty(description="INTERNAL: Cached page name",

1
korman/ui/ui_world.py

@ -110,6 +110,7 @@ class PlasmaAgePanel(AgeButtonsPanel, bpy.types.Panel):
col.label("Page Info:")
col.prop(active_page, "name", text="")
col.prop(active_page, "seq_suffix")
col.prop_menu_enum(active_page, "version")
# Core settings
layout.separator()

Loading…
Cancel
Save