Why are these commands not available in dvr_script?

Ask software engineering and SDK questions for developers working on Mac OS X, Windows or Linux.
  • Author
  • Message
Offline

garrettwill1220

  • Posts: 4
  • Joined: Wed Feb 08, 2023 5:46 am
  • Real Name: Garrett Will

Why are these commands not available in dvr_script?

PostThu Mar 30, 2023 5:34 am

Why does chat gpt know about these seemingly super useful commands that I dont have access to? Is there a way to gain access?
Code: Select all
# Import the necessary modules
import DaVinciResolveScript as bmd
import os

# Connect to the currently open project
resolve = bmd.scriptapp("Resolve")
projectManager = resolve.GetProjectManager()
project = projectManager.GetCurrentProject()

# Get the current timeline
timeline = project.GetCurrentTimeline()

# Get the video track we want to work on
video_track_index = 1
video_track = timeline.GetItemListInTrack("video", video_track_index)[0]

# Get the audio track we want to work on
audio_track_index = 1
audio_track = timeline.GetItemListInTrack("audio", audio_track_index)[0]

# Set the active timeline and tracks
project.SetActiveTimeline(timeline)
timeline.SetActiveTrack("video", video_track)
timeline.SetActiveTrack("audio", audio_track)

I wish we could use commands like .SetActiveTrack. I feel like chatgpt isn't pulling these out of nowhere; I don't have access. Is there some way to gain access to these api calls? this is just one of many that chatgpt is aware of but yet its not in the readme.txt
Offline
User avatar

roger.magnusson

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

Re: Why are these commands not available in dvr_script?

PostFri Mar 31, 2023 12:12 pm

ChatGPT will make stuff up unless you tell it to only use functions available in a particular API.

Project.SetActiveTimeline(timeline) doesn't exist, but you can use Project.SetCurrentTimeline(timeline) instead.

Timeline.SetActiveTrack() doesn't exist either. What would that correspond to in the Edit page GUI, the Auto Track Selector? Only the Fairlight page seems to have a concept of an active track that gets selected when you click it.

For some undocumented track-related functions that do exist, check out this thread: https://forum.blackmagicdesign.com/viewtopic.php?f=21&t=113040

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 26 guests