Copying values between final cut 7 xml files

SmfrusikDakari

New Member
I have two xml documents. They both have clip items with the same name. I am trying to figure out how to make a python script that will copy from one xml to the other. I want to copy the center values and scale values, which are under the basic motion effect. These are truncated forms of the xml files that the program will need to work with. The actual xml files will have multiple clip items and I need to be able to copy those values between them all. Just like these samples both files will have clip items which all have identical names but are linking to different clips. I understand that I am not posting any code attempts but I was unable to find anything on google or this site that seemed to match. I'm not a coder but a guy who is learning to code little by little, by clumsily making tools to help me at work. I've been playing around with etree but I don't see how to get the values from one document to the other. If anyone could at least point me in the direction of an article or lesson that could help, it would be much appreciated.Here is the first XML:\[code\] <?xml version="1.0" encoding="UTF-8"?><!DOCTYPE xmeml><xmeml version="5"><sequence id="test"> <uuid>4305B2F2-B876-44FB-8E48-DBD01D1A3304</uuid> <updatebehavior>add</updatebehavior> <name>test</name> <duration>724</duration> <rate> <ntsc>TRUE</ntsc> <timebase>24</timebase> </rate> <timecode> <rate> <ntsc>TRUE</ntsc> <timebase>24</timebase> </rate> <string>01:00:00:00</string> <frame>86400</frame> <source>source</source> <displayformat>NDF</displayformat> </timecode> <in>-1</in> <out>-1</out> <media> <video> <format> <samplecharacteristics> <width>720</width> <height>486</height> <anamorphic>FALSE</anamorphic> <pixelaspectratio>NTSC-601</pixelaspectratio> <fielddominance>none</fielddominance> <rate> <ntsc>TRUE</ntsc> <timebase>24</timebase> </rate> <colordepth>24</colordepth> <codec> <name>Apple ProRes 422</name> <appspecificdata> <appname>Final Cut Pro</appname> <appmanufacturer>Apple Inc.</appmanufacturer> <appversion>7.0</appversion> <data> <qtcodec> <codecname>Apple ProRes 422</codecname> <codectypename>Apple ProRes 422 (HQ)</codectypename> <codectypecode>apch</codectypecode> <codecvendorcode>appl</codecvendorcode> <spatialquality>1024</spatialquality> <temporalquality>0</temporalquality> <keyframerate>0</keyframerate> <datarate>0</datarate> </qtcodec> </data> </appspecificdata> </codec> </samplecharacteristics> <appspecificdata> <appname>Final Cut Pro</appname> <appmanufacturer>Apple Inc.</appmanufacturer> <appversion>7.0</appversion> <data> <fcpimageprocessing> <useyuv>TRUE</useyuv> <usesuperwhite>FALSE</usesuperwhite> <rendermode>Float10BPP</rendermode> </fcpimageprocessing> </data> </appspecificdata> </format> <track> <clipitem id="CR7-CAM20001 "> <name>CR7-CAM20001</name> <duration>13148</duration> <rate> <ntsc>TRUE</ntsc> <timebase>24</timebase> </rate> <in>317</in> <out>411</out> <start>20</start> <end>114</end> <pixelaspectratio>Square</pixelaspectratio> <enabled>TRUE</enabled> <anamorphic>FALSE</anamorphic> <alphatype>none</alphatype> <file id="CR7-CAM20001 1"> <name>CR7-CAM20001.mov</name> <pathurl>file://localhost/Volumes/LONERANGER/Dreamstrong%20Vicksburg/03%20Dreamstrong%20Vicksburg%20Media/01%20Footage/01%20Shoot%20Footage/01%20Converted%20Footage/Vicksburg030713_5D_converted/CR7-CAM20001.mov</pathurl> <rate> <timebase>24</timebase> <ntsc>TRUE</ntsc> </rate> <duration>13148</duration> <media> <video> <duration>13148</duration> <samplecharacteristics> <width>1920</width> <height>1080</height> </samplecharacteristics> </video> <audio> <samplecharacteristics> <samplerate>48000</samplerate> <depth>16</depth> </samplecharacteristics> <channelcount>2</channelcount> </audio> </media> </file> <filter> <effect> <name>Basic Motion</name> <effectid>basic</effectid> <effectcategory>motion</effectcategory> <effecttype>motion</effecttype> <mediatype>video</mediatype> <parameter> <parameterid>scale</parameterid> <name>Scale</name> <valuemin>0</valuemin> <valuemax>1000</valuemax> <value>51</value> </parameter> <parameter> <parameterid>rotation</parameterid> <name>Rotation</name> <valuemin>-8640</valuemin> <valuemax>8640</valuemax> <value>0</value> </parameter> <parameter> <parameterid>center</parameterid> <name>Center</name> <value> <horiz>0</horiz> <vert>0</vert> </value> </parameter> <parameter> <parameterid>centerOffset</parameterid> <name>Anchor Point</name> <value> <horiz>0</horiz> <vert>0</vert> </value> </parameter> </effect> </filter> <sourcetrack> <mediatype>video</mediatype> </sourcetrack> <link> <linkclipref>CR7-CAM20001 </linkclipref> <mediatype>video</mediatype> <trackindex>1</trackindex> <clipindex>1</clipindex> </link> <fielddominance>none</fielddominance> </clipitem> <enabled>TRUE</enabled> <locked>FALSE</locked> </track> </video> </media> <ismasterclip>FALSE</ismasterclip></sequence></xmeml>\[/code\]Here is the second XML:\[code\]<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE xmeml><xmeml version="5"> <sequence> <name>test (Resolve)</name> <duration>661</duration> <rate> <timebase>24</timebase> <ntsc>true</ntsc> </rate> <in>-1</in> <out>-1</out> <timecode> <string>01:00:00:00</string> <frame>86400</frame> <displayformat>NDF</displayformat> <rate> <timebase>24</timebase> <ntsc>true</ntsc> </rate> </timecode> <media> <video> <track> <clipitem> <name>CR7-CAM20001</name> <duration>100</duration> <rate> <timebase>24</timebase> <ntsc>true</ntsc> </rate> <start>20</start> <end>114</end> <enabled>true</enabled> <in>3</in> <out>97</out> <file id="CR7-CAM20001 0"> <duration>100</duration> <rate> <timebase>24</timebase> <ntsc>true</ntsc> </rate> <name>V1-0001_CR7-CAM20001.mov</name> <pathurl>file:///Volumes/LONERANGER/Dreamstrong%20Vicksburg/04%20Dreamstrong%20Vicksburg%20Exports/Resolve%20Test/V1-0001_CR7-CAM20001.mov</pathurl> <timecode> <string>00:00:13:02</string> <frame>314</frame> <displayformat>NDF</displayformat> <rate> <timebase>24</timebase> <ntsc>false</ntsc> </rate> <reel> <name></name> </reel> </timecode> <media> <video> <duration>100</duration> <samplecharacteristics> <width>1920</width> <height>1080</height> </samplecharacteristics> </video> </media> </file> <alphatype>none</alphatype> <compositemode>normal</compositemode> <filter> <enabled>true</enabled> <effect> <name>Basic Motion</name> <effectid>basic</effectid> <effecttype>motion</effecttype> <mediatype>video</mediatype> <effectcategory>motion</effectcategory> <parameter> <name>Center</name> <parameterid>center</parameterid> <value> <horiz>0</horiz> <vert>0</vert> </value> </parameter> <parameter> <name>Anchor Point</name> <parameterid>centerOffset</parameterid> <value> <horiz>0</horiz> <vert>0</vert> </value> </parameter> <parameter> <name>Rotation</name> <parameterid>rotation</parameterid> <value>0</value> <valuemin>-8640</valuemin> <valuemax>8640</valuemax> </parameter> <parameter> <name>Scale</name> <parameterid>scale</parameterid> <value>51</value> <valuemin>0</valuemin> <valuemax>1000</valuemax> </parameter> </effect> </filter> </clipitem> <enabled>true</enabled> <locked>false</locked> </track> <format> <samplecharacteristics> <width>1920</width> <height>1080</height> <anamorphic>false</anamorphic> <pixelaspectratio>square</pixelaspectratio> <rate> <timebase>24</timebase> <ntsc>true</ntsc> </rate> <codec> <appspecificdata> <appname>Final Cut Pro</appname> <appmanufacturer>Apple Inc.</appmanufacturer> <data> <qtcodec> <codectypecode>apch</codectypecode> </qtcodec> </data> </appspecificdata> </codec> </samplecharacteristics> <appspecificdata> <appname>Final Cut Pro</appname> <appmanufacturer>Apple Inc.</appmanufacturer> <data> <fcpimageprocessing> <useyuv>true</useyuv> <usesuperwhite>false</usesuperwhite> <rendermode>Float10BPP</rendermode> </fcpimageprocessing> </data> </appspecificdata> </format> </video> </media> </sequence></xmeml>\[/code\]
 
Back
Top