Commands#
Public command API for module omni.kit.property.tagging:
AddTagCommand#
Add a tag to an asset Command. Fails if we are not connected to the tagging server.
Arguments#
asset_path(str): Path to the asset. Should start with omniverse: or it will just return
tag(str): packed string tag, such as appearance.Car, or .appearance.generated.Truck=99
excluded(str): excluded version of the tag (or empty string) to remove if present
Usage#
import omni.client
import omni.kit.commands
# Define the asset path which should start with 'omniverse:'
asset_path = "omniverse://localhost/Assets/CarAsset"
# Define the tag to add
tag = "appearance.Car"
# Optionally, define an excluded tag to remove if it exists
excluded = ".appearance.generated.Truck=99"
# Execute the AddTagCommand to add the tag to the asset.
# If the excluded tag is provided, it will be removed.
omni.kit.commands.execute("AddTag", asset_path=asset_path, tag=tag, excluded=excluded)
RemoveTagCommand#
Remove a tag to an asset Command. Fails if we are not connected to the tagging server.
Arguments#
asset_path(str): Path to the asset. Should start with omniverse: or it will just return
tag(str): packed string tag, such as appearance.Car, or .appearance.generated.Truck=99
Usage#
import omni.client
import omni.kit.commands
import omni.kit.tagging
# Define the asset path and tag to remove
asset_path = "omniverse://server/path/to/asset"
tag = "appearance.Car"
# Execute the RemoveTagCommand to remove the tag from the asset.
omni.kit.commands.execute("RemoveTag", asset_path=asset_path, tag=tag)
UpdateTagCommand#
Remove a tag to an asset Command. Fails if we are not connected to the tagging server.
Arguments#
asset_path(str): Path to the asset. Should start with omniverse: or it will just return
old_tag(str): packed string tag, such as appearance.Car, or .appearance.generated.Truck=99
new_tag(str): packed string tag, such as appearance.Car, or .appearance.generated.Truck=99
Usage#
import omni.kit.commands
# Define the asset path and the tag values.
# Note: The asset path should start with "omniverse:".
asset_path = "omniverse://server/path/to/asset"
old_tag = "appearance.Car"
new_tag = "appearance.Truck"
# Update the tag from old_tag to new_tag on the asset.
omni.kit.commands.execute("UpdateTag", asset_path=asset_path, old_tag=old_tag, new_tag=new_tag)