Scripting API: Returning name/ID of selected clip?

Get answers to your questions about color grading, editing and finishing with DaVinci Resolve.
  • Author
  • Message
Offline
User avatar

Mel Matsuoka

  • Posts: 1438
  • Joined: Wed Aug 22, 2012 9:54 am
  • Location: Buffalo, NY

Scripting API: Returning name/ID of selected clip?

PostThu Feb 18, 2021 10:43 pm

I've been trying desperately to come up with a workaround for Resolve's infuriating lack of inheritance of clip properties when using the "New Timeline Using Selected Clips" option, and can't quite figure out how to use the Scripting API to simply return the selected Media Pool clip (or the selected Timeline clip), so that I can query its properties.

So far, all I can do is dump the properties of everything in the Media Pool, by iterating over the output of GetClipList(). But I cant figure out how to get the name/ID of whatever clip is currently selected in the Media Pool (and/or Timeline), so that I can isolate the properties of the selected clip using GetClipProperty()

Is this possible with the current API?
Blog: https://PostProductive.tv
YouTube: https://www.youtube.com/@postproductive
Offline

sp-infected

  • Posts: 2
  • Joined: Tue Jul 06, 2021 9:34 am
  • Real Name: Sascha Prangen

Re: Scripting API: Returning name/ID of selected clip?

PostTue Jul 06, 2021 9:51 am

Hello everyone,

But I cant figure out how to get the name/ID of whatever clip is currently selected in the Media Pool (and/or Timeline), so that I can isolate the properties of the selected clip using GetClipProperty()


We are currently facing the same problem.
Has anyone found a way to get the selected clips of a timeline? This would be extremly usefull for integrating Resolve in our pipeline.
Thank you for your help!
Offline

sp-infected

  • Posts: 2
  • Joined: Tue Jul 06, 2021 9:34 am
  • Real Name: Sascha Prangen

Re: Scripting API: Returning name/ID of selected clip?

PostTue Jul 06, 2021 4:31 pm

Maybe someone from Backmagic has a hint for me?
Offline
User avatar

Igor Riđanović

  • Posts: 1656
  • Joined: Thu Jul 02, 2015 5:11 am
  • Location: Los Angeles, Calif.

Re: Scripting API: Returning name/ID of selected clip?

PostTue Jul 06, 2021 9:32 pm

Hi Mel. You can't get the selected items or clips. The closest you can do is GetCurrentVideoItem() called on the timeline instance. Unless you need to get completely arbitrary clips, perhaps you can filter the clips list and discard the ones that don't meet your criteria. That's what I often do.
www.metafide.com - DaVinci Resolve™ Apps
Offline
User avatar

Mel Matsuoka

  • Posts: 1438
  • Joined: Wed Aug 22, 2012 9:54 am
  • Location: Buffalo, NY

Re: Scripting API: Returning name/ID of selected clip?

PostTue Jul 06, 2021 9:44 pm

Igor Riđanović wrote:Hi Mel. You can't get the selected items or clips. The closest you can do is GetCurrentVideoItem() called on the timeline instance. Unless you need to get completely arbitrary clips, perhaps you can filter the clips list and discard the ones that don't meet your criteria. That's what I often do.


Thanks for the confirmation, Igor. That's incredibly disappointing. I can't imagine why there isn't a method for such an obvious thing?
Blog: https://PostProductive.tv
YouTube: https://www.youtube.com/@postproductive
Offline

Annaël Beauchemin

  • Posts: 95
  • Joined: Thu Nov 24, 2016 7:12 am

Re: Scripting API: Returning name/ID of selected clip?

PostWed Jul 07, 2021 1:30 pm

Mel Matsuoka wrote:
Igor Riđanović wrote:Hi Mel. You can't get the selected items or clips. The closest you can do is GetCurrentVideoItem() called on the timeline instance. Unless you need to get completely arbitrary clips, perhaps you can filter the clips list and discard the ones that don't meet your criteria. That's what I often do.


Thanks for the confirmation, Igor. That's incredibly disappointing. I can't imagine why there isn't a method for such an obvious thing?


+1

a "GetSelectedClips()" function that would return an array would be a big step forward for scripting in general.
Offline
User avatar

X-Raym

  • Posts: 153
  • Joined: Thu Apr 18, 2013 4:05 pm
  • Location: France
  • Real Name: Raymond Radet

Re: Scripting API: Returning name/ID of selected clip?

PostThu Jan 06, 2022 9:35 am

+1

This is highly needed, for both media pool and timeline. Scripting without this basic feature is very limited.
My DaVinci Resolve Scripts: https://github.com/X-Raym/DaVinci-Resolve-Scripts
My Resolve Scripting API Doc: https://www.extremraym.com/en/resolve-api-doc-release/
Donation: https://paypal.me/extremraym
Offline
User avatar

Andrew Hazelden

  • Posts: 610
  • Joined: Sat Dec 06, 2014 12:10 pm
  • Location: West Dover, Nova Scotia, Canada

Re: Scripting API: Returning name/ID of selected clip?

PostThu Jan 06, 2022 9:55 am

+1
Reactor.lua:933: attempt to index global 'ui' (a nil value)
Offline

philipbowser

  • Posts: 399
  • Joined: Tue Oct 14, 2014 11:53 pm

Re: Scripting API: Returning name/ID of selected clip?

PostMon Feb 28, 2022 4:48 pm

+1

I definitely need this as well for VFX Editorial and Conform workflows. Being able to run scripts on selected clips in the timeline is HUGE, and would be the reason we would switch over to Resolve.

a "GetSelectedClips()" function would allow us to make some tools that Resolve is currently lacking for VFX Conform.
Offline
User avatar

X-Raym

  • Posts: 153
  • Joined: Thu Apr 18, 2013 4:05 pm
  • Location: France
  • Real Name: Raymond Radet

Re: Scripting API: Returning name/ID of selected clip?

PostMon Feb 28, 2022 5:00 pm

I think this thread has to be moved under Feature Request subforum by moderators.
My DaVinci Resolve Scripts: https://github.com/X-Raym/DaVinci-Resolve-Scripts
My Resolve Scripting API Doc: https://www.extremraym.com/en/resolve-api-doc-release/
Donation: https://paypal.me/extremraym
Offline
User avatar

roger.magnusson

  • Posts: 3874
  • Joined: Wed Sep 23, 2015 4:58 pm

Re: Scripting API: Returning name/ID of selected clip?

PostMon Feb 28, 2022 5:09 pm

There already a feature request made here.
Offline
User avatar

X-Raym

  • Posts: 153
  • Joined: Thu Apr 18, 2013 4:05 pm
  • Location: France
  • Real Name: Raymond Radet

Re: Scripting API: Returning name/ID of selected clip?

PostMon Feb 28, 2022 5:11 pm

@roger
Thx, I think a dedicated FR thread though would have been expected, there is two different sets of functions in this one :S
It worth to bump it though.
My DaVinci Resolve Scripts: https://github.com/X-Raym/DaVinci-Resolve-Scripts
My Resolve Scripting API Doc: https://www.extremraym.com/en/resolve-api-doc-release/
Donation: https://paypal.me/extremraym
Offline

pantau000

  • Posts: 147
  • Joined: Wed Dec 21, 2022 5:42 pm
  • Real Name: Peter Antoni

Re: Scripting API: Returning name/ID of selected clip?

PostMon Feb 27, 2023 6:04 pm

+1

Clips being selected/enabled and timelines being locked or not is an essential information needed for scripting.
Offline

seb.reategui

  • Posts: 11
  • Joined: Sat Aug 15, 2020 9:54 am
  • Real Name: Sebastian Reategui

Re: Scripting API: Returning name/ID of selected clip?

PostWed Apr 03, 2024 9:50 pm

Please add this feature.

Timeline.GetSelectedTimelineItems()

There is huge potential to change clip properties, run tasks on selected clips, update metadata and a myriad of other possibilities.

The timeline from a user perspective is a great place to select clips - you can see the clip preview, its name, its position in the timeline, it's the ultimate user control that gives you the feeling of "I know what this clip is". The thumbnail strip as well also affords this feeling.

So it is a no-brainer to permit scripts and Workflow Extensions to access the clips that the user has selected, so tasks can be performed on those clips.

The current API implementation only allows the clip underneath the playhead, or to get all timeline items.

This is not sufficient!

A user's selection can be of multiple clips located anywhere in the timeline, in a non-linear fashion.

In many cases, the user does NOT want to perform tasks to all clips in the timeline, this is too aggressive.
Offline
User avatar

Mel Matsuoka

  • Posts: 1438
  • Joined: Wed Aug 22, 2012 9:54 am
  • Location: Buffalo, NY

Re: Scripting API: Returning name/ID of selected clip?

PostWed Oct 02, 2024 7:21 pm

It's Christmas in October!

"Scripting API support to get and set media pool selection" has been added to 19.0.2 !
Blog: https://PostProductive.tv
YouTube: https://www.youtube.com/@postproductive
Offline

bentraje

  • Posts: 94
  • Joined: Mon Feb 24, 2020 5:44 pm
  • Real Name: Ben Traje

Re: Scripting API: Returning name/ID of selected clip?

PostWed Oct 02, 2024 7:24 pm

Will this include the "Timeline.GetSelectedTimelineItems()" as suggested above?
Offline
User avatar

roger.magnusson

  • Posts: 3874
  • Joined: Wed Sep 23, 2015 4:58 pm

Re: Scripting API: Returning name/ID of selected clip?

PostWed Oct 02, 2024 7:51 pm

No, it's for media pool items only.
Offline

daxliniere

  • Posts: 48
  • Joined: Thu Mar 14, 2019 11:45 am
  • Real Name: Dax Liniere

Re: Scripting API: Returning name/ID of selected clip?

PostMon Jun 02, 2025 12:13 pm

Hey DR dev team,
When will we get some movement on this, please? The lack of this basic functionality is holding back the scripting community. Go and visit the REAPER (DAW) forums and you will see the scripting community is very healthy and a great source of innovation.
[AMD 5800X, 32Gb RAM, Win10x64, NVidia GTX1080ti, FireFaceUCX]

Return to DaVinci Resolve

Who is online

Users browsing this forum: Bing [Bot], onlychild96, Peter Cave and 239 guests