From 97bfc3829344d4843da55490e98de7f51bcee3de Mon Sep 17 00:00:00 2001 From: TikiBear <72320499+TikiBear@users.noreply.github.com> Date: Sat, 3 Oct 2020 14:34:41 -0700 Subject: [PATCH 1/2] Update render.py Add offsets and pivots to the swivel interface. Requires update to UI render.py. --- korman/properties/modifiers/render.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/korman/properties/modifiers/render.py b/korman/properties/modifiers/render.py index 856840c..71418a1 100644 --- a/korman/properties/modifiers/render.py +++ b/korman/properties/modifiers/render.py @@ -513,6 +513,10 @@ class PlasmaViewFaceMod(idprops.IDPropObjectMixin, PlasmaModifierProperties): description="Swivel only around the local Y axis", default=False) + # TikiBear - add the two missing pivots + special_pivots = BoolProperty(name="Special Pivots", + description="Default: 3-axis; With Pivot on local Y: 2-axis, local Y azimuth axis", + default=False) offset = BoolProperty(name="Offset", description="Use offset vector", default=False) offset_local = BoolProperty(name="Local", description="Use local coordinates", default=False) offset_coord = FloatVectorProperty(name="", subtype="XYZ") @@ -547,13 +551,22 @@ class PlasmaViewFaceMod(idprops.IDPropObjectMixin, PlasmaModifierProperties): else: raise ExportError("'{}': Swivel's target object must be selected".format(self.key_name)) - if self.pivot_on_y: - vfm.setFlag(plViewFaceModifier.kPivotY, True) + if self.special_pivots: + # TikiBear - add missing pivots + if self.pivot_on_y: # 2-axis + vfm.setFlag(plViewFaceModifier.kPivotFavorY, True) + else: # 3-axis + vfm.setFlag(plViewFaceModifier.kPivotTumple, True) else: - vfm.setFlag(plViewFaceModifier.kPivotFace, True) + if self.pivot_on_y: + vfm.setFlag(plViewFaceModifier.kPivotY, True) + else: + vfm.setFlag(plViewFaceModifier.kPivotFace, True) if self.offset: vfm.offset = hsVector3(*self.offset_coord) + # TikiBear - add missing flag + vfm.setFlag(plViewFaceModifier.kOffset, True) if self.offset_local: vfm.setFlag(plViewFaceModifier.kOffsetLocal, True) From c7309541fbf77693b4a7cd3755ab47b260dec48e Mon Sep 17 00:00:00 2001 From: TikiBear <72320499+TikiBear@users.noreply.github.com> Date: Sat, 3 Oct 2020 14:52:34 -0700 Subject: [PATCH 2/2] Update render.py Add flag to expose missing pivots to swivel interface. Requires update to the Modifiers render.py. --- korman/ui/modifiers/render.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/korman/ui/modifiers/render.py b/korman/ui/modifiers/render.py index 64d3c9b..723221d 100644 --- a/korman/ui/modifiers/render.py +++ b/korman/ui/modifiers/render.py @@ -191,6 +191,8 @@ def viewfacemod(modifier, layout, context): layout.separator() layout.prop(modifier, "pivot_on_y") + # TikiBear: add special pivot flag + layout.prop(modifier, "special_pivots") layout.separator() split = layout.split()