def setAllMetadata(): # print("Saving ALL metadata") for stream in storage.streams.keys(): # print(stream, getattr(storage.values, stream)) if storage.streams[stream] == "sanStringStruct": cmds.editMetadata(streamName=stream, channelName='mayaExporterReady', index=0, stringValue=getattr(storage.values, stream), scene=True) else: cmds.editMetadata(streamName=stream, channelName='mayaExporterReady', index=0, value=getattr(storage.values, stream), scene=True)
def __setitem__(self, key, value): if not self._hasStruct(): cmds.dataStructure( format='raw', asString='name={}:string=cross3dValue'.format(self._structureName)) # Note: Make sure the metadata channel exists cmds.addMetadata( structure=self._structureName, streamName=self._cross3dStream, channelName=self._channelName, indexType=self._indexType, scene=True) # Store the metadata cmds.editMetadata( streamName=self._cross3dStream, memberName=self._memberName, index=key, stringValue=self.escapeValue(value), scene=True) # Notify listening slots about the change self.emitChange()
def editMetadata(*args, **kwargs): res = cmds.editMetadata(*args, **kwargs) if not kwargs.get('query', kwargs.get('q', False)): res = _factories.maybeConvert(res, _general.PyNode) return res
def __delitem__(self, key): if not key in self: raise KeyError('{} is not stored in FileProps'.format(key)) cmds.editMetadata(streamName=self._cross3dStream, index=key, scene=True, remove=True)
def setExportName(): cmds.editMetadata(streamName='exportName', channelName='mayaExporterReady', index=0, stringValue=storage.values.exportName, scene=True)
def setUnityRefDir(): cmds.editMetadata(streamName='unityRefDir', channelName='mayaExporterReady', index=0, stringValue=storage.values.unityRefDir, scene=True)