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)
if key is not None and so is not None:
# 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:
# 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

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)
def get_key(self, exporter, so):
attrib = self.to_socket
if attrib is None:
attrib_socket = self.to_socket
if attrib_socket is None:
self.raise_error("must be connected to a Python File node!")
attrib = attrib.attribute_type
attrib = attrib_socket.attribute_type
bo = self.target_object
if bo is None:
@ -788,7 +788,7 @@ class PlasmaAttribObjectNode(idprops.IDPropObjectMixin, PlasmaAttribNodeBase, bp
if not gui_dialog.enabled:
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.procReceiver = attrib.node.get_key(exporter, so)
dialog_mod.procReceiver = attrib_socket.node.get_key(exporter, so)
return dialog_mod.key
@classmethod

1
korman/properties/modifiers/logic.py

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

Loading…
Cancel
Save