Browse Source

Add Share Function to Linking Book Mod

Adds a "Shareable" toggle to Linking Book Mod when Link Type is set to Private Link (MOUL only).
pull/317/head
Patrick Dulebohn 3 years ago
parent
commit
f335639b45
  1. 29
      korman/properties/modifiers/gui.py
  2. 2
      korman/ui/modifiers/gui.py

29
korman/properties/modifiers/gui.py

@ -427,6 +427,10 @@ class PlasmaLinkingBookModifier(PlasmaModifierProperties, PlasmaModifierLogicWiz
description="The object the avatar will click on to activate the Linking Book GUI", description="The object the avatar will click on to activate the Linking Book GUI",
type=bpy.types.Object, type=bpy.types.Object,
poll=idprops.poll_mesh_objects) poll=idprops.poll_mesh_objects)
shareable = BoolProperty(name="Shareable",
description="Enable the Book to be Shareable (MOUL private instance only)",
default=False,
options=set())
# -- Path of the Shell options -- # -- Path of the Shell options --
# Popup Appearance # Popup Appearance
@ -633,6 +637,31 @@ class PlasmaLinkingBookModifier(PlasmaModifierProperties, PlasmaModifierLogicWiz
linking_panel_name.value = self.link_destination if self.link_destination else self.age_name linking_panel_name.value = self.link_destination if self.link_destination else self.age_name
linking_panel_name.link_output(linkingnode, "pfm", "TargetAge") linking_panel_name.link_output(linkingnode, "pfm", "TargetAge")
# Share MSB
if self.shareable:
# Region
share_region = nodes.new("PlasmaVolumeSensorNode")
share_region.region_object = clk_region
share_region.bounds = "hull"
for i in share_region.inputs:
i.allow = True
share_region.link_output(linkingnode, "satisfies", "shareRegion")
# MSB Behavior
share_seek = nodes.new("PlasmaSeekTargetNode")
share_seek.target = self.seek_point
share_anim_stage = nodes.new("PlasmaAnimStageNode")
share_anim_stage.anim_name = "LinkOut"
share_anim_settings = nodes.new("PlasmaAnimStageSettingsNode")
share_anim_settings.forward = "kPlayAuto"
share_anim_settings.stage_advance = "kAdvanceAuto"
share_anim_stage.link_input(share_anim_settings, "stage", "stage_settings")
share = nodes.new("PlasmaMultiStageBehaviorNode")
share.link_input(share_seek, "seekers", "seek_target")
share.link_input(share_anim_stage, "stage", "stage_refs")
share.link_output(linkingnode, "hosts", "shareBookSeek")
def sanity_check(self): def sanity_check(self):
if self.clickable is None: if self.clickable is None:
raise ExportError("{}: Linking Book modifier requires a clickable!", self.id_data.name) raise ExportError("{}: Linking Book modifier requires a clickable!", self.id_data.name)

2
korman/ui/modifiers/gui.py

@ -88,6 +88,8 @@ def linkingbookmod(modifier, layout, context):
layout.separator() layout.separator()
layout.prop(modifier, "link_type") layout.prop(modifier, "link_type")
if modifier.link_type == "kOriginalBook":
layout.prop(modifier, "shareable")
row_alert("age_instance") row_alert("age_instance")
if modifier.link_type == "kChildAgeBook": if modifier.link_type == "kChildAgeBook":
row_alert("age_parent") row_alert("age_parent")

Loading…
Cancel
Save