Detecting Shot existence


#1

Hello !

I would like to launch a script line ONLY if there is a shot in the camsequencer. If there is no shot in the scene, then do nothing ( or print " there is no shot " ).

Is there a way to detect this in MEL ? Like if shot = true, then xxxx

Thank you


#2

I’m not familiar with the sequencer, but you can list nodes by type and it looks like the sequencer uses shot nodes.

Hope that helps!

string $shots[] = `ls -type "shot"`;
if(size($shots)){
	print "there are shots.";
}else{
	print "there are no shots.";
}