Files
soundobjects_blender_addon/operator_protools_export.py
Jamie Hardt d4ad426378 Implementation experiments
I seem to be stuck, Pro Tools isn't letting me write pan automation with
the message "Command Error: ErrType 126: PT_InvalidParameter (Invalid pan
control ID - incompatible pan space/parameter/channel values?)"
2025-11-07 21:53:53 -08:00

43 lines
1.3 KiB
Python

import bpy
from .intern import pro_tools
def filter_speakers(objs: list[bpy.types.Object]) -> list[bpy.types.Object]:
return [s for s in objs if s.type == 'SPEAKER']
class SendToProTools(bpy.types.Operator):
"Send Audio Objects to Pro Tools"
bl_idname = "object.pro_tools_live"
bl_label = "Send Audio Objects to Pro Tools"
room_size: bpy.props.FloatProperty(
name="Room Size",
description="Distance from the lens to the front room boundary",
default=1.0,
min=0.001,
step=1,
unit='LENGTH'
)
@classmethod
def poll(cls, context):
return len(filter_speakers(context.selected_objects)) > 0 and \
bpy.app.online_access and \
context.scene.camera is not None
def invoke(self, context, event):
wm = context.window_manager
return wm.invoke_props_dialog(self, confirm_text="Send to Pro Tools")
def execute(self, context) -> set:
print("Execute called...")
if pro_tools.send_to_pro_tools(
filter_speakers(context.selected_objects),
self.room_size):
self.report({'INFO'}, "Speaker objects sent to Pro Tools")
return {'FINISHED'}
else:
self.report({'ERROR'}, "Could not connect to Pro Tools")
return {'FINISHED'}