Resolve - Python Fix/Feature-Request

  • Author
  • Message
Offline
User avatar

Stefan Weßling

  • Posts: 24
  • Joined: Thu Oct 30, 2014 2:00 am

Resolve - Python Fix/Feature-Request

PostMon Mar 27, 2023 7:38 pm

Dear Forum Members,

I have been developing Python automations for the past year and, while I consider myself a novice in scripting, I have encountered some limitations in Resolve that I believe are not due to my lack of experience. I would appreciate any corrections or guidance and hope that these issues can be addressed in future releases.

Setting I/O Points:
I am unable to use SetProperty() for In and Out Points.
My current workaround involves using a GUI-based automation to trigger shortcuts and manually copy-pasting I/O Points from an Excel sheet to Resolve for each shot day (these points are set in Silverstack-Lab).

Setting Audio Track Layouts:
I can only call GetProperty for the audio track count, but not for the audio track layout (number, naming, type). More importantly, I cannot set the audio track layout.
In my role as a DIT, I typically receive audio with 8 to 16 tracks, but for dailies/proxies, I only need the "Mono Mix" track as a single mono track. When I attempt to perform this in batch via clip attributes, the results are inconsistent and seemingly random. I would prefer to accomplish this using a Python script, but that would require the audio settings on the media pool level to be accessible via the Python API.

Accessing Smart Bins:
I encounter errors when trying to list clips in a Smart Bin.
It would be helpful if this functionality worked, as filtering clips with specific attributes for one-time tasks is more easily accomplished through Smart Bins than with scripts.

I appreciate any insights or suggestions you may have. Please note that my concerns pertain to the Media Pool level (not the Timeline level), and I have tested these issues on Resolve Studio 18.1.2. B6 on several Macs, both Intel and Silicon (Monterey and Big Sur).

Best regards,
Stefan
Offline
User avatar

roger.magnusson

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

Re: Resolve - Python Fix/Feature-Request

PostFri Mar 31, 2023 12:33 pm

There's no insight to be had unfortunately. The API doesn't support any of those things yet. Not many people are making those kinds of scripts and I don't think people ever will unless the API gets substantially better. But since users generally aren't making scripts BMD seemingly doesn't have enough incentive to improve it...

I've posted a few scripts here and there to try to drum up interest, but since the API is so limited it's not possible to make scripts with true killer features.
Offline
User avatar

Stefan Weßling

  • Posts: 24
  • Joined: Thu Oct 30, 2014 2:00 am

Re: Resolve - Python Fix/Feature-Request

PostSat Apr 01, 2023 3:46 pm

Thank you for sharing your insght. I have gained a similar impression and wrote this post with the quiet hope of receiving a certain resonance and showing BMD that there is indeed interest and ideas for use of the API.
Offline

OndrejPopp

  • Posts: 4
  • Joined: Sat Oct 26, 2019 7:06 pm
  • Real Name: Ondrej Popp

Re: Resolve - Python Fix/Feature-Request

PostFri Aug 04, 2023 8:58 am

Stefan Weßling wrote:Thank you for sharing your insght. I have gained a similar impression and wrote this post with the quiet hope of receiving a certain resonance and showing BMD that there is indeed interest and ideas for use of the API.


Ok, one vote from me. I am using it on version 18.5, but I am using Lua because I don't like the Pyhon snake symbolism.

Concerning setting in and out points, that kind of seems to work now. However... upon examination of the clip properties I noticed that the system doesn't store raw frames but timecodes. Yes. Contrary to how a subclip needs to be specified in

MediaStorage:
Code: Select all
AddItemListToMediaPool([{itemInfo}, ...])       --> [clips...]         # Adds list of itemInfos specified as dict of "media", "startFrame" (int), "endFrame" (int) from Media Storage into current Media Pool folder. Returns a list of the MediaPoolItems created.

Here you need to specify frames for the in and out points, however... when I queried the clip properties,
MediaPoolItem:
Code: Select all
GetClipProperty(propertyName=None)              --> string|dict        # Returns the property value for the key 'propertyName'.
                                                                         # If no argument is specified, a dict of all clip properties is returned. Check the section below for more information.

then I noticed that the in and out points are actually stored as time codes (xxxxxxxTC) while the in and out properties are left blank... So I thought, ok let's try that then, and so I changed the time code on a clip by means of the SetClipProperty function, and what do you know... that worked! So instantly that clip turned red in the timeline because it got invalidated, so it is still holding most likely, didn't check that, the old values, but when you drag the modified clip onto the timeline again, it turns up green and with the new values. I only tried changing the inpoint TC but I am assuming it also works for the out points. However, because that clip turned red in the timeline, this also means thus, that when you do this and have the clips you want to modify already in the timeline, those get invalidated or something like that, in any case they turn red, so you need to update those as well.

In addition, concerning new features, I would like to add to the list besides access to smartbins, also access to powerbins and extending the itemInfo hash in again,

MediaStorage:
Code: Select all
AddItemListToMediaPool([{itemInfo}, ...])       --> [clips...]         # Adds list of itemInfos specified as dict of "media", "startFrame" (int), "endFrame" (int) from Media Storage into current Media Pool folder. Returns a list of the MediaPoolItems created.

also with a "name" and "uuid" key. Most of the time when you create a new subclip you want to give it a new name as well, so that explains the need for the "name" key. Although you can set that later through the clip properties, but in this way it is more convenient.

The "uuid" key is needed to set an uuid on the subclip you are creating. As it is now, the system automatically creates a new uuid for every subclip you create in this way, and the uuid can then be queried though MediaPoolItem:GetMediaId() and MediaPoolItem:GetUniqueId(), yes, there are two of them and they return different uuids, but you can not assign one by yourself. This is needed when you are writing like me, your own importers and exporters because then you already have a representation of the subclips you want to import together with their uuids in a file, and you want to use that uuid, on file, and query it later through GetMediaId() or GetUniqueId() or some other GetxxxId() function.

At this moment, DVR 18.5, this is not possible, so that explains the need for the "uuid" key in the clipInfo hash, and for a workaround, I am going through the metadata now, using "Clip Number" for that. You could ofcourse extend the metadata with a new "uuid" key as well, but I think adding that to the itemInfo hash is a better idea.

So, that was it from me,
Tx!

Return to DaVinci Resolve Feature Requests

Who is online

Users browsing this forum: Stephen Dixon and 9 guests