|
|
@ -18,6 +18,28 @@ from bpy.props import * |
|
|
|
from PyHSPlasma import * |
|
|
|
from PyHSPlasma import * |
|
|
|
|
|
|
|
|
|
|
|
from .base import PlasmaModifierProperties |
|
|
|
from .base import PlasmaModifierProperties |
|
|
|
|
|
|
|
from ...exporter import ExportError |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
game_versions = [("pvPrime", "Ages Beyond Myst (63.11)", "Targets the original Uru (Live) game"), |
|
|
|
|
|
|
|
("pvPots", "Path of the Shell (63.12)", "Targets the most recent offline expansion pack"), |
|
|
|
|
|
|
|
("pvMoul", "Myst Online: Uru Live (70)", "Targets the most recent online game")] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class PlasmaVersionedNodeTree(bpy.types.PropertyGroup): |
|
|
|
|
|
|
|
name = StringProperty(name="Name") |
|
|
|
|
|
|
|
version = EnumProperty(name="Version", |
|
|
|
|
|
|
|
description="Plasma versions this node tree exports under", |
|
|
|
|
|
|
|
items=game_versions, |
|
|
|
|
|
|
|
options={"ENUM_FLAG"}, |
|
|
|
|
|
|
|
default=set(list(zip(*game_versions))[0])) |
|
|
|
|
|
|
|
node_tree_name = StringProperty(name="Node Tree", |
|
|
|
|
|
|
|
description="Node Tree to export") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@property |
|
|
|
|
|
|
|
def node_tree(self): |
|
|
|
|
|
|
|
try: |
|
|
|
|
|
|
|
return bpy.data.node_groups[self.node_tree_name] |
|
|
|
|
|
|
|
except KeyError: |
|
|
|
|
|
|
|
raise ExportError("Node Tree {} does not exist!".format(self.node_tree_name)) |
|
|
|
|
|
|
|
|
|
|
|
class PlasmaAdvancedLogic(PlasmaModifierProperties): |
|
|
|
class PlasmaAdvancedLogic(PlasmaModifierProperties): |
|
|
|
pl_id = "advanced_logic" |
|
|
|
pl_id = "advanced_logic" |
|
|
@ -27,19 +49,25 @@ class PlasmaAdvancedLogic(PlasmaModifierProperties): |
|
|
|
bl_description = "Plasma Logic Nodes" |
|
|
|
bl_description = "Plasma Logic Nodes" |
|
|
|
bl_icon = "NODETREE" |
|
|
|
bl_icon = "NODETREE" |
|
|
|
|
|
|
|
|
|
|
|
tree_name = StringProperty(name="Node Tree", description="Plasma Logic Nodes") |
|
|
|
logic_groups = CollectionProperty(type=PlasmaVersionedNodeTree) |
|
|
|
|
|
|
|
active_group_index = IntProperty(options={"HIDDEN"}) |
|
|
|
|
|
|
|
|
|
|
|
def created(self, obj): |
|
|
|
def created(self, obj): |
|
|
|
self.display_name = "Advanced Logic" |
|
|
|
self.display_name = "Advanced Logic" |
|
|
|
|
|
|
|
|
|
|
|
def export(self, exporter, bo, so): |
|
|
|
def export(self, exporter, bo, so): |
|
|
|
tree = bpy.data.node_groups[self.tree_name] |
|
|
|
version = exporter.mgr.getVer() |
|
|
|
tree.export(exporter, bo, so) |
|
|
|
for i in self.logic_groups: |
|
|
|
|
|
|
|
our_versions = [globals()[j] for j in i.version] |
|
|
|
|
|
|
|
if version in our_versions: |
|
|
|
|
|
|
|
i.node_tree.export(exporter, bo, so) |
|
|
|
|
|
|
|
|
|
|
|
@property |
|
|
|
@property |
|
|
|
def requires_actor(self): |
|
|
|
def requires_actor(self): |
|
|
|
tree = bpy.data.node_groups[self.tree_name] |
|
|
|
for i in self.logic_groups: |
|
|
|
return tree.requires_actor |
|
|
|
if i.node_tree.requires_actor: |
|
|
|
|
|
|
|
return True |
|
|
|
|
|
|
|
return False |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class PlasmaSpawnPoint(PlasmaModifierProperties): |
|
|
|
class PlasmaSpawnPoint(PlasmaModifierProperties): |
|
|
|