Skip to main content
Inspiring
January 31, 2023
Answered

Looking for Index of Selected Sequence via SDK

  • January 31, 2023
  • 1 reply
  • 621 views

Hello, I am working on an extension that will clone the selected sequence in the project panel. I thought I was creating a working prototype, but then I realized I was using the "activeSequence" object which is not the object that I want. I want the selected sequence.

 

I found something similar to what I want, called "Anywhere.getCurrentEditingSessionSelectionURL()". But I just want this for a normal project object...not an "Anywhere" object. But otherwise, the Description and Return of this method are what I am looking for (I guess it would be an index instead of a URL though).

 

Can someone help me out with the best way to retrieve this information? Thank you.

This topic has been closed for replies.
Correct answer Bruce Bullis

Based on [above], yes, using the handy projectItem.isSequence() function, then the nodeId, is probably the best approach to identifying/picking sequences from a project panel selection.

1 reply

Bruce Bullis
Community Manager
Community Manager
January 31, 2023

You can get the current projectItem selection, the parse that array looking for selected sequences...

What will you do, if the user has multiple sequences selected? 

[Without better understanding your desired workflow, the active sequence seems like exactly the right approach...]


 

Inspiring
February 1, 2023

Got it, so maybe the best way is to pull the nodeId from the selected projectItem and then loop through every sequence until I find one that has a matching projectItem nodeId? Is there a simpler way to get the sequence index from the projectItem?

 

For now, if multiple sequences were selected, I would throw an error.

 

My desired workflow is basically that I want a variation of duplicating a sequence in the project panel. This extension would allow the user to select a sequence in the project panel, hit the extension's duplicate button, and then the extension would duplicate the sequence and iterate on the edit number (sort of like how After Effects does it). I know it can seem arbitrary whether I use selected sequence or active sequence, but active sequence would be unintuitive for an editor (as you don't duplicate an active sequence, you duplicate a selected sequence).

 

Thank you Bruce, I appreciate the help.

Bruce Bullis
Community Manager
Bruce BullisCommunity ManagerCorrect answer
Community Manager
February 1, 2023

Based on [above], yes, using the handy projectItem.isSequence() function, then the nodeId, is probably the best approach to identifying/picking sequences from a project panel selection.