abstractfactory/publish — pull request #34 by mottosso (2014-08-17 15:26:22+00:00)
Title: Separated extraction into plugin

The extraction process has been separated into plugins, similar to validators.

As a proof-of-concept, a "review" extractor has been implemented. It extracts a playblast from the scene, using selected cameras. Have a look at `resources/tests/selection/multiple_selection_test/maya/scenes/v001.ma` for an example.

Here are some specs:

- A playblast is extracted per included camera - in the included test-scene, there are two of them, one for the full body and one close-up for the face.
- Playblasting occurs off-screen, to avoid limits in resolution
- Settings are derived from the current Maya session - such as range and resolution.
- Settings are overridden by attaching attributes to the set, such as `startFrame`, `width`, `compression` etc.
- The plugin defines defaults for `compression` and `format` - i.e. 'image', and 'png' respectively.
- More plugins can be implemented to produce further outputs, both for playblasts (i.e. "review" family) and models or any other family.

Have a look at `plugins/extract_review.py` for details on the plugin.

## Usage

Once you open the scene above, hit File -> Publish and you will get an extracted model along with two turntable playblasts in your `published` directory. Keep the script editor open for details.

## Continued work

Selection is still an interesting area to make into a plugin, although I'm having issues in seeing how this can be done, as all other work depends on the selection. That is, selection defines `Instance` objects and thus works directly on the `Context` whereas validation and extraction works with `Instances` and its contained nodes.

The next step I think is to try and break apart the Maya-dependency of main.py as it really isn't necessary except for the selection. Though selection may not become a plugin (hoping you will prove me wrong, @BigRoy), it should in any case be insulated from Publish and bound to an integration such as Maya so as to facilitate additional hosts.