Scripting creation of composite shots

I know this is boring and mundane compared to the cool effects everyone else is doing, but in my videos I very often have a need to bring in images as overlays to the main video (I'm giving a presentation and the slides show up in the upper left corner). I need to be able to move them around the screen and sync them with the video, so I put them into a composite shot which lets me do all these things.
Creating these composite shots requires importing an image for each slide (or several if the slide has progressively revealed bullets or annotation) and then keyframing each of them to get the fade-in that I want.
Since Hitfilm 2 Ulitmate lets us import composite shots, and composite files are simple xml, it should be easy for me to write a script take a bunch of image assets and slap 'em into a composite shot with some default properties (like my keyframe fades). So here are my questions:
1) Has anyone else done any composite scripting with Hitfilm?
2) Would anyone else be interested in this? If I succeed, I'll gladly share the result
3) Inside the XML there are GUIDs for assets, folders, composites, etc. What do I need to know to create my own so they won't conflict with other IDs aready in the project?
Brink

Comments

  • dauiddauid Website User Posts: 41
    I've just begun to look into it myself. I want to be able to export comps from Anime Studio Pro.
    Please do share what you find. I've only just started studying and trying to make sense of the xml files.
    One thing I've noticed is that keyframes don't store what specific frame they're on but instead store the time in milliseconds. Maybe this is done for time rescaling purposes?
    I've been looking for good ways to generate GUID's as well. Worst case scenario I'll just try and generate a random string in the form of a GUID. Seems like quite a long shot to get two identical strings of that length.
  • GrisbyGrisby Website User Posts: 299 Just Starting Out
    Sounds interesting... :-)
  • dauiddauid Website User Posts: 41
    edited February 2013
    I've created a script for Anime Studio that exports a Hitfilm comp with camera and animated point layers.
    It seems to work except for this issue: topic/3485-how-come-the camera moves when-its-not-supposed-to Edit: Apparently you just had to either turn off motion blur or set the shutter phase to 0 to fix the camera not matching.
    Except for that issue it wasn't that hard. The trickiest part was figuring out how to convert from a keyframe based timing to Hitfilms timing.
    Hitfilm's timing appears to be based on milliseconds from the inpoint of the comp. If a keyframe is at 1 second into the comp then that would of course translate to 1000 milliseconds, BUT, if the inpoint of the comp is at 1 seconds then the keyframe at 1 second should be set at 0 milliseconds.
    Here's the formula I used: theTime = ((CurrFrame-StartFrame)/fps)*1000
    CurrFrame = The current frame number
    StartFrame = The start of the composition (In AS that is usually 1 while it is usually 0 in Hitfilm)
    fps = Frame rate of the animation
    *1000 = Multiply by a thousand to get milliseconds.
Sign In or Register to comment.