Running a custom character command containing an animation produced by Iclone8

Isaac Sim Version

4.5.0
4.2.0
4.1.0
4.0.0
4.5.0
2023.1.1
2023.1.0-hotfix.1
Other (please specify):

Operating System

Ubuntu 22.04
Ubuntu 20.04
Windows 11
Windows 10
Other (please specify):

GPU Information

  • Model: NVIDIA RTX A2000 8GB
  • Driver Version: 535.230.02

Topic Description

Detailed Description

We were able to import a custom character in IsaacSim and are now trying to extend its behavior with a custom command. The character we imported works well with the default GoTo, Idle, and LookAround commands so we assume that applying the CharacterRetargetAnimationsCommand is not needed.

Yet we struggle to execute a custom Assembly command.

Steps to Reproduce

  1. Produce an animation using Iclone8 using the same Character usd file that is being used later in IsaacSim.
  2. Manually extend the animation usd to contain required attributes for custom commands
from pxr import Usd, Sdf

def create_or_get_attribute(prim, name, typeName):
    """
    Retrieve an existing attribute or create a new one on the given prim.
    """
    attr = prim.GetAttribute(name)
    if not attr:
        attr = prim.CreateAttribute(name, typeName)
    return attr

# Open the USD stage
usd_path = 'custom_animation.usd'

stage = Usd.Stage.Open(usd_path)
if not stage:
    print("Error: Unable to open USD file at", args.usd_path)
    sys.exit(1)
# Get the default prim
prim = stage.GetDefaultPrim()
if not prim:
    print("Error: No default prim found in the USD file.")
    sys.exit(1)
# Create or get the custom command attributes on the default prim.
name_attr = create_or_get_attribute(prim, "CustomCommandName", Sdf.ValueTypeNames.String)
template_attr = create_or_get_attribute(prim, "CustomCommandTemplate", Sdf.ValueTypeNames.String)
anim_start_attr = create_or_get_attribute(prim, "CustomCommandAnimStartTime", Sdf.ValueTypeNames.Float)
anim_end_attr = create_or_get_attribute(prim, "CustomCommandAnimEndTime", Sdf.ValueTypeNames.Float)

# Set attribute values using the USD API's Set method.
name_attr.Set(args.custom_command_name)
template_attr.Set(args.custom_command_template)
anim_start_attr.Set(args.custom_command_anim_start_time)
anim_end_attr.Set(args.custom_command_anim_end_time)

stage.GetRootLayer().Save()
  1. At the setup of the scene add the adjusted animation usd to the CustomCommandManager.
from omni.anim.people.scripts.custom_command.command_manager import CustomCommandManager
from omni.anim.people.scripts.custom_command.populate_anim_graph import populate_anim_graph

if self._custom_command_manager.add_custom_command(anim_usd_path):
    bus = omni.kit.app.get_app().get_message_bus_event_stream()
    bus.push(
        self.event_add_custom_command,
        payload={
            "Command": self._custom_command_manager.get_latest_command().name,
            "Template": self._custom_command_manager.get_latest_command().template,
        },
    )
populate_anim_graph()

Error Messages

Eventually, we can see the wanted command being shown as part of the Biped_Setup but it is not being executed giving us some warnings in the logs:

2025-03-13 12:36:54 [498,690ms] [Warning] [omni.anim.asset] Failed to compile Animation. ‘/World/Characters/Biped_Setup/CustomCommandAnimations/Assembly’ is not a valid UsdSkelAnimation
2025-03-13 12:36:54 [498,690ms] [Warning] [omni.anim.asset] Failed to compile asset ‘/World/Characters/Biped_Setup/CustomCommandAnimations/Assembly’:
2025-03-13 12:36:54 [498,698ms] [Warning] [omni.anim.asset] Failed to compile dependencies for ‘/World/Characters/Biped_Setup/CharacterAnimation/AnimationGraph’:
2025-03-13 12:36:54 [498,733ms] [Warning] [omni.anim.graph.core.python] Type mismatch for variable Action in Character::SetVariable

Screenshots or Videos

Here’s what we see before launching the simulation. Yet the command is not being executed.

We would love to know if we are missing something crucial here.

From the error logs looks like something might could be wrong with the actual animation file.
You seem to have followed the right approach. Also assume you added the custom command via UI (Tools ->Replicator->Custom Command), as you don’t have an error related to the command not being recognized.

A couple of things to try/double check:

  • When adding the custom command attributes, did you add them with a file which had the animation as root prim like this:

  • Try following the same procedure for custom commands with your own custom command name, with one of the base animations provided in the assets

  • Have you tried to play the animation + character individually (i.e without using the Replicator Agent Command workflow)? Does that work?

Thanks a lot for your useful input!

  • Playing the animation alone as is works fine
  • Loading one of the default animations from the assets as a custom command using exactly the same logic also raised no issues
  • Custom command specific attributes are being added to the root prim of the usd

Maybe we should try explicitly retargeting the animation as the root is not of theSkelAnimation type.

omni.kit.commands.execute( 'CreateRetargetAnimationsCommand', source_skeleton_path='',
target_skeleton_path='',
source_animation_paths=[''],
target_animation_parent_path='',
set_root_identity=False )

I have found this command in the docs but it is not straightforward which arguments should I use and I could not really find any example for it.