Help with Importing Illustrator Paths as Polygons into Resolume Arena

FFGL, OSC, GLSL. If you like abbreviations, this is the forum for you
Post Reply
strelle
Met Resolume in a bar the other day
Posts: 1
Joined: Sun Mar 24, 2024 22:55

Help with Importing Illustrator Paths as Polygons into Resolume Arena

Post by strelle »

Hello Resolume Community,

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
})();
I have several questions and would greatly appreciate any insights or advice from the community:

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!

yannick.fullrez
Met Resolume in a bar the other day
Posts: 3
Joined: Fri Jan 26, 2024 23:53
Location: Berlin, Germany

Re: Help with Importing Illustrator Paths as Polygons into Resolume Arena

Post by yannick.fullrez »

Hey there,
just skimming the snippet I can already tell that the .xml your script generates does not represent the Resolume data structure close enough, that's why Resolume doesn't do anything with it. It's not a valid mapping file.

To find out and learn about the data just create yourself an advanced output mapping with some paths (input masks) in Resolume and then use this file as a reference and learn from it.

Everything you need to get it working + the answers to your questions will be in that file :)

Post Reply