pymel.core.nodetypes.EditMetadata

Inheritance diagram of EditMetadata

class EditMetadata(*args, **kwargs)

class counterpart of mel function editMetadata

This command is used to set metadata elements onto or remove metadata elements from an object. Before using this command you must first attach a metadata stream type to the object using the addMetadatacommand or an API equivalent. The command has four basic variations: Set per-component metadata on meshesRemove per-component metadata on meshesSet generic metadata on any objectRemove generic metadata on any objectThe difference between the setand removevariations (1,3 vs. 2,4) is that setrequires both a member name to be set and a new value to be set. (The reason removal doesn’t use a member name is that you can only remove an entire metadata structural element, you cannot remove only a single member from it.) When metadata values are set or removed the action is performed on every selected component or index. This provides an easy method to set or remove a bunch of metadata en masse. The general usage (variations 3, 4) lets you select specific pieces of metadata through the channelNameand indexflags. Note that since indexis a multi-use flag you can select many different elements from the same Channel and set or remove the metadata on all of them in one command. Metadata on meshes is special in that the Channel types “vertex”, “edge”, “face”, and “vertexFace” are directly connected to the components of the same name. To make setting these metadata Channels easier you can simply select or specify on the command line the corresponding components rather than using the channelNameand indexflags. For example the selection “myMesh.vtx[8:10]” corresponds to channelName = vertexand index = 8, 9, 10(as a multi-use flag). Note that the metadata is assigned to an object and except in the special case of mesh geometry does not flow through the dependency graph. In meshes the metadata will move from node to node wherever the geometry is connected, although it will not adjust itself automatically for changes in topology. Internal data is arranged to minimize the amount of copying no matter how many other nodes are connected to it. Only a single node or scene, component type, channel type, and value type are allowed in a single command. This keeps the data simple at the possible cost of requiring multiple calls to the command to set more than one structure member’s value. Certain nodes have metadata supplied by input attributes. If you edit one of those with an incoming connection on such an attribute then the metadata edit will not be applied directly it will be put into an ‘editMetadata’ node for application during DG evaluation. Since the details of the metadata are not known until the evaluation happens less rigorous compatibility checking is performed. The editMetadata node has its own facilities for verifying and reporting illegal metadata edits. Successive edits to the same metadata in this way appends each edit to the same editMetadata node.

MAttrClass = Enum( EnumValue('MAttrClass', 1, 'localDynamicAttr'), EnumValue('MAttrClass', 2, 'normalAttr'), EnumValue('MAttrClass', 3, 'extensionAttr'), EnumValue('MAttrClass', 4, 'invalidAttr'))
MdgTimerMetric = Enum( EnumValue('MdgTimerMetric', 0, '_callback'), EnumValue('MdgTimerMetric', 1, '_compute'), EnumValue('MdgTimerMetric', 2, '_dirty'), EnumValue('MdgTimerMetric', 3, '_draw'), EnumValue('MdgTimerMetric', 4, '_fetch'), EnumValue('MdgTimerMetric', 5, '_callbackViaAPI'), EnumValue('MdgTimerMetric', 6, '_callbackNotViaAPI'), EnumValue('MdgTimerMetric', 7, '_computeDuringCallback'), EnumValue('MdgTimerMetric', 8, '_computeNotDuringCallback'))
MdgTimerState = Enum( EnumValue('MdgTimerState', 0, 'off'), EnumValue('MdgTimerState', 1, 'on'), EnumValue('MdgTimerState', 2, 'uninitialized'), EnumValue('MdgTimerState', 3, 'invalidState'))
MdgTimerType = Enum( EnumValue('MdgTimerType', 0, '_self'), EnumValue('MdgTimerType', 1, '_inclusive'), EnumValue('MdgTimerType', 2, '_count'))
getChannelName(**kwargs)

Filter the metadata selection to only recognize metadata belonging to the specified named Channel (e.g. “vertex”). This flag is ignored if the components on the selection list are being used to specify the metadata of interest. In query mode, this flag can accept a value.

Derived from mel command maya.cmds.editMetadata

getChannelType(**kwargs)

Obsolete - use the ‘channelName’ flag instead. In query mode, this flag can accept a value.

Derived from mel command maya.cmds.editMetadata

getIndex(**kwargs)

In the typical case metadata is indexed using a simple integer value. Certain types of data may use other index types. e.g. a “vertexFace” component will use a “pair” index type, which is two integer values; one for the face ID of the component and the second for the vertex ID. The indexflag takes a string, formatted in the way the specified indexTyperequires. All uses of the indexflag have the same indexType. If the type was not specified it is assumed to be a simple integer value. In query mode, this flag can accept a value.

Derived from mel command maya.cmds.editMetadata

getIndexType(**kwargs)

Name of the index type the new Channel should be using. If not specified this defaults to a simple integer index. Of the native types only a mesh “vertexFace” channel is different, using a “pair” index type. In query mode, this flag can accept a value.

Derived from mel command maya.cmds.editMetadata

getScene(**kwargs)

Use this flag when you want to add metadata to the scene as a whole rather than to any individual nodes. If you use this flag and have nodes selected the nodes will be ignored and a warning will be displayed.

Derived from mel command maya.cmds.editMetadata

getStreamName(**kwargs)

Name of the metadata Stream. Depending on context it could be the name of a Stream to be created, or the name of the Stream to pass through the filter. In query mode, this flag can accept a value.Flag can appear in Create mode of commandFlag can have multiple arguments, passed either as a tuple or a list.

Derived from mel command maya.cmds.editMetadata

Previous topic

pymel.core.nodetypes.DynamicConstraint

Next topic

pymel.core.nodetypes.Entity

Core

Core Modules

Other Modules

This Page