Script cue can't see target changed by a target cue

121 views
Skip to first unread message

Scott Flanagan

unread,
Apr 26, 2023, 9:57:24 AM4/26/23
to QLab
I'm making a script to keep track of the percent completed of specific videos as they are played back. I'm trying to make the script general and need to get the correct playing cue, and the "last item of (cues whose running is true and q type is "video") works ok in my simple tests, but fails miserably in my more complex shows with lots of background video layers. I thought I could create a dummy "goto" cue that I would re-target to the desired video before I run the script, and use the "cue target" of my dummy cue to grab the desired cue in the script. Unfortunately, the "cue target" method only returns the original target, it does not update if a target cue is used to change it. I would love it if there were separate methods for "default cue target" and "effective cue target".
Also, it would be great if there was a built-in method to get the current running script cue, and allow script cues to have a target, so it could be used as an input variable in the script that is easy to change without editing the script.

Sam Kusnetz

unread,
Apr 26, 2023, 10:12:10 AM4/26/23
to ql...@googlegroups.com
Hi Scott

I’m interested in the specific combination of tracking specific videos and making the script general.

Is there anything that all the Video cues you want to track have in common? Could there be? Like, could you have all the Video cues you want to track have a special suffix in their cue number? Then you could do:

last item of (cues whose running is true and q number contains “%”)

where “%” is your special suffix.

Might work?

Sam
Sam Kusnetz (he/him) | Figure 53



On Apr 26, 2023 at 9:57:24 AM, Scott Flanagan <sco...@tekproductions.com> wrote:
I'm making a script to keep track of the percent completed of specific videos as they are played back. I'm trying to make the script general and need to get the correct playing cue, and the "last item of (cues whose running is true and q type is "video") works ok in my simple tests, but fails miserably in my more complex shows with lots of background video layers. I thought I could create a dummy "goto" cue that I would re-target to the desired video before I run the script, and use the "cue target" of my dummy cue to grab the desired cue in the script. Unfortunately, the "cue target" method only returns the original target, it does not update if a target cue is used to change it. I would love it if there were separate methods for "default cue target" and "effective cue target".
Also, it would be great if there was a built-in method to get the current running script cue, and allow script cues to have a target, so it could be used as an input variable in the script that is easy to change without editing the script.

--
Contact support anytime: sup...@figure53.com
Follow QLab on Twitter: https://twitter.com/QLabApp
User Group Code of Conduct: https://qlab.app/code-of-conduct/
---
You received this message because you are subscribed to the Google Groups "QLab" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qlab+uns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/qlab/cb1c5a02-ee29-4c41-92ce-6c611de7871en%40googlegroups.com.

Scott Flanagan

unread,
Apr 26, 2023, 12:07:24 PM4/26/23
to QLab
Hi Sam,

I work in corporate events, and we don't have the luxury of weeks of tech rehearsals, so I need to program quickly and for flexibility. I'm usually running multiple projection surfaces or LED walls, so lots of background videos that are constantly running. I've found that I tend to program my shows like a bunch of functions (groups of cues) that can get called in any order. for example, I usually set up a group of backgrounds that use the "fade and stop peers over time" so only one background video is visible per screen at any time, then in my main cue stack, I can start a particular background group from any piece of foreground content, and I can jump around without doubling up things or getting out of sync. I hope that makes sense. 
I'm just playing with some ideas right now, for this specific one, I'm sending out the percent complete of specific video rolls to a microcontroller with WLED which is running an addressable LED strip to make a big visual indicator of time remaining for crew or talent that can't see my remaining time. I just tested your suggestion, and it works, but I'd like to easily target a specific cue for the script to watch. I just think it would be useful to have the equivalent of passing arguments (in this case, a specific cue via the cue target) to a script when the cue is run. Then we could just use a target cue to set the target of the script cue, and the script can easily pull that to know what cue to act on. In my case, the number and order of videos could change minutes before doors open, so if the script is more general (like a function) I can just re-use it quickly when things change.

Sam Kusnetz

unread,
Apr 26, 2023, 12:18:26 PM4/26/23
to ql...@googlegroups.com
On Apr 26, 2023 at 12:07:24 PM, Scott Flanagan <sco...@tekproductions.com> wrote:
I just think it would be useful to have the equivalent of passing arguments (in this case, a specific cue via the cue target) to a script when the cue is run. Then we could just use a target cue to set the target of the script cue, and the script can easily pull that to know what cue to act on. In my case, the number and order of videos could change minutes before doors open, so if the script is more general (like a function) I can just re-use it quickly when things change.

Hi Scott

If you have the time to program a Target cue, don’t you also have the time to just have the Script cue pop up a dialogue box to ask for the cue number of the cue you want tracked?

That’s the main way to pass an argument into a Script cue. You could also create a Memo cue with a distinct number, like “STASH” and set its name to the number of the cue you want tracked, then have your script do:

set theCueToTrack to q name of cue “STASH”

Does this help?

Scott Flanagan

unread,
Apr 26, 2023, 3:12:07 PM4/26/23
to QLab
Hey Sam,
First off, I forgot to say thanks so much for responding so quickly and caring so much about your customers, you guys are awesome!
I'm not exactly in need of a fix, just exploring the options, and I guess it's more of a feature request for the AppleScript implantation that could help make certain scripts more flexible during show.
I think I'm approaching this more like a computer programmer than a show programmer. My thinking is that there is only 1 script in the workspace and it can change an internal variable based on some cue property that can be altered by another cue during show. However, it appears that accessing any property that is changed by a fade cue or target cue returns the original or default value. It would be great if you could also access the effective value that returns any temporary change made by another cue.
Oh, and allowing script cues to have a target would make the most sense for getting a custom cue inside the script, maybe like "the cue target of me" or "the cue target of this cue"

Thanks,
Scott

micpool

unread,
Apr 26, 2023, 7:44:55 PM4/26/23
to QLab
A script cue doesn't have a target parameter , but has plenty of other parameters where a pseudo target  variable could be set.
e.g you could put the target in the notes field
to do this instead of using a target cue you would use a network cue with a message /cue/SCRIPT/notes {anyCueNumber},  or a script cue with set the notes of cue "SCRIPT" to "anyCueNumber"
and to read this in the script you would use notes of cue "SCRIPT"
Obviously to set either a hypothetical target for a script cue, or actually use the notes field to store the target variable you need to know the number of the script cue, but it's also possible that you will want to know the script cue that is being run (the cue me that you mention in your later post), . You can do this with the script  set theCue to last item of (cues whose running is true and q type is "script")

Passing values between scripts and cue parameters can be achieved with a disabled text cue (with custom geometry) which allows  all the following variables to be stored:

set theCue to cue "VAR"
text of theCue— String
q name of theCue — String. read with q list name of theCue
notes of theCue — String
anchor x of the cue — any number
anchor y of the cue— any number
translation x of theCue — any number
translation y of theCue — any number
scale x of theCue — any positive number
scale y of the Cue— any positive number
/cue/REFS/layer — any integer 0 to 1000
opacity of theCue — any positive number 0 to 100 normalised 0 to 1

and if these  aren't enough  you also have the time fields for pre wait,  duration and post wait , midi parameter fields and a few others
Mic

Scott Flanagan

unread,
Apr 26, 2023, 8:18:48 PM4/26/23
to QLab
Hi Mic,
I just found another thread where you discussed storing values in a text cue, lots of potential there. I was just hoping for a way that used standard cues so as not to hide too much of the workings in script cues, but I think an OSC network cue can be pretty simple though.
Thanks All!
Scott

micpool

unread,
Apr 26, 2023, 8:20:35 PM4/26/23
to QLab
The q name of a network cue defaults to its OSC message so is clearer  than  a target cue in the cue list.

micpool

unread,
Apr 26, 2023, 9:09:42 PM4/26/23
to QLab
If you want a dynamic value that changes over time you can use a network cue with a 1D fade and a start and end value and a duration

e.g in QLab5
 /cue/VAR/translation/x #v#

or you can use OSC queries in a network cue with a long duration to read a parameter from another cue

Here's a very complex example that  translates the percentage elapsed of a video to a DMX value and a MIDI value simultaneously  you could use

/dashboard/setLight 1 #/cue/VAR/origin/x#

cue VAR would store the percentAction Elapsed *100 (percentActionElapsed is not actually a percentage, it's a normalised value 0-1) via a script:

tell application id "com.figure53.QLab.5" to tell front workspace
set anchor x of cue "VAR" to 0
repeat until anchor x of cue "VAR" > 100
set anchor x of cue "VAR" to ((percent action elapsed of cue "VIDEO") * 103) as integer
delay 0.1
end repeat
end tell

This would be referenced by a network cue with an OSC query
/dashboard/setLight 1 #/cue/VAR/origin/x#

This is patched to DMX ch 1 and the MIDI feedback for that lighting channel is set to controller 32.

Screenshot 2023-04-27 at 02.03.04.png

Screen recording attached
PercentElapsed to DMX-HD 1080p.mov

micpool

unread,
Apr 26, 2023, 9:14:57 PM4/26/23
to QLab
Workspace for example above
Mic
Variables.zip
Reply all
Reply to author
Forward
0 new messages