QLab通过脚本校准投影映射面
QLab通过脚本校准投影映射面 此脚本来自QLab论坛 原贴是一位网友求助:
我正在制作一个节目,我使用许多视频面将行星视频投影到舞台上的各种泡沫球体(尺寸在 40~90 厘米之间)。我正在寻找一种简单的方法来在演出前校准所有表面以精确投影,因为球体的位置可能会有几厘米的变化。有没有比编辑每个表面更简单的方法,例如通过一个脚本来调整每个表面的原点参数,通过按键(向上、向下、向左)轻推它们?
作者micpool回复:主要的障碍是你不能得到当前的表面原点,因为没有脚本钩子,所以无法使用OSC查询来返回这个属性。但是,可以手动将表面ID和表面原点的当前设置输入到用于存储变量的虚拟文本提示中,如下所示:
原点X存储在翻译X中
翻译Y中的原点Y
文本中的表面ID
按比例微调量X
使用此方法,可以在每个表面使用4个脚本用于上下左右调整,也可以通过热键触发。
--nudge DOWN Surface 1
set theStore to "S1" --q number of cue used to store current position of origin for this surface
---------------------------------------
tell application id "com.figure53.QLab.4" to tell front workspace
set the originX to (translation x of cue theStore)
set theID to text of cue theStore
set theNudge to scale x of cue theStore
set the originY to (translation y of cue theStore) + theNudge
set the translation y of cue theStore to the originY
set theOSC to "/settings/video/surfaces/" & theID & "/0/origin {" & (originX as integer) & "," & (originY as integer) & "}"
do shell script "echo " & quoted form of theOSC & " | nc -u -w 0 localhost 53535"
end tell
--nudge UP Surface 1
set theStore to "S1" --q number of cue used to store current position of origin for this surface
---------------------------------------
tell application id "com.figure53.QLab.4" to tell front workspace
set the originX to (translation x of cue theStore)
set theID to text of cue theStore
set theNudge to scale x of cue theStore
set the originX to (translation x of cue theStore)
set the originY to (translation y of cue theStore) - theNudge
set the translation y of cue theStore to the originY
set theOSC to "/settings/video/surfaces/" & theID & "/0/origin {" & (originX as integer) & "," & (originY as integer) & "}"
do shell script "echo " & quoted form of theOSC & " | nc -u -w 0 localhost 53535"
end tell
--nudge RIGHT Surface 1
set theStore to "S1" --q number of cue used to store current position of origin for this surface
---------------------------------------
tell application id "com.figure53.QLab.4" to tell front workspace
set the originX to (translation x of cue theStore)
set theID to text of cue theStore
set theNudge to scale x of cue theStore
set the originX to (translation x of cue theStore) - theNudge
set the originY to (translation y of cue theStore)
set the translation x of cue theStore to the originX
set theOSC to "/settings/video/surfaces/" & theID & "/0/origin {" & (originX as integer) & "," & (originY as integer) & "}"
do shell script "echo " & quoted form of theOSC & " | nc -u -w 0 localhost 53535"
end tell
--nudge RIGHT Surface 1
set theStore to "S1" --q number of cue used to store current position of origin for this surface
---------------------------------------
tell application id "com.figure53.QLab.4" to tell front workspace
set the originX to (translation x of cue theStore)
set theID to text of cue theStore
set theNudge to scale x of cue theStore
set the originX to (translation x of cue theStore) - theNudge
set the originY to (translation y of cue theStore)
set the translation x of cue theStore to the originX
set theOSC to "/settings/video/surfaces/" & theID & "/0/origin {" & (originX as integer) & "," & (originY as integer) & "}"
do shell script "echo " & quoted form of theOSC & " | nc -u -w 0 localhost 53535"
end tell
如果有很多面,可以通过使用此脚本创建由另一个热键触发的编号为“SEL”的Cue,将热键的数量减少到 5 个
告诉应用程序 id “com.figure53.QLab.4” 告诉前端工作区将提示“SEL”的注释设置为(返回的文本(显示对话框“您要轻推哪个表面编号?”默认答案 1)作为字符串)
并将 4 个微调脚本中的每一个的第一行更改为
将商店设置为“S”和“1”
并将其移动到 tell 块中。
例如用于轻推
--nudge DOWN Surface set in notes of cue SEL
---------------------------------------
tell application id "com.figure53.QLab.4" to tell front workspace
set theStore to "S" & notes of cue "SEL"
set the originX to (translation x of cue theStore)
set theID to text of cue theStore
set theNudge to scale x of cue theStore
set the originY to (translation y of cue theStore) + theNudge
set the translation y of cue theStore to the originY
set theOSC to "/settings/video/surfaces/" & theID & "/0/origin {" & (originX as integer) & "," & (originY as integer) & "}"
do shell script "echo " & quoted form of theOSC & " | nc -u -w 0 localhost 53535"
end tell
因此,可以将快捷键组织为菱形,表面选择在中间,例如使用数字键
8
4 5 6
2
站长提示:
本站上传分享的脚本或工程文件,包括TouchOSC模板,只供用户学习研究使用,因为涉及的知识面太广并不是一两句就能教会你怎么使用,对于新手用户 我们没有精力给你提供一对一包教包会服务。
另外:Goodmidi网站从来没有淘宝或闲鱼店铺,本站的教程或模板不管你是淘宝买的还是别人给的,请自行研究摸索。不要厚着脸皮老师长老师短的问东问西!我们不提供免费技术支持服务,请伸手党白嫖党知悉!
本站上传分享的脚本或工程文件,包括TouchOSC模板,只供用户学习研究使用,因为涉及的知识面太广并不是一两句就能教会你怎么使用,对于新手用户 我们没有精力给你提供一对一包教包会服务。
另外:Goodmidi网站从来没有淘宝或闲鱼店铺,本站的教程或模板不管你是淘宝买的还是别人给的,请自行研究摸索。不要厚着脸皮老师长老师短的问东问西!我们不提供免费技术支持服务,请伸手党白嫖党知悉!