Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Linking Book Mod share function #335

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 24 additions & 2 deletions korman/properties/modifiers/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,12 +429,20 @@ 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",
type=bpy.types.Object,
poll=idprops.poll_mesh_objects)
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",
description="Forces the camera into third person while Book is in use",
default=False,
options=set())

# -- Path of the Shell options --
# Popup Appearance
Expand Down Expand Up @@ -482,7 +490,11 @@ def pre_export(self, exporter, bo):
else:
rgn_obj = self.clickable_region

if self.shareable:
@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.
Expand Down Expand Up @@ -680,6 +692,16 @@ 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")
if not self.drc_stamp:
stamped.value = False
forcecam = nodes.new("PlasmaAttribBoolNode")
forcecam.link_output(linkingnode, "pfm", "ForceThirdPerson")
if self.third_person:
forcecam.value = True

Comment on lines +695 to +704
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm thinking we should defer these changes to another PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree.

def sanity_check(self):
if self.clickable is None:
raise ExportError("{}: Linking Book modifier requires a clickable!", self.id_data.name)
Expand Down
12 changes: 7 additions & 5 deletions korman/ui/modifiers/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down