vrMetadataService¶
-
class
vrMetadataService
¶
(Inherits vrBaseService
)
The metadata service provides functions for managing metadata.
Summary¶
- Functions:
- addTags(objects, tags)
- assignSets(metadataSets, objects)
- copyEntries(entries)
- copySets(metadataSets)
- createSet(name, objects) → vrdMetadataSet
- deleteSets(metadataSets)
- duplicateSets(metadataSets) → List[vrdMetadataSet]
- findSets(name) → List[vrdMetadataSet]
- getActiveStringLibraryIndex() → integer
- getAllKeys() → List[string]
- getAllSets() → List[vrdMetadataSet]
- getAllShareableSets() → List[vrdMetadataSet]
- getAllTags() → List[string]
- getEntriesClipboard() → List[vrdMetadataEntry]
- getMaterialTags() → Dict[string,List[]]
- getMetadata(object) → vrdMetadata
- getObjectsWithMetadata(type) → List[vrdSceneObject]
- getObjectsWithTag(tag) → List[vrdSceneObject]
- getScenegraphTags() → Dict[string,List[]]
- getSelection() → List[vrdObject]
- getSetsClipboard() → List[vrdMetadataSet]
- getStringLibraries() → List[string]
- getTags(objects) → List[string]
- getUniqueSetName(name) → string
- hasMetadata(object) → bool
- hasTag(object, tag) → bool
- isEntriesClipboardEmpty() → bool
- isSetsClipboardEmpty() → bool
- loadSets(filePath, objects) → List[vrdMetadataSet]
- pasteEntries(metadataSets)
- pasteSets(objects)
- removeSets(metadataSets, objects)
- removeTags(objects, tags)
- renameTag(oldName, newTagName)
- renameTag(object, oldName, newName)
- saveSets(metadataSets, filePath) → bool
- setActiveStringLibraryIndex(index)
- setSelection(objects)
- setStringLibraries(libraries)
- Signals:
Functions¶
-
vrMetadataService.
addTags
(objects, tags)¶ Add tags to given scene objects.
Parameters: - objects (List[vrdSceneObject]) – The target objects.
- tags (List[string]) – The tag names that should be added.
-
vrMetadataService.
assignSets
(metadataSets, objects)¶ Assigns given metadata sets to given objects if not already assigned.
Parameters: - metadataSets (List[vrdMetadataSet]) – List of metadata sets.
- objects (List[vrdSceneObject]) – List of scene objects.
-
vrMetadataService.
copyEntries
(entries)¶ Copies a list of entries to the metadata entries clipboard.
The clipboard is cleared each time before a new copy.
Parameters: entries (List[vrdMetadataEntry]) – The entries to copy.
-
vrMetadataService.
copySets
(metadataSets)¶ Copies a list of metadata sets to the metadata sets clipboard.
The clipboard is cleared each time before a new copy.
Parameters: metadataSets (List[vrdMetadataSet]) – The metadata sets to copy.
-
vrMetadataService.
createSet
(name, objects=List[vrdSceneObject])¶ Creates an empty metadata set.
Parameters: - name (string) – The name of the new set.
- objects (List[vrdSceneObject]) – Optional list of objects the new set should be assigned to.
Returns: The created set.
Return type:
-
vrMetadataService.
deleteSets
(metadataSets)¶ Deletes existing metadata sets.
This will remove each set from all objects it was assigned to.
Parameters: metadataSets (List[vrdMetadataSet]) – The sets to be deleted.
-
vrMetadataService.
duplicateSets
(metadataSets)¶ Duplicates existing metadata sets with all data.
Parameters: metadataSets (List[vrdMetadataSet]) – The sets to be duplicated. Returns: The duplicated metadata sets. Return type: List[vrdMetadataSet]
-
vrMetadataService.
findSets
(name)¶ Searches for metadata sets by name.
Parameters: name (string) – The name. Returns: All metadata sets with the given name. Empty list if not found. Return type: List[vrdMetadataSet]
-
vrMetadataService.
getActiveStringLibraryIndex
()¶ Returns: The index of the active string library. Return type: integer
-
vrMetadataService.
getAllKeys
()¶ Returns: A list of all keys in the scene. Return type: List[string]
-
vrMetadataService.
getAllSets
()¶ Returns: A list of all metadata sets (including objects sets) in the scene. Return type: List[vrdMetadataSet]
Returns: A list of all shareable metadata sets in the scene. Does not include object sets. Return type: List[vrdMetadataSet]
-
vrMetadataService.
getAllTags
()¶ Returns: A list of all tags in the scene. Return type: List[string]
-
vrMetadataService.
getEntriesClipboard
()¶ Returns: The list of entries from the metadata entries clipboard. Return type: List[vrdMetadataEntry]
-
vrMetadataService.
getMaterialTags
()¶ Returns: A list of all tags in the Material Editor. Return type: Dict[string,List[]]
-
vrMetadataService.
getMetadata
(object)¶ Gets all metadata from an object.
Parameters: object (vrdObject) – The object to check Returns: All metadata from this object Return type: vrdMetadata
-
vrMetadataService.
getObjectsWithMetadata
(type=vrMetadataTypes.ObjectType.All)¶ Parameters: type (vrMetadataTypes.ObjectType) – Type of the objects that should be returned. Returns: All objects with the given type which contain any metadata. Return type: List[vrdSceneObject]
-
vrMetadataService.
getObjectsWithTag
(tag)¶ Parameters: tag (string) – The tag name to query. Returns: All objects which have the tag assigned. Return type: List[vrdSceneObject]
-
vrMetadataService.
getScenegraphTags
()¶ Returns: A list of all tags in the Scenegraph. The list also includes the nodes a tag is assigned to. Since shared nodes have identical tags, the list only includes the first node of it. If you need a complete list with all shared nodes you can use the getSharedNodes() function of vrdNode. Return type: Dict[string,List[]]
-
vrMetadataService.
getSelection
()¶ Returns: All objects currently selected in the metadata editor Return type: List[vrdObject]
-
vrMetadataService.
getSetsClipboard
()¶ Returns: The list of metadata sets from the metadata sets clipboard. Return type: List[vrdMetadataSet]
-
vrMetadataService.
getStringLibraries
()¶ Returns: The list of string library file paths. Return type: List[string]
-
vrMetadataService.
getTags
(objects)¶ Parameters: objects (List[vrdSceneObject]) – Scene objects Returns: Tag names from a list of objects. Return type: List[string]
-
vrMetadataService.
getUniqueSetName
(name)¶ Gets a unique name for a metadata set.
Parameters: name (string) – The name candidate. Returns: A unique name based on the candidate. Return type: string
-
vrMetadataService.
hasMetadata
(object)¶ Check, if the given node has metadata assigned.
Parameters: object (vrdSceneObject) – The object to check Returns: True, if metadata exists Return type: bool
-
vrMetadataService.
hasTag
(object, tag)¶ Parameters: - object (vrdSceneObject) – The object.
- tag (string) – The tag name.
Returns: True if the object contains the given tag, False otherwise.
Return type: bool
-
vrMetadataService.
isEntriesClipboardEmpty
()¶ Returns: True if the metadata entries clipboard is empty, False otherwise. Return type: bool
-
vrMetadataService.
isSetsClipboardEmpty
()¶ Returns: True if the metadata sets clipboard is empty, False otherwise. Return type: bool
-
vrMetadataService.
loadSets
(filePath, objects={})¶ Read metadata sets from a JSON file, send metadataChanged when file was successfully read.
Parameters: - filePath (string) – File path of a JSON file
- objects (List[vrdSceneObject]) – (Optional) Scene objects the loaded sets should be assigned to.
Returns: The loaded metadata sets
Return type: List[vrdMetadataSet]
-
vrMetadataService.
pasteEntries
(metadataSets)¶ Pastes the entries from the metadata entries clipboard to given sets.
The clipboard content is kept unchanged.
Parameters: metadataSets (List[vrdMetadataSet]) – The target metadata sets.
-
vrMetadataService.
pasteSets
(objects)¶ Pastes the metadata sets from the metadata sets clipboard to given objects.
The clipboard content is kept unchanged.
Parameters: objects (List[vrdSceneObject]) – The target objects.
-
vrMetadataService.
removeSets
(metadataSets, objects)¶ Removes the given metadata sets from the given objects if existing.
Parameters: - metadataSets (List[vrdMetadataSet]) – List of metadata sets.
- objects (List[vrdSceneObject]) – List of scene objects.
-
vrMetadataService.
removeTags
(objects, tags)¶ Remove tags from objects.
Parameters: - objects (List[vrdSceneObject]) – The target objects.
- tags (List[string]) – The tag names that should be removed.
-
vrMetadataService.
renameTag
(oldName, newTagName)¶ Rename existing tag.
Parameters: - oldName (string) – The old tag name.
- newTagName (string) – The new tag name.
-
vrMetadataService.
renameTag
(object, oldName, newName)¶ Rename existing tag on a specific object.
Parameters: - object (vrdSceneObject) – The object.
- oldName (string) – The old tag name.
- newName (string) – The new tag name.
-
vrMetadataService.
saveSets
(metadataSets, filePath)¶ Save given metadata sets in a JSON file.
Parameters: - metadataSets (List[vrdMetadataSet]) – The metadata objects to save
- filePath (string) – File path of a JSON file
Returns: True, if file was successfully saved
Return type: bool
-
vrMetadataService.
setActiveStringLibraryIndex
(index)¶ Sets the index of the active string library.
The active index indicates to which library new values are written.
Parameters: index (integer) – The index of the string libraries. A valid index for the list of string libraries should match the following constraint: 0 <= index < size of list.
-
vrMetadataService.
setSelection
(objects)¶ Selects a list of objects in the metadata editor.
Parameters: objects (List[vrdObject]) – A list of metadata sets and/or scene objects
-
vrMetadataService.
setStringLibraries
(libraries)¶ Sets the file paths used for the key and value string completion.
Parameters: libraries (List[string]) – The string library file paths.
Signals¶
-
vrMetadataService.
activeStringLibraryIndexChanged
(index)¶ This signal is emitted when the active string library index was changed.
Parameters: index (integer) – The new active string library index.
-
vrMetadataService.
metadataChanged
(changes=vrMetadataTypes.AllChanged)¶ This signal is emitted when metadata sets were created or deleted, assigned to objects or removed from objects, when tags are changed or assigned.
Parameters: changes (vrMetadataTypes.ChangeFlag) –
-
vrMetadataService.
selectionChanged
(objects)¶ Signal will be sent if the selection in the metadata editor has changed.
Parameters: objects (List[vrdObject]) – All selected objects
-
vrMetadataService.
stringLibrariesChanged
(libraries)¶ This signal is emitted when the string library paths were changed.
Parameters: libraries (List[string]) – The new library file paths.