Browse Source

Support PythonFileMod GUI dialog procs

Co-authored-by: Adam Johnson <AdamJohnso@gmail.com>
pull/416/head
Darryl Pogue 5 months ago
parent
commit
3b7ddcb3bf
No known key found for this signature in database
GPG Key ID: CB824715C3E6FD41
  1. 2
      korman/exporter/manager.py
  2. 8
      korman/nodes/node_python.py
  3. 1
      korman/properties/modifiers/logic.py

2
korman/exporter/manager.py

@ -256,7 +256,7 @@ class ExportManager:
key = self._keys.get((location, pClass, name), None) key = self._keys.get((location, pClass, name), None)
if key is not None and so is not None: if key is not None and so is not None:
# Purposefully not checking for plObjInterface -- they should never be shared. # Purposefully not checking for plObjInterface -- they should never be shared.
if issubclass(pClass, plModifier): if issubclass(pClass, plModifier) and plFactory.ClassIndex(pClass.__name__) not in _pool_types:
if key not in so.modifiers: if key not in so.modifiers:
# We really shouldn't add plSingleModifiers to multiple objects. This may # We really shouldn't add plSingleModifiers to multiple objects. This may
# potentially cause URU to crash. I'm uncertain though, so we'll just warn # potentially cause URU to crash. I'm uncertain though, so we'll just warn

8
korman/nodes/node_python.py

@ -751,10 +751,10 @@ class PlasmaAttribObjectNode(idprops.IDPropObjectMixin, PlasmaAttribNodeBase, bp
layout.prop(self, "target_object", text=self.attribute_name) layout.prop(self, "target_object", text=self.attribute_name)
def get_key(self, exporter, so): def get_key(self, exporter, so):
attrib = self.to_socket attrib_socket = self.to_socket
if attrib is None: if attrib_socket is None:
self.raise_error("must be connected to a Python File node!") self.raise_error("must be connected to a Python File node!")
attrib = attrib.attribute_type attrib = attrib_socket.attribute_type
bo = self.target_object bo = self.target_object
if bo is None: if bo is None:
@ -788,7 +788,7 @@ class PlasmaAttribObjectNode(idprops.IDPropObjectMixin, PlasmaAttribNodeBase, bp
if not gui_dialog.enabled: if not gui_dialog.enabled:
self.raise_error(f"GUI Dialog modifier not enabled on '{self.object_name}'") self.raise_error(f"GUI Dialog modifier not enabled on '{self.object_name}'")
dialog_mod = exporter.mgr.find_create_object(pfGUIDialogMod, so=ref_so, bl=bo) dialog_mod = exporter.mgr.find_create_object(pfGUIDialogMod, so=ref_so, bl=bo)
dialog_mod.procReceiver = attrib.node.get_key(exporter, so) dialog_mod.procReceiver = attrib_socket.node.get_key(exporter, so)
return dialog_mod.key return dialog_mod.key
@classmethod @classmethod

1
korman/properties/modifiers/logic.py

@ -57,6 +57,7 @@ class PlasmaVersionedNodeTree(idprops.IDPropMixin, bpy.types.PropertyGroup):
class PlasmaAdvancedLogic(PlasmaModifierProperties): class PlasmaAdvancedLogic(PlasmaModifierProperties):
pl_id = "advanced_logic" pl_id = "advanced_logic"
pl_page_types = {"gui", "room"}
bl_category = "Logic" bl_category = "Logic"
bl_label = "Advanced" bl_label = "Advanced"

Loading…
Cancel
Save