• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Automation Blocks - Script Fails with Null Object in Timeline

Participant ,
Dec 16, 2024 Dec 16, 2024

Copy link to clipboard

Copied

Hello @Mathias Moehl !

 

The below (and attached) script replaces a clip in the sequence for another another clip in the project, retaining the in point of the original sequence clip.

The script works great EXCEPT when there is a text graphic in the timeline created with the text tool (null object?).

 

I tried to filter out for null objects, but I still get the error 'TypeError: null is not an object (line 12)' at the point where the script walks over that graphic in the timeline...

 

GraphicSwap.png
Instead of If My Clip ≠ Null, I also tried...

HasNotType.png
and the inverse (has type footage).
That script reaches 'Done' but doesn't do anything.

Any ideas on how I can get this script to work when that null object is in the timeline?

TOPICS
SDK

Views

94

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 16, 2024 Dec 16, 2024

Copy link to clipboard

Copied

I guess your issue is the "set attribute project item of clip" block. For text clips, the text itself exists, but its attribute project item is null and cannot be set to anything else. I would wrap the "set attribute project item of clip" block into an if statement, where you check 

if( "get attribute project item of clip my clip" not equal null)

That way you ensure that you never try to set the project item of a clip which has no corresponding project item.

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Dec 17, 2024 Dec 17, 2024

Copy link to clipboard

Copied

LATEST

Excellent! That worked when I wrapped that entire section in the command you suggested...

 

NullFixed.png

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines