Scripting - problem with InsertTitleIntoTimeline()

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

Annaël Beauchemin

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

Scripting - problem with InsertTitleIntoTimeline()

PostMon Jul 12, 2021 5:14 pm

Hello,

I'm trying to create some titles via Python 3.6 and I can't get this function to work:

InsertTitleIntoTimeline(titleName)

Here's my test code:

Code: Select all
#!/usr/bin/env python

# scripting module import

import imp
expectedPath="/Library/Application Support/Blackmagic Design/DaVinci Resolve/Developer/Scripting/Modules/"
bmd = imp.load_source('DaVinciResolveScript', expectedPath+"DaVinciResolveScript.py")

import DaVinciResolveScript as bmd

# variables init

resolve = bmd.scriptapp("Resolve")
projectManager = resolve.GetProjectManager()
currentProject = projectManager.GetCurrentProject()
currentTimeline = currentProject.GetCurrentTimeline()


### trying to add title

title = currentTimeline.InsertTitleIntoTimeline('titleName', 'test')

print(title)


When I run this code, it doesn't create a title and doesn't give an error in the console.

Am I doing something wrong?

Resolve 17.2.2, Python 3.6.8, macOS 10.15.7
Offline

Annaël Beauchemin

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

Re: Scripting - problem with InsertTitleIntoTimeline()

PostMon Jul 12, 2021 7:48 pm

for the record, I found the issue. I should have written:
title = currentTimeline.InsertTitleIntoTimeline('Title')


I guess I was confused by the docs that tells to set the settings as "setting: string", while it just need to receive the title generator name "Title". Now, how do I set the title's settings (content, font, etc)?

Return to DaVinci Resolve

Who is online

Users browsing this forum: 4EvrYng, ColdEngineBadBrakes, Dustin Bowser, panos_mts, rbern380 and 259 guests