Hey there!
I just wanted to play around with UXP for PPro, but got stuck: I wanted to get the selected items (track items) of the active sequence, but the type / docs for TrackItemSelection
currently don’t seem to include any APIs for actually retrieving the current contents of Sequence.getSelection()
:
export declare type TrackItemSelection = {
addItem(trackItem: object, skipDuplicateCheck?: boolean): boolean //Add a track item to this selection
removeItem(trackItem: object): boolean //Remove a track item from this selection
}
This also appears to be the case based on the console output of the selection object…
Am I correct in assuming this is currently still missing in the APIs, or am I the one missing something (potentially obvious)?
Thanks in advance,
Zuri
Hi!
You are not missing anything - this is something that we are still working on.
Right now, sequence.getSelection()
can return you an TrackItemSelection
object that you can add or remove trackItem
into. It will capture the selected trackItem in the active sequence and can be used for other APIs like
await ppro.SequenceUtils.performSceneEditDetectionOnSelection
(PPro.SequenceUtils.SEQUENCE_OPERATION_APPLYCUT, selection); // selection is the TrackItemSelection object
It’s definitely in our plan to expose getItems
API for the TrackItemSelection
to allow for better access and control over the selection.
Thanks for trying out UXP!
[Updated for clarification]
2 Likes
Thanks for the quick response – I’m looking forward to this getting implemented (especially as it’s probably a go-to “Hello world” kind of thing => will be good to have in order not to deter folks from trying more stuff)!
Hi!
My apologies - I think I was providing inaccurate interpretation to the functionality. I just went through our code base and docs again - sequence.getSelection()
API will actually capture the selected trackItem in the sequence.
We are working actively to have the getItems
API for the trackItemSelection
object exposed for better controls and access over the selection. Right now, it can be used as a whole for API I mentioned above.
Sincere apologies for the confusion, and hopefully this gives more space for trying different stuff!
1 Like
No worries – and yeah, I’m waiting for the getItems
one . Essentially, my first thought for things to try were things like batch-applying transitions or effects to selected clips – that (at least to me, coming from other UXP host apps) felt like a natural “first thing to try” / Hello World kind of project, but of course depends on getting (in one way or another) the selected items of the sequence.
Thanks again!
2 Likes