3.2. AbstractShapeDataExporter

Inherited by: ShapeDataExporter

3.2.1. Synopsis

3.2.1.1. Functions

3.2.1.2. Virtual functions

3.2.1.3. Static functions

3.2.1.4. Properties

3.2.2. Detailed Description

Abstract shape exporter class. Inherit the class to create own exporter formats. Method do_export must be overloaded.

class mocha.exporters.AbstractShapeDataExporter(name, extension[, number_of_data_streams=1[, export_multiple_shapes=false[, export_multiple_views=false[, export_open_splines=false[, export_interlaced=false[, program=""[, internal_name=""]]]]]]])
Parameters
  • name (str) – name of the exporter which will be displayed in the Export Shape Data dialog drop-down list.

  • extension (str) – e.g. “.txt”, used as a file filter in save file dialog.

  • number_of_data_streams (uint) – number of result files. If it equals to 1 then the Copy to Clipboard button will be enabled.

  • export_multiple_shapes (bool) – whether the exporter supports multiple shapes.

  • export_multiple_views (bool) – whether the exporter supports multiple views.

  • export_open_splines (bool) – whether the exporter supports open splines.

  • export_interlaced (bool) – whether the exporter supports interlaced footage.

  • progam – program name used as a group in the export dialog.

  • internal_name (str) – optional name used to register the exporter, i.e., the key that will be used in the dictionary returned by registered_exporters(). If none is provided, name will be used.

Create an exporter instance. The instance ownership is delegated to Python. To register the exporter inside mocha exporters system, call register() method. Before deleting the object unregisters itself. In order for the exporter to be shown in one of the existing program groups in the export dialog, the string returned from the corresponding static member function should be passed as program.

static AbstractShapeDataExporter.AfterEffects()
Return type

str

static AbstractShapeDataExporter.Combustion()
Return type

str

static AbstractShapeDataExporter.FinalCut()
Return type

str

static AbstractShapeDataExporter.Flame()
Return type

str

static AbstractShapeDataExporter.Fusion()
Return type

str

static AbstractShapeDataExporter.HitFilm()
Return type

str

static AbstractShapeDataExporter.MochaBlend()
Return type

str

static AbstractShapeDataExporter.Nuke()
Return type

str

static AbstractShapeDataExporter.Premiere()
Return type

str

static AbstractShapeDataExporter.Shake()
Return type

str

static AbstractShapeDataExporter.Silhouette()
Return type

str

AbstractShapeDataExporter.do_export(project, layers, shape_file_path, views)
Return type

Dictionary with keys of type QString and values of type QByteArray.

Parameters
  • project (Project) – mocha project instance.

  • layers (list of Layer) – list of layers to export.

  • shape_file_path (str) – absolute file path to save which has been chosen by a user in a file dialog.

  • views (list of View) – list of views to export (if the exporter supports multi-view exporting).

Returns

dict of {file_name: QByteArray}

Performs main exporter operations. Must return a map (dict) of absolute file path and appropriate contents. The exporter should not create those files.

AbstractShapeDataExporter.error_string()
Return type

str

AbstractShapeDataExporter.register()

Registers the exporter instance inside mocha exporters system.

static AbstractShapeDataExporter.registered_exporters()
Return type

Dictionary with keys of type QString and values of type ShapeDataExporter.

Returns

dict of {str: ShapeDataExporter}

Returns a dict of registered exporters including custom user exporters.

AbstractShapeDataExporter.unregister()

Unregisters the exporter instance inside mocha exporters system.

AbstractShapeDataExporter.exports_multiple_shapes
Type

bool

Access

read-only Whether the exporter supports multiple shapes.

AbstractShapeDataExporter.exports_multiple_views
Type

bool

Access

read-only Whether the exporter supports multiple views.

AbstractShapeDataExporter.exports_open_splines
Type

bool

Access

read-only Whether the exporter supports open splines.

AbstractShapeDataExporter.exports_interlaced
Type

bool

Access

read-only Whether the exporter supports interlaced footage.

AbstractShapeDataExporter.registered
Type

bool

Access

read-only Whether the exporter registered.