3.2. AbstractCameraSolveExporter¶
Inherited by: CameraSolveExporter
3.2.1. Synopsis¶
3.2.1.1. Functions¶
- def register ()
- def unregister ()
3.2.1.2. Virtual functions¶
- def do_export (project, layers, camera_file_path, time, views)
- def error_string ()
3.2.1.3. Static functions¶
- def registered_exporters ()
3.2.1.4. Properties¶
- property exports_multiple_views [read-only] of bool
- property registered [read-only] of bool
3.2.2. Detailed Description¶
Abstract camera solve exporter class. Inherit the class to create own exporter formats. Method do_export must be overloaded.
- class mocha.exporters.AbstractCameraSolveExporter(name, extension[, number_of_data_streams=1[, export_multiple_views=false]])¶
Parameters: - name (unicode) – name of the exporter which will be displayed in the Export Camera Data dialog drop-down list. Should contain a file mask in brackets e.g. Foo (*.bar)
- extension (unicode) – additional extension.
- number_of_data_streams (PySide2.QtCore.uint) – number of result files. If it equals to 1 then the Copy to Clipboard button will be enabled.
- export_multiple_views (PySide2.QtCore.bool) – whether the exporter supports multiple views.
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.
- AbstractCameraSolveExporter.do_export(project, layers, camera_file_path, time, views)¶
Return type: Dictionary with keys of type QString and values of type QByteArray.
Parameters: - project (mocha.project.Project) – mocha project instance.
- layers (list of Layer) – list of layers to export.
- camera_file_path (unicode) – absolute file path to save which has been chosen by a user in a file dialog.
- time (PySide2.QtCore.double) – frame index.
- views (list of View) – list of views to export.
Return type: 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.
- AbstractCameraSolveExporter.error_string()¶
Return type: unicode
- AbstractCameraSolveExporter.register()¶
Registers the exporter instance inside mocha exporters system.
- static AbstractCameraSolveExporter.registered_exporters()¶
Return type: Dictionary with keys of type QString and values of type CameraSolveExporter. Return type: dict of {str: CameraSolveExporter} Returns a dict of registered exporters including custom user exporters.
- AbstractCameraSolveExporter.unregister()¶
Unregisters the exporter instance inside mocha exporters system.
- AbstractCameraSolveExporter.exports_multiple_views¶
Type: bool Access: read-only Whether the exporter supports multiple views.
- AbstractCameraSolveExporter.registered¶
Type: bool Access: read-only Whether the exporter registered.