All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UsdMayaEditUtil Class Reference

Utility class for handling edits on Assemblies in Maya. More...

Classes

struct  AssemblyEdit
 A struct containing the data and associated string for an edit. More...
 

Public Types

using AssemblyEditVec = std::vector< AssemblyEdit >
 An ordered list of sequential edits. More...
 
using PathEditMap = std::map< SdfPath, AssemblyEditVec >
 An ordered list of sequential edits for multiple paths, sorted by path. More...
 
using AvarValueMap = std::map< std::string, double >
 An ordered map of concatenated Avar edits. More...
 
using PathAvarMap = std::map< SdfPath, AvarValueMap >
 An ordered map of concatenated Avar edits for multiple paths, sorted by path. More...
 
Enums for inspecting edits
enum  EditOp { OP_TRANSLATE, OP_ROTATE, OP_SCALE }
 Possible operations for a supported edit. More...
 
enum  EditSet { SET_ALL = -1, SET_X = 0, SET_Y = 1, SET_Z = 2 }
 Whether the edit affects one component or all components. More...
 

Static Public Member Functions

static PXRUSDMAYA_API bool GetEditFromString (const MFnAssembly &assemblyFn, const std::string &editString, SdfPath *outEditPath, AssemblyEdit *outEdit)
 Translates an edit string into a AssemblyEdit structure. More...
 
static PXRUSDMAYA_API void GetEditsForAssembly (const MObject &assemblyObj, PathEditMap *assemEdits, std::vector< std::string > *invalidEdits)
 Inspects all edits on assemblyObj and returns a parsed set of proper edits in assemEdits and invalid edits in invalidEdits. More...
 
static PXRUSDMAYA_API void ApplyEditsToProxy (const PathEditMap &assemEdits, const UsdPrim &proxyRootPrim, std::vector< std::string > *failedEdits)
 Apply the assembly edits in assemEdits to the USD prim proxyRootPrim, which is the root prim for the assembly. More...
 
static PXRUSDMAYA_API void GetAvarEdits (const PathEditMap &assemEdits, PathAvarMap *avarMap)
 

Detailed Description

Utility class for handling edits on Assemblies in Maya.

Definition at line 49 of file editUtil.h.


Class Documentation

struct UsdMayaEditUtil::AssemblyEdit

A struct containing the data and associated string for an edit.

Definition at line 75 of file editUtil.h.

Class Members
string editString
EditOp op
EditSet set
VtValue value

Member Typedef Documentation

using AssemblyEditVec = std::vector<AssemblyEdit>

An ordered list of sequential edits.

Definition at line 87 of file editUtil.h.

using AvarValueMap = std::map<std::string, double>

An ordered map of concatenated Avar edits.

Definition at line 93 of file editUtil.h.

using PathAvarMap = std::map<SdfPath, AvarValueMap>

An ordered map of concatenated Avar edits for multiple paths, sorted by path.

Definition at line 97 of file editUtil.h.

using PathEditMap = std::map<SdfPath, AssemblyEditVec>

An ordered list of sequential edits for multiple paths, sorted by path.

Definition at line 90 of file editUtil.h.

Member Enumeration Documentation

enum EditOp

Possible operations for a supported edit.

Definition at line 57 of file editUtil.h.

enum EditSet

Whether the edit affects one component or all components.

The values are explicit, such that X,Y,and Z can be used in [] operators on Vec3s.

Definition at line 67 of file editUtil.h.

Member Function Documentation

static PXRUSDMAYA_API void ApplyEditsToProxy ( const PathEditMap assemEdits,
const UsdPrim proxyRootPrim,
std::vector< std::string > *  failedEdits 
)
static

Apply the assembly edits in assemEdits to the USD prim proxyRootPrim, which is the root prim for the assembly.

If failedEdits is not nullptr, it will contain any edits that could not be applied to proxyRootPrim.

static PXRUSDMAYA_API bool GetEditFromString ( const MFnAssembly &  assemblyFn,
const std::string &  editString,
SdfPath outEditPath,
AssemblyEdit outEdit 
)
static

Translates an edit string into a AssemblyEdit structure.

The output edit path is relative to the root of the assembly.

Returns
true if translation was successful.
static PXRUSDMAYA_API void GetEditsForAssembly ( const MObject &  assemblyObj,
PathEditMap assemEdits,
std::vector< std::string > *  invalidEdits 
)
static

Inspects all edits on assemblyObj and returns a parsed set of proper edits in assemEdits and invalid edits in invalidEdits.

The proper edits are keyed by relative path to the root of the assembly.


The documentation for this class was generated from the following file: