Shotgrid export-preset fine tuning

On an advanced configurationShotgrid project I would like to change some of the options on the publishing templates. The Docs are a little hazy here… they say:

More advanced settings and control over the actual export xml content that is being passed to flame in order to control Flame, is handled by a hook where the behaviour is defined for each preset. In the hook, you have complete control over how media is being generated by the exporter.

…which I take to mean that I can edit:

<config root>/install/app_store/tk-flame-export/v1.10.6/python/export_utils/export_preset.py

…and change some of the parameters that I’m interested in having changed. In particular I want to adjust the padding and force the publish to use the start frame defined on the clip. In a regular publish template that would be in my case…

	<name>
		<framePadding>4</framePadding>
		<startFrame>1001</startFrame>
		<frameIndex>3</frameIndex>
	</name>

So I’m just hard injecting those key value pairs into the xml description like this:

        xml = (
            """<?xml version="1.0" encoding="UTF-8"?>
            <preset version="%s">
               <type>sequence</type>
               <comment>Export profile for the ShotGrid Flame export</comment>
               <sequence>
                  <fileType>NONE</fileType>
                  <namePattern />
                  <includeVideo>True</includeVideo>
                  <exportVideo>True</exportVideo>
                  <videoMedia>
                     <mediaFileType>image</mediaFileType>
                     <commit>Original</commit>
                     <flatten>NoChange</flatten>
                     <exportHandles>True</exportHandles>
                     <nbHandles>{FRAME_HANDLES}</nbHandles>
                  </videoMedia>
                  <includeAudio>True</includeAudio>
                  <exportAudio>False</exportAudio>
                  <audioMedia>
                     <mediaFileType>audio</mediaFileType>
                     <commit>Original</commit>
                     <flatten>NoChange</flatten>
                     <exportHandles>True</exportHandles>
                     <nbHandles>{FRAME_HANDLES}</nbHandles>
                  </audioMedia>
               </sequence>

               {VIDEO_EXPORT_PRESET}

               <createOpenClip>
                  <namePattern>{SEGMENT_CLIP_NAME_PATTERN}</namePattern>
                  <version>
                     <index>0</index>
                     <padding>{VERSION_PADDING}</padding>
                     <name>v&lt;version&gt;</name>
                  </version>
                  <batchSetup>
                     <namePattern>{BATCH_NAME_PATTERN}</namePattern>
                     <exportNamePattern>{SHOT_CLIP_NAME_PATTERN}</exportNamePattern>
                     <outputPathPattern>{OUTPUT_PATH_PATTERN}</outputPathPattern>
                  </batchSetup>
               </createOpenClip>
               <name>
                  <framePadding>4</framePadding>
                  <startFrame>1001</startFrame>
                  <frameIndex>3</frameIndex>
               </name>
               <reImport>
                  <namePattern />
               </reImport>
            </preset>
     """
            % preset_version
        )

But come hell of high water I can’t get that shit to stick. Each publish comes out with tc as frame numbers and 8 digit padding. Sooo thought I might reach out here and see if anyone has come across this or has any ideas… Anyone? @Slabrie?

Let me check this and I will get back to you here later today.

1 Like

Could you send me your export preset.py file in a private message?

What you are trying to do should work but maybe there is a typo somewhere preventing you to get the desired result.

One thing to keep in mind is that modifications done to the scripts part of SG will be overwritten when we push an update. So, back-up your changes.

1 Like