Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Media replacement && Mogrt Group fix #1

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

phlexib
Copy link

@phlexib phlexib commented Nov 14, 2023

First, this fixes a potential issue when a .Mogrt file has Groups. Originally, The applyEssentialValues.jsx script would not look recursively, and would miss properties inside groups.

Second, this branch allows for Media replacement in the Mogrt, using the prop.setAlternatesource method.
It also take care of transforming the file url one would use in Nexrender into a system path that would be understood by extendscript.

 if (prop.canSetAlternateSource) {
                var replacementItem = app.project.importFile(
                    new ImportOptions(new File(value))
                );
                prop.setAlternateSource(replacementItem);
            } else {
                prop.setValue(value);
            }

A Job Json with Media replacement would look like this:

{
  "template": {
    "src": "file:///path/to/file.mogrt",
    "composition": "Comp 1"
  },
  "actions": {
    "predownload": [
      {
        "module": "nexrender-action-mogrt-template",
        "essentialParameters": {
          "Intro_Text_Image": "file:///path/to/image.png",
          "Dog Name": "New Dog Name",
          "BG Color": [1, 1, 0, 1],
          "scale": [100, 100, 0]
        }
      }
    ]
  }
}

Copy link
Owner

@vonstring vonstring left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By first glance this looks excellent! But would you mind separating changes fixing my formatting (which admittedly is all over the place) and actual changes into separate commits? It's quite hard to see what actual changes were made currently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants