Browse Source

Merge pull request #112 from Hoikas/page-version

Allow version specific pages
pull/113/head
Adam Johnson 6 years ago committed by GitHub
parent
commit
a7c6a3d07f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  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