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

FootageItem replace() not working

Explorer ,
Aug 17, 2023 Aug 17, 2023

Copy link to clipboard

Copied

Hello! I'm trying to implement Shotgrid's Scene Breakdown for After Effects and while it is correctly identifying the FootageItem in the scene that it needs to update, the function for replacing the path does not seem to work (and neither does replaceWithSequence). I am not sure if the issue is related to the path being passed in, but currently this does nothing:

def update(self, item):
    node_name = item["node_name"]
    node_type = item["node_type"]
    path = self.parent.engine.adobe.File(item["path"])
    selected_item = item["extra_data"]["footage_item"]
    if node_type == "Footage":
        print("Updating {} path to {}".format(node_name, path))
        selected_item.replace(path)

I have also tried replacing the item using rpc_eval and putting the ExtendScript equivalent code inside but that also does not work. What am I missing here?

TOPICS
Error or problem , Scripting

Views

90

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

correct answers 1 Correct answer

Explorer , Aug 17, 2023 Aug 17, 2023

I believe I found the solution, thanks to this post: 

path = footage.file.fsName
path = sgtk.util.ShotgunPath.normalize(path)

 

Votes

Translate

Translate
Explorer ,
Aug 17, 2023 Aug 17, 2023

Copy link to clipboard

Copied

LATEST

I believe I found the solution, thanks to this post: 

path = footage.file.fsName
path = sgtk.util.ShotgunPath.normalize(path)

 

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