Avatars in SightLab can represent non-player characters (NPCs), animated agents, conversational AI characters, or tracked representations of participants. This page focuses on adding NPC-style avatars to a scene, positioning them reliably, animating them, and ensuring they appear correctly in data collection and replay.
Avatars can be imported in .fbx, .glTF, or .cfg formats and work with most common avatar pipelines.
If you just want an avatar visible in the scene with data collection and replay support, this is the fastest way to start.
# Load the avataravatar=vizfx.addAvatar('sightlab_resources/avatar/full_body/RocketBox_Male1.osgb')# Position and animateavatar.setPosition(0,0,2)avatar.state(1)# Play animation state# Register with SightLab for data collectionsightlab.addSceneObject(avatar,gaze=True,avatar=True)
💡 Tip: This approach is perfect for quick prototyping. For production experiments, use the stand-in avatar method for more precise, repeatable placement.
When this is enough:
Single avatar
No need for precise placement via Inspector
No stand-in or scene editing
Supported Avatar Sources
SightLab works with avatars from many common libraries:
⚠️ Important: Setting avatar=True ensures the avatar appears correctly in replay. Without this flag, the avatar may not be visible during session playback.
Placing Avatars in the Scene (Best Practice)
Why Use a Stand-In Avatar?
Using a placeholder avatar in the environment lets you:
Position avatars visually
Avoid hard-coded coordinates
Keep placement consistent across sessions
Step 1 – Add a Stand-In Avatar in Inspector
Open your environment in Inspector
Go to File → Add
Select standInAvatar.osgb
Located in sightlab_resources/objects
Or can directly place your avatar and use the root node in the later step
Select the avatarTransform (or first transform node)
Translate and rotate the stand-in to the desired position
Animation indices depend on the avatar and can be previewed in Inspector's Animations tab.
Animation Examples
# Loop an animationavatar.state(1)# Play animation onceavatar.execute(1)# Blend between animationsavatar.blend(1,2,0.5)# 50% blend between state 1 and 2# Set animation speedavatar.speed(1.5)# 1.5x speed