Skip to main content
Participant
January 4, 2023
Question

Collecting Export Parameters from a Graph with the Python API

  • January 4, 2023
  • 1 reply
  • 649 views

I am working on a Python-based Exporter that will interface with our Version Control software and Content Management systems to Check Out, Add, and Configure Textures output by a Graph.


I have been able to get some rudimentary support for this working by adapting the code found here:

export module

sd.tools.export.exportSDGraphOutputs(aSDGraph, aOutputDir='', aFileExt='png')

Export the textures of the output node of the specified sSDGraph :param aSDGraph: The graph that contains the outputs to export :param aOutputDir: The output directory used to save the output’s images :return: True if succeed else False


However, this code doesn't seem to use the information defined in the Export Outputs... options.

Is it possible for me to Query the Destination, Pattern, Output State and Exported Color Space parameters with the Python API?

Thanks.

This topic has been closed for replies.

1 reply

Participant
January 4, 2023

I was able to discover that these values are stored in the SBS file, which is just XML. I suppose I could load the SBS with an XML library and parse it myself to look for the relevant data...

For example:

<option>
  <name v="export/fromGraph/pattern"/><value v="$(graph)_$(identifier)"/>
</option>


 

Participant
June 22, 2023

thats good to know 🙂 in my case i want to treat each output different, is it possible to run export per output so i can say one ouput is tga and other is png?