With the announcement made at SIGGRAPH 2012, there is something important to note about the Extension release! Unlike past releases, this one will not be binary compatible with its major release. In the past, a hotfix, Service Pack, and Extension release were binary compatible with their respective major release; that's not the case this time!
The Maya 2012 Extension release is binary compatible with the Maya 2012 major release, which means C++ plug-ins compiled using the Maya 2012 devkit can be loaded in the Maya 2012 Extension release. Developers do not need to recompile their plug-ins to work in the Extension release.
Unfortunately, the internal changes required for the Maya 2013 Extension release made that compatibility impossible to maintain. This means, Maya C++ plug-in developers will need to recompile their plug-ins to work in Maya 2013 Extension release using the new devkit from the Extension release.
Python® plug-ins aren't affected by the changes, but developers may have to do code changes depending on the API they are using.
New API and API changes:NOTE: This list is not exhaustive. It only covers those changes and additions which are likely to be of most interest to API users.
New API for reference edits
- MItEdits allows you to interate through a scene's reference edits. MEdit, MAddRemoveAttrEdit, MConnectDisconnectAttrEdit, MFcurveEdit, MParentingEdit and MSetAttrEdit provide methods for querying information about specific types of edits.
- MFnReference has been added to allow you to query individual file references.
- MFnDependencyNode::isTrackingEdits() can be used to determine if a reference node or assembly is tracking edits.
- New edit-related message types have been added to MSceneMessage: kBeforeLoadReferenceAndRecordEdits, kAfterLoadReferenceAndRecordEdits, kBeforeCreateReferenceAndRecordEdits, kAfterCreateReferenceAndRecordEdits.
New API for scene assemblies
- MFnAssembly can be used to query and modify assembly nodes, which are used to manage the various representations of a scene asset.
- MPxAssembly can be used to create custom assembly types
- MPxRepresentation can be used to create custom representations.
New API for generic metadata (blind data)
- A number of classes have been added to create and operate on streams of generic data. Look in the API Reference for classes in the "adsk::Data" namespace (e.g. adsk::Data::Stream, adsk::Data::Channel).
- setMetadata() and deleteMetadata() methods have been added to MDGModifier.
- setMetadata(), deleteMetadata(), metadata() and validateMetadata() methods have been added to MFnDependencyNode.
- The writesMetadata() virtual method has been added to MPxMayaAsciiFilter.
New API for URIs (Uniform Resource Identifiers)
- The MURI class can be used to create URIs as well as query and modify the various components of a URI.
- MPxFileResolver can be used to create custom handlers to resolve specific URI schemes.
Viewport Rendering API Changes
- DirectX11 support: kDirectX11 has been added to the DrawAPI enum. MRenderer::drawAPI() will return kDirectX11 if the current renderer supports DirectX11. If the drawing API is kDirectX11 then MRenderer::GPUDeviceHandle() will return a point to the DirectX device. Custom overrides derived from MPxDrawOverride, MPxGeometryOverride, MPxShaderOverride andMRenderOverride can indicate that they support DirectX11 by including kDirectX11 in the bitmap returned by their supportedDrawAPIs() methods.
- MRenderItem consolidation: When multiple objects are compatible, their geometry can be consolidated into a single MRenderItem, to provide better performance by concatening their index and vertex buffers. isConsolidated() returns true if the MRenderItem contains multiple objects and sourceIndexMapping() will return an MGeometryIndexMapping instance which describes how they have been consolidated into the buffers.
- Custom display filters: MFnPlugin::registerDisplayFilter() has been added to allow the creation of new object filters which will show up on the viewport's 'Show' menu. setPluginDisplay() andpluginObjectDisplay() have been added to M3dView to control and query the state of these filters. MDrawInfo::pluginObjectDisplayStatus() has been added to provide that information to plugin shapes.
- GPU-based gamma correction (aka "sRGB write"): MRenderTargetManager::formatSupportsSRGBWrite() has been added to determine if a given raster format supports GPU-based gamma correction and MRenderOperation::enableSRGBWrite() has been added to enable it for a given operation.
- Explicit binding of shader effects. MShaderInstance now allows explicit control over the binding of shader effects (e.g. cgfx or fx files) via its new bind() and unbind() methods. getPassCount() andactivatePass() can be used to determine which passes are enabled in the effect and updateParameters() can be used to update parameters with the overhead of rebinding.
- MPxPrimitiveGenerator has been added to allow the creation of new primitive types which can be used by MPxShaderOverride or by a custom renderer.
- MPxVertexBufferMutator has been added to allow the manipulation of custom vertex streams.
- MPxIndexBufferMutator has been added to allow the manipulation of custom index buffers.
- MRenderUtilities has been added to provide various utility functions for viewport rendering, such as setting the swatch background color, retrieving the draw contexts for swatches and the texture editor, and blitting a target to OpenGL or an MImage.
- setAllowsUnorderedAccess() and allowsUnorderedAccess() have been added to MRenderTargetDescription to set and query whether a target supports simultaneous read/write access to its data by multiple threads.
- MDrawContext::getPassContext() has been added to return information about the current render pass. It returns an instance of the new MPassContext class.
- lightType() and lightPath() methods haved been added to MLightParameterInformation, and several other methods have been added to work with StockParameterSemantics.
- MGeometryUtilities::acquireReferenceGeometry() has been added to return geometry for default reference primitives such as sphere, cube and plane. The caller is responsible for usingMGeometryUtilities::releaseReferenceGeometry() to release the geometry when done with it.
- MVertexBufferArray has been added to allow arrays of MVertexBuffers to be passed between API methods.
- EXT_frame_buffer_object support has been added to MGLdefinitions
- map() and unmap() have been added to MIndexBuffer and MVertexBuffer to provide read-only access to their buffers' contents.
- resourceHandle() methods have been added to MIndexBuffer and MVertexBuffer to set and retrieve graphics device dependent handles to hardware buffers. hasCustomResourceHandle() can be used to determine if a custom resource handle has been set.
- castsShadows() methods have been added to MRenderItem to query and modify whether the item casts shadows. receivesShadows() methods have been added to do the same for receiving shadows.
- getEffectsBufferShader() has been added to MShaderManager. It performs the same function as getEffectsFileShader() except that the source code for the effect is contained in a memory buffer rather than a file.
- rawData() has been added to MRenderTarget and MTexture to return a copy of their currently mapped data.
- Instances of the following classes can no longer be deleted directly but must instead be released using the appropriate method from the corresponding manager class:
Instance Type Release Method MBlendState MStateManager::releaseBlendState(). MDepthStencilState MStateManager::releaseDepthStencilState(). MRasterizerState MStateManager::releaseRasterizerState(). MRenderTarget MRenderTargetManager::releaseRenderTarget(). MSamplerState MStateManager::releaseSamplerState(). MShaderInstance MShaderManager::releaseShader(). MTexture MTextureManager::releaseTexture().
- MFnFloatArrayData has been added to complement the set of array data types which can be passed through a connection.
- MLibrary::cleanup() now takes an optional 'exitWhenDone' parameter. Setting this to false allows control to return to the caller rather than forcing the application to exit.