How do you REMOVE a Metadata stream/channel on a node?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm trying to add metadata to a curve node using dataStructure and addMetadata commands. It seems I can create the data okay, but I can't seem to figure out how to remove or delete a channel stream from a node that it has already been applied to. I can delete specific indexed entries using the editMetadata command, but the metadata stream and channel still exists on the node.
Here's an example:
# create a test poly plane
plane = cmds.polyPlane(w=1, h=1, sx=1, sy=1, ch=False)
shape = cmds.listRelatives(plane, shapes=True)[0]
# Create data structure
struct = cmds.dataStructure(format='raw', asString='name=MetaColor:float[3]=Color')
# Apply structure to plane vertices via a new stream
cmds.addMetadata(shape, structure=struct, streamName='NewStream', channelName='vertex')
# give it some color metadata
colorList = (1,.7,0),(1,0,0),(0,.3,1),(.5,1,0)
for n,color in enumerate(colorList):
cmds.editMetadata(shape, streamName='NewStream', memberName='Color', channelName='vertex', index=n, value=color)
# display it (vp2.0 only):
cmds.showMetadata(shape, stream="NewStream", member="Color", dataType="float[3]", method="color")
Now how do I delete/remove NewStream from the polyPlane?
I can delete all four index values using the editMetadata command, but the stream still persists on the mesh, just empty. If I save the scene the empty stream persists in the ASCII scene data, and if I later delete the MetaColor data structure, the stream still persists and then throws several errors whenever the scene is opened.
I've checked the docs and there doesn't seem to be any mention of how to remove a named stream from a node. Anyone got any ideas?