From 9ffe18188bb1d2ba5a765d304a49d57dd3c10477 Mon Sep 17 00:00:00 2001 From: Patrick Dulebohn Date: Sat, 25 Jun 2022 10:11:30 -0400 Subject: [PATCH 1/5] More sharing sanity checks Sets the default of the share to false as the default along with an extra check before making a share region. This keeps extra, unneeded share regions from being added. --- korman/properties/modifiers/gui.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/korman/properties/modifiers/gui.py b/korman/properties/modifiers/gui.py index cefeef5f..4eefec28 100644 --- a/korman/properties/modifiers/gui.py +++ b/korman/properties/modifiers/gui.py @@ -429,7 +429,7 @@ class PlasmaLinkingBookModifier(PlasmaModifierProperties, PlasmaModifierLogicWiz poll=idprops.poll_mesh_objects) shareable = BoolProperty(name="Shareable", description="Enable the Book to be Shareable (MOUL private instance only)", - default=True, + default=False, options=set()) share_region = PointerProperty(name="Share Region", description="Sets the share region in which the receiving avatar must stand", @@ -482,7 +482,7 @@ def pre_export(self, exporter, bo): else: rgn_obj = self.clickable_region - if self.shareable: + if self.shareable and self.link_type == "kOriginalBook": if self.share_region is None: with utils.bmesh_object("{}_LinkingBook_ShareRgn".format(self.key_name)) as (share_region, bm): # Generate a cube for the share region. From 25ebf581cdbc31b55bd955a574eb39a4c34f9797 Mon Sep 17 00:00:00 2001 From: Patrick Dulebohn Date: Tue, 28 Jun 2022 16:02:04 -0400 Subject: [PATCH 2/5] Add DRC Stamp and Third Person Cam Functions to GUI Adds bool values for the stamp and third person cam portions of the xLinkingBookGUIPopup.py parts of the script (MOUL only) --- korman/properties/modifiers/gui.py | 16 ++++++++++++++++ korman/ui/modifiers/gui.py | 12 +++++++----- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/korman/properties/modifiers/gui.py b/korman/properties/modifiers/gui.py index 4eefec28..2950226f 100644 --- a/korman/properties/modifiers/gui.py +++ b/korman/properties/modifiers/gui.py @@ -435,6 +435,14 @@ class PlasmaLinkingBookModifier(PlasmaModifierProperties, PlasmaModifierLogicWiz description="Sets the share region in which the receiving avatar must stand", type=bpy.types.Object, poll=idprops.poll_mesh_objects) + drc_stamp = BoolProperty(name="DRC Stamped", + description="Did the DRC stamp this book?", + default=False, + options=set()) + third_person = BoolProperty(name="Force Third Person", + description="Forces the camera into third person while Book is in use", + default=False, + options=set()) # -- Path of the Shell options -- # Popup Appearance @@ -680,6 +688,14 @@ def _create_moul_nodes(self, clickable_object, nodes, linkingnode, age_name, clk share.link_input(share_anim_stage, "stage", "stage_refs") share.link_output(linkingnode, "hosts", "shareBookSeek") + # Odds and Ends + stamped = nodes.new("PlasmaAttribBoolNode") + stamped.link_output(linkingnode, "pfm", "IsDRCStamped") + stamped.value = self.drc_stamp + forcecam = nodes.new("PlasmaAttribBoolNode") + forcecam.link_output(linkingnode, "pfm", "ForceThirdPerson") + forcecam.value = self.third_person + def sanity_check(self): if self.clickable is None: raise ExportError("{}: Linking Book modifier requires a clickable!", self.id_data.name) diff --git a/korman/ui/modifiers/gui.py b/korman/ui/modifiers/gui.py index cf462c3d..e16cad16 100644 --- a/korman/ui/modifiers/gui.py +++ b/korman/ui/modifiers/gui.py @@ -95,15 +95,17 @@ def row_alert(prop_name, **kwargs): row_alert("age_name") - if "pvMoul" in modifier.versions and modifier.link_type == "kOriginalBook": - layout.separator() - layout.prop(modifier, "shareable") - layout.prop(modifier, "share_region") - if "pvMoul" in modifier.versions: + if modifier.link_type == "kOriginalBook": + layout.separator() + layout.prop(modifier, "shareable") + if modifier.shareable: + layout.prop(modifier, "share_region") layout.separator() layout.prop(modifier, "link_destination") layout.prop(modifier, "spawn_title") + layout.prop(modifier, "drc_stamp") + layout.prop(modifier, "third_person") layout.prop(modifier, "spawn_point") if "pvPots" in modifier.versions: From 357bd8c2c3ce82926f88171f786825788df5357c Mon Sep 17 00:00:00 2001 From: Patrick Dulebohn Date: Tue, 28 Jun 2022 21:13:02 -0400 Subject: [PATCH 3/5] Adjust some conditions Make the new bool nodes actually work when selected --- korman/properties/modifiers/gui.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/korman/properties/modifiers/gui.py b/korman/properties/modifiers/gui.py index 2950226f..c0ab5db9 100644 --- a/korman/properties/modifiers/gui.py +++ b/korman/properties/modifiers/gui.py @@ -691,10 +691,12 @@ def _create_moul_nodes(self, clickable_object, nodes, linkingnode, age_name, clk # Odds and Ends stamped = nodes.new("PlasmaAttribBoolNode") stamped.link_output(linkingnode, "pfm", "IsDRCStamped") - stamped.value = self.drc_stamp + if not self.drc_stamp: + stamped.value = False forcecam = nodes.new("PlasmaAttribBoolNode") forcecam.link_output(linkingnode, "pfm", "ForceThirdPerson") - forcecam.value = self.third_person + if self.third_person: + forcecam.value = True def sanity_check(self): if self.clickable is None: From 9a0cae368455104f860fc266ef44cd8286a67f62 Mon Sep 17 00:00:00 2001 From: Patrick Dulebohn Date: Fri, 1 Jul 2022 16:34:30 -0400 Subject: [PATCH 4/5] Update Stamped description Updated the stamped property to better reflect its purpose (it's for any stamp on the left page, not just the DRC) --- korman/properties/modifiers/gui.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/korman/properties/modifiers/gui.py b/korman/properties/modifiers/gui.py index c0ab5db9..d41d1bd2 100644 --- a/korman/properties/modifiers/gui.py +++ b/korman/properties/modifiers/gui.py @@ -435,8 +435,8 @@ class PlasmaLinkingBookModifier(PlasmaModifierProperties, PlasmaModifierLogicWiz description="Sets the share region in which the receiving avatar must stand", type=bpy.types.Object, poll=idprops.poll_mesh_objects) - drc_stamp = BoolProperty(name="DRC Stamped", - description="Did the DRC stamp this book?", + drc_stamp = BoolProperty(name="Stamped", + description="Is there a stamp on the left page of this Book?", default=False, options=set()) third_person = BoolProperty(name="Force Third Person", From c76f395414d3d1c1a21d1b6968672742788f2748 Mon Sep 17 00:00:00 2001 From: Patrick Dulebohn Date: Fri, 1 Jul 2022 16:38:26 -0400 Subject: [PATCH 5/5] Add share property Add new @property per Hoikas' suggestion --- korman/properties/modifiers/gui.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/korman/properties/modifiers/gui.py b/korman/properties/modifiers/gui.py index d41d1bd2..966280a7 100644 --- a/korman/properties/modifiers/gui.py +++ b/korman/properties/modifiers/gui.py @@ -490,7 +490,11 @@ def pre_export(self, exporter, bo): else: rgn_obj = self.clickable_region - if self.shareable and self.link_type == "kOriginalBook": + @property + def export_share_region(self) -> bool: + return self.shareable and self.link_type == "kOriginalBook" + + if self.export_share_region: if self.share_region is None: with utils.bmesh_object("{}_LinkingBook_ShareRgn".format(self.key_name)) as (share_region, bm): # Generate a cube for the share region.