maya.base#

Maya-specific methods and values.

Classes:

MayaProperties([parent])

Utility class used to interface with values stored in the bookmark item's database.

Functions:

apply_default_render_values()

Sets the default render values for the current scene.

capture_viewport_destination()

Returns a tuple of destination parameters.

find_project_folder(key)

Return the relative path of a project folder.

get_framerate()

Returns the value of the current frame-rate enum.

get_geo_sets()

The main function responsible for returning the user created object sets from the current Maya scene.

is_scene_modified()

If the current scene was modified since the last save, the user will be prompted to save the scene.

patch_workspace_file_rules()

Patches the current maya workspace to use the directories defined in the active bookmark item's token configuration.

report_export_progress(start, current, end, ...)

A litle progress report get some export feedback.

sanitize_namespace(s)

Converts the input string so that it can be safely used as a file name.

set_endframe(frame)

Sets the scene's animation end time.

set_framerate(fps)

Sets the frame-rate speed of the current scene.

set_render_resolution(width, height)

Sets the render resolution of the current scene.

set_startframe(frame)

Sets the scene's animation start time.

Data:

AGNOSTIC_CAPTURE_FILE

Default capture agnostic publish file name template

CACHE_LAYER_PATH

Default cache destination template

CACHE_PATH

Default cache export path template

CAPTURE_DESTINATION

Default capture destination path template

CAPTURE_FILE

Default capture file path template

CAPTURE_PUBLISH_DIR

Default capture agnostic publish path template

CameraOptions

Default camera display options

CaptureOptions

Default camera capture options

DEFAULT_CACHE_DIR

Default cache directory template

DEFAULT_CAPTURE_DIR

Viewport capture direction name

DefaultPadding

Default frame padding

DisplayOptions

Default viewport display options

EXPORT_FILE_RULES

Workspace file format rules

MAYA_FPS

Maya frame-rate enum definitions

RENDER_NAME_TEMPLATE

Default render template

class bookmarks.maya.base.MayaProperties(parent=None)[source]#

Bases: object

Utility class used to interface with values stored in the bookmark item’s database.

Methods:

get_info()

Returns an informative text about the current Maya properties.

init_data(server, job, root, asset)

Initializes the maya properties instance.

Attributes:

endframe

A current end-frame value.

framerate

A current frame-rate value.

height

A current height value.

startframe

A current start-frame value.

width

A current width value.

get_info()[source]#

Returns an informative text about the current Maya properties.

init_data(server, job, root, asset)[source]#

Initializes the maya properties instance.

property endframe#

A current end-frame value.

If the asset has an explicit out frame set that is bigger than the start frame we’ll use that value instead.

property framerate#

A current frame-rate value.

property height#

A current height value.

property startframe#

A current start-frame value.

property width#

A current width value.

bookmarks.maya.base.apply_default_render_values()[source]#

Sets the default render values for the current scene.

bookmarks.maya.base.capture_viewport_destination()[source]#

Returns a tuple of destination parameters.

bookmarks.maya.base.find_project_folder(key)[source]#

Return the relative path of a project folder.

Parameters

key (str) – The name of a Maya project folder name, e.g. ‘sourceImages’.

Returns

The name of the folder that corresponds with key.

Return type

str

bookmarks.maya.base.get_framerate()[source]#

Returns the value of the current frame-rate enum.

bookmarks.maya.base.get_geo_sets()[source]#

The main function responsible for returning the user created object sets from the current Maya scene. There’s an extra caveat: the set has to contain the word ‘GEO_SUFFIX’ to be considered valid.

Returns

A dict of set name / mesh list pairs.

Return type

dict

bookmarks.maya.base.is_scene_modified()[source]#

If the current scene was modified since the last save, the user will be prompted to save the scene.

bookmarks.maya.base.patch_workspace_file_rules()[source]#

Patches the current maya workspace to use the directories defined in the active bookmark item’s token configuration.

bookmarks.maya.base.report_export_progress(start, current, end, start_time)[source]#

A litle progress report get some export feedback.

bookmarks.maya.base.sanitize_namespace(s)[source]#

Converts the input string so that it can be safely used as a file name. Any namespace will be enclosed in brackets and the ‘:’ characters will be replaced with underscores.

Parameters

s (str) – A string that contains namespace names.

Returns

The sanitized string.

Return type

str

bookmarks.maya.base.set_endframe(frame)[source]#

Sets the scene’s animation end time.

Parameters

frame (int) – The end frame.

bookmarks.maya.base.set_framerate(fps)[source]#

Sets the frame-rate speed of the current scene.

bookmarks.maya.base.set_render_resolution(width, height)[source]#

Sets the render resolution of the current scene.

bookmarks.maya.base.set_startframe(frame)[source]#

Sets the scene’s animation start time.

Parameters

frame (int) – The start frame.

bookmarks.maya.base.AGNOSTIC_CAPTURE_FILE = '{workspace}/{capture_folder}/latest/{asset}_capture_{frame}.{ext}'#

Default capture agnostic publish file name template

bookmarks.maya.base.CACHE_LAYER_PATH = '{workspace}/{export_dir}/{set}/{set}_{layer}.{ext}'#

Default cache destination template

bookmarks.maya.base.CACHE_PATH = '{workspace}/{export_dir}/{set}/{set}.{ext}'#

Default cache export path template

bookmarks.maya.base.CAPTURE_DESTINATION = '{workspace}/{capture_folder}/{scene}/{scene}'#

Default capture destination path template

bookmarks.maya.base.CAPTURE_FILE = '{workspace}/{capture_folder}/{scene}/{scene}.{frame}.{ext}'#

Default capture file path template

bookmarks.maya.base.CAPTURE_PUBLISH_DIR = '{workspace}/{capture_folder}/latest'#

Default capture agnostic publish path template

bookmarks.maya.base.CameraOptions = {'depthOfField': False, 'displayFieldChart': False, 'displayFilmGate': False, 'displayFilmOrigin': False, 'displayFilmPivot': False, 'displayGateMask': False, 'displayResolution': False, 'displaySafeAction': False, 'displaySafeTitle': False, 'overscan': 1.0}#

Default camera display options

bookmarks.maya.base.CaptureOptions = {'cameras': False, 'controlVertices': False, 'deformers': False, 'dimensions': False, 'displayAppearance': 'smoothShaded', 'dynamicConstraints': False, 'dynamics': False, 'fluids': False, 'follicles': False, 'grid': False, 'hairSystems': False, 'handles': False, 'headsUpDisplay': False, 'hulls': False, 'ikHandles': False, 'imagePlane': False, 'joints': False, 'lights': False, 'locators': False, 'manipulators': False, 'motionTrails': False, 'nCloths': False, 'nParticles': False, 'nRigids': False, 'nurbsCurves': False, 'nurbsSurfaces': False, 'pivots': False, 'planes': True, 'polymeshes': True, 'selectionHiliteDisplay': False, 'strokes': False, 'subdivSurfaces': True, 'wireframeOnShaded': False}#

Default camera capture options

bookmarks.maya.base.DEFAULT_CACHE_DIR = '{export_dir}/{ext}'#

Default cache directory template

bookmarks.maya.base.DEFAULT_CAPTURE_DIR = 'capture'#

Viewport capture direction name

bookmarks.maya.base.DefaultPadding = 4#

Default frame padding

bookmarks.maya.base.DisplayOptions = {'background': (0.5, 0.5, 0.5), 'backgroundBottom': (0.4, 0.4, 0.4), 'backgroundTop': (0.6, 0.6, 0.6), 'displayGradient': True}#

Default viewport display options

bookmarks.maya.base.EXPORT_FILE_RULES = {'Alembic': 'abc', 'Arnold-USD': 'usd', 'OBJ': 'obj', 'OBJexport': 'obj', 'USD Export': 'usd', 'USD Import': 'usd', 'alembic export': 'abc', 'alembic import': 'abc', 'alembicCache': 'abc', 'alembicexport': 'abc', 'alembicimport': 'abc', 'ass export': 'ass', 'ass import': 'ass', 'assexport': 'ass', 'fbx export': 'fbx', 'fbx import': 'fbx', 'fbxexport': 'fbx', 'fbximport': 'fbx', 'obj export': 'obj', 'obj import': 'obj', 'objexport': 'obj', 'objimport': 'obj'}#

Workspace file format rules

bookmarks.maya.base.MAYA_FPS = {'100fps': 100.0, '10fps': 10.0, '1200fps': 1200.0, '120fps': 120.0, '12fps': 12.0, '1500fps': 1500.0, '16fps': 16.0, '2000fps': 2000.0, '200fps': 200.0, '20fps': 20.0, '23.976fps': 23.976, '240fps': 240.0, '250fps': 250.0, '29.97df': 29.976, '29.97fps': 29.976, '2fps': 2.0, '3000fps': 3000.0, '300fps': 300.0, '3fps': 3.0, '400fps': 400.0, '40fps': 40.0, '44100fps': 44100.0, '47.952fps': 47.952, '48000fps': 48000.0, '4fps': 4.0, '500fps': 500.0, '59.94fps': 59.94, '5fps': 5.0, '6000fps': 6000.0, '600fps': 600.0, '6fps': 6.0, '750fps': 750.0, '75fps': 75.0, '8fps': 8.0, 'film': 24.0, 'game': 15.0, 'hour': 0.0002777777777777778, 'millisec': 1000.0, 'min': 0.0166667, 'ntsc': 30.0, 'ntscf': 60.0, 'pal': 25.0, 'palf': 50.0, 'sec': 1.0, 'show': 48.0}#

Maya frame-rate enum definitions

bookmarks.maya.base.RENDER_NAME_TEMPLATE = '<RenderLayer>/<Version>/<RenderPass>/<RenderLayer>_<RenderPass>_<Version>'#

Default render template