I'm working on a project where I need to import paths from Adobe Illustrator as polygons into Resolume Arena, but I'm facing challenges getting Resolume to correctly recognize and display the imported XML data. I've developed a script in Illustrator to export the paths to an XML format that I thought Resolume would understand, but upon import, nothing happens in Resolume.
Here's the core part of the script I'm using for the export:
Code: Select all
(function() {
function extractPaths(doc) {
var paths = [];
for (var i = 0; i < doc.pathItems.length; i++) {
paths.push(doc.pathItems[i]);
}
return paths;
}
function convertPathsToResolumeXml(paths, docName) {
var xml = '<?xml version="1.0" encoding="utf-8"?>\n<XmlState name="' + docName + '">\n\t<ScreenSetup name="ScreenSetup">\n\t\t<screens>\n';
paths.forEach(function(path, index) {
xml += '\t\t\t<Screen name="Slice' + (index + 1) + '" uniqueId="' + (Date.now() + index) + '">\n\t\t\t\t<Polygon name="Polygon' + (index + 1) + '">\n';
var pathPoints = path.pathPoints;
for (var j = 0; j < pathPoints.length; j++) {
var point = pathPoints[j].anchor;
xml += '\t\t\t\t\t<Point X="' + point[0] + '" Y="' + point[1] + '" />\n';
}
xml += '\t\t\t\t</Polygon>\n\t\t\t</Screen>\n';
});
xml += '\t\t</screens>\n\t</ScreenSetup>\n</XmlState>';
return xml;
}
var doc = app.activeDocument;
var paths = extractPaths(doc);
var xml = convertPathsToResolumeXml(paths, doc.name);
// Code to save XML omitted for brevity
})();
Are all necessary elements and attributes included in the XML for Resolume to recognize and display the imported data correctly?
Does the structure of the polygons in the XML meet Resolume's requirements for processing and displaying them?
Are there specific attributes for polygons or other configurations I'm missing that are critical for Resolume?
How does Resolume handle identification and naming of elements like screens and polygons? Is there a naming scheme or unique identifiers I should be aware of?
Are there compatibility issues with certain versions of Resolume Arena that I should consider?
I've tried to follow the documentation and examples as closely as possible, but it seems I'm missing something crucial for a successful import. Any guidance, examples of correct XML structures, or insights into how Resolume processes these imports would be immensely helpful.
Thank you in advance for your time and assistance!