Welcome to WSL!

New to the forum? Please read this and this.

AddFusionComp() not understanding

User avatar
RBemendo
Fusioneer
Posts: 178
Joined: Fri Dec 12, 2014 11:32 am

AddFusionComp() not understanding

#1

Post by RBemendo »

I'm trying to execute functions on items in the timeline, and having a hard time grasping how to make that work. To start extremely simple, I'm trying to make a Fusion comp from the current selected item on the timeline. But I keep getting the error: Type Error: 'NoneType' object is not callable

Here's the simple code, not sure what I'm doing wrong at this point.

Code: Select all

#import davinci resolve for python to use

import DaVinciResolveScript as dvr
resolve = dvr.scriptapp('Resolve')

#set variables

pm = resolve.GetProjectManager()
proj = pm.GetCurrentProject()
timeline = proj.GetCurrentTimeline()
mediaPool = proj.GetMediaPool()
clip = timeline.GetCurrentVideoItem() 
MpItem = clip.GetMediaPoolItem()
itemList = timeline.GetItemListInTrack("video",4)




clip.AddFusionComp()

User avatar
RBemendo
Fusioneer
Posts: 178
Joined: Fri Dec 12, 2014 11:32 am

Re: AddFusionComp() not understanding

#2

Post by RBemendo »

updating this for anyone looking for this information.

I needed to call the "timeline" object first before trying to execute the function.

Code: Select all

#import davinci resolve for python to use

import DaVinciResolveScript as dvr
resolve = dvr.scriptapp('Resolve')

#set variables

pm = resolve.GetProjectManager()
proj = pm.GetCurrentProject()
timeline = proj.GetCurrentTimeline()
mediaPool = proj.GetMediaPool()
clip = timeline.GetCurrentVideoItem() 
MpItem = clip.GetMediaPoolItem()
itemList = timeline.GetItemListInTrack("video",4)




timeline.AddFusionComp(clip)