Browse Source

Clarify camera transitions/cutting

What was previously marked as transition cuts would really only cut goal
and POA tracking. Transition cutting requires the addition of a
transition ovveride. The engine supports cutting transitions on
plCameraMsg receipt by the virtual camera. The option looked sloppy on
regions (and should probably be controlled in the transitions), but it
has been added to camera message nodes for more control.
pull/105/head
Adam Johnson 7 years ago
parent
commit
97305ee3e9
Signed by: Hoikas
GPG Key ID: 0B6515D6FF6F271E
  1. 6
      korman/exporter/camera.py
  2. 5
      korman/nodes/node_messages.py
  3. 3
      korman/properties/modifiers/region.py
  4. 6
      korman/properties/prop_camera.py
  5. 16
      korman/ui/ui_camera.py

6
korman/exporter/camera.py

@ -49,9 +49,11 @@ class CameraConverter:
brain.poaDeceleration = trans_props.poa_deceleration brain.poaDeceleration = trans_props.poa_deceleration
brain.poaVelocity = trans_props.poa_velocity brain.poaVelocity = trans_props.poa_velocity
if trans_props.pos_cut: if isinstance(brain, plCameraBrain1_Avatar):
brain.setFlags(plCameraBrain1.kCutPos, trans_props.pos_cut)
brain.setFlags(plCameraBrain1.kCutPOA, trans_props.poa_cut)
else:
brain.setFlags(plCameraBrain1.kCutPos, True) brain.setFlags(plCameraBrain1.kCutPos, True)
if trans_props.poa_cut:
brain.setFlags(plCameraBrain1.kCutPOA, True) brain.setFlags(plCameraBrain1.kCutPOA, True)
if camera_props.poa_type == "avatar": if camera_props.poa_type == "avatar":
brain.setFlags(plCameraBrain1.kFollowLocalAvatar, True) brain.setFlags(plCameraBrain1.kFollowLocalAvatar, True)

5
korman/nodes/node_messages.py

@ -316,6 +316,9 @@ class PlasmaCameraMsgNode(PlasmaMessageNode, bpy.types.Node):
type=bpy.types.Object, type=bpy.types.Object,
poll=idprops.poll_camera_objects, poll=idprops.poll_camera_objects,
options=set()) options=set())
cut = BoolProperty(name="Cut Transition",
description="Immediately swap over to the new camera without a transition animation",
options=set())
def convert_message(self, exporter, so): def convert_message(self, exporter, so):
msg = plCameraMsg() msg = plCameraMsg()
@ -329,6 +332,7 @@ class PlasmaCameraMsgNode(PlasmaMessageNode, bpy.types.Node):
msg.setCmd(plCameraMsg.kRegionPushCamera, True) msg.setCmd(plCameraMsg.kRegionPushCamera, True)
msg.setCmd(plCameraMsg.kSetAsPrimary, self.camera is None msg.setCmd(plCameraMsg.kSetAsPrimary, self.camera is None
or self.camera.data.plasma_camera.settings.primary_camera) or self.camera.data.plasma_camera.settings.primary_camera)
msg.setCmd(plCameraMsg.kCut, self.cut)
elif self.cmd == "disablefp": elif self.cmd == "disablefp":
msg.setCmd(plCameraMsg.kResponderSetThirdPerson) msg.setCmd(plCameraMsg.kResponderSetThirdPerson)
elif self.cmd == "enablefp": elif self.cmd == "enablefp":
@ -341,6 +345,7 @@ class PlasmaCameraMsgNode(PlasmaMessageNode, bpy.types.Node):
layout.prop(self, "cmd") layout.prop(self, "cmd")
if self.cmd in {"push", "pop"}: if self.cmd in {"push", "pop"}:
layout.prop(self, "camera") layout.prop(self, "camera")
layout.prop(self, "cut")
class PlasmaEnableMsgNode(PlasmaMessageNode, bpy.types.Node): class PlasmaEnableMsgNode(PlasmaMessageNode, bpy.types.Node):

3
korman/properties/modifiers/region.py

@ -107,8 +107,7 @@ class PlasmaCameraRegion(PlasmaModifierProperties):
msg = plCameraMsg() msg = plCameraMsg()
msg.BCastFlags |= plMessage.kLocalPropagate | plMessage.kBCastByType msg.BCastFlags |= plMessage.kLocalPropagate | plMessage.kBCastByType
msg.setCmd(plCameraMsg.kRegionPushCamera) msg.setCmd(plCameraMsg.kRegionPushCamera)
if camera_props.primary_camera: msg.setCmd(plCameraMsg.kSetAsPrimary, camera_props.primary_camera)
msg.setCmd(plCameraMsg.kSetAsPrimary)
msg.newCam = camera_so_key msg.newCam = camera_so_key
region = exporter.mgr.find_create_object(plCameraRegionDetector, so=so) region = exporter.mgr.find_create_object(plCameraRegionDetector, so=so)

6
korman/properties/prop_camera.py

@ -37,7 +37,7 @@ class PlasmaTransition(bpy.types.PropertyGroup):
description="Maximum velocity of the camera's Point of Attention tracking", description="Maximum velocity of the camera's Point of Attention tracking",
min=-100.0, max=100.0, precision=0, default=60.0, min=-100.0, max=100.0, precision=0, default=60.0,
unit="VELOCITY", options=set()) unit="VELOCITY", options=set())
poa_cut = BoolProperty(name="Cut Transition", poa_cut = BoolProperty(name="Cut",
description="The camera immediately begins tracking the Point of Attention", description="The camera immediately begins tracking the Point of Attention",
options=set()) options=set())
@ -53,14 +53,14 @@ class PlasmaTransition(bpy.types.PropertyGroup):
description="Maximum positional velocity of the camera", description="Maximum positional velocity of the camera",
min=-100.0, max=100.0, precision=0, default=60.0, min=-100.0, max=100.0, precision=0, default=60.0,
unit="VELOCITY", options=set()) unit="VELOCITY", options=set())
pos_cut = BoolProperty(name="Cut Transition", pos_cut = BoolProperty(name="Cut",
description="The camera immediately moves to its new position", description="The camera immediately moves to its new position",
options=set()) options=set())
class PlasmaManualTransition(bpy.types.PropertyGroup): class PlasmaManualTransition(bpy.types.PropertyGroup):
camera = PointerProperty(name="Camera", camera = PointerProperty(name="Camera",
description="Camera to transition to", description="The camera from which this transition is intended",
type=bpy.types.Object, type=bpy.types.Object,
poll=idprops.poll_camera_objects, poll=idprops.poll_camera_objects,
options=set()) options=set())

16
korman/ui/ui_camera.py

@ -87,7 +87,9 @@ def draw_camera_poa_props(layout, cam_type, props):
col.prop(trans, "poa_acceleration", text="Acceleration") col.prop(trans, "poa_acceleration", text="Acceleration")
col.prop(trans, "poa_deceleration", text="Deceleration") col.prop(trans, "poa_deceleration", text="Deceleration")
col.prop(trans, "poa_velocity", text="Maximum Velocity") col.prop(trans, "poa_velocity", text="Maximum Velocity")
col.prop(trans, "poa_cut") col = col.column()
col.active = cam_type == "follow"
col.prop(trans, "poa_cut", text="Cut Animation")
# PoA Offset # PoA Offset
col = split.column() col = split.column()
@ -111,7 +113,9 @@ def draw_camera_pos_props(layout, cam_type, props):
alert_cam="rail", max=10.0, text="Deceleration") alert_cam="rail", max=10.0, text="Deceleration")
_draw_alert_prop(col, trans, "pos_velocity", cam_type, _draw_alert_prop(col, trans, "pos_velocity", cam_type,
alert_cam="rail", max=10.0, text="Maximum Velocity") alert_cam="rail", max=10.0, text="Maximum Velocity")
col.prop(trans, "pos_cut") col = col.column()
col.active = cam_type == "follow"
col.prop(trans, "pos_cut", text="Cut Animation")
# Position Offsets # Position Offsets
col = split.column() col = split.column()
@ -222,7 +226,7 @@ class PlasmaCameraViewPanel(CameraButtonsPanel, bpy.types.Panel):
class TransitionListUI(bpy.types.UIList): class TransitionListUI(bpy.types.UIList):
def draw_item(self, context, layout, data, item, icon, active_data, active_property, index=0, flt_flag=0): def draw_item(self, context, layout, data, item, icon, active_data, active_property, index=0, flt_flag=0):
if item.camera is None: if item.camera is None:
layout.label("[Default Camera]") layout.label("[Default Transition]")
else: else:
layout.label(item.camera.name, icon="CAMERA_DATA") layout.label(item.camera.name, icon="CAMERA_DATA")
layout.prop(item, "enabled", text="") layout.prop(item, "enabled", text="")
@ -246,7 +250,7 @@ class PlasmaCameraTransitionPanel(CameraButtonsPanel, bpy.types.Panel):
else: else:
layout.separator() layout.separator()
box = layout.box() box = layout.box()
box.prop(item, "camera") box.prop(item, "camera", text="Transition From")
box.prop(item, "mode") box.prop(item, "mode")
box.separator() box.separator()
@ -258,11 +262,11 @@ class PlasmaCameraTransitionPanel(CameraButtonsPanel, bpy.types.Panel):
col.prop(trans, "poa_acceleration", text="Acceleration") col.prop(trans, "poa_acceleration", text="Acceleration")
col.prop(trans, "poa_deceleration", text="Deceleration") col.prop(trans, "poa_deceleration", text="Deceleration")
col.prop(trans, "poa_velocity", text="Maximum Velocity") col.prop(trans, "poa_velocity", text="Maximum Velocity")
col.prop(trans, "poa_cut") col.prop(trans, "poa_cut", text="Cut Transition")
col = split.column() col = split.column()
col.label("Position Transition:") col.label("Position Transition:")
col.prop(trans, "pos_acceleration", text="Acceleration") col.prop(trans, "pos_acceleration", text="Acceleration")
col.prop(trans, "pos_deceleration", text="Deceleration") col.prop(trans, "pos_deceleration", text="Deceleration")
col.prop(trans, "pos_velocity", text="Maximum Velocity") col.prop(trans, "pos_velocity", text="Maximum Velocity")
col.prop(trans, "pos_cut") col.prop(trans, "pos_cut", text="Cut Transition")

Loading…
Cancel
Save