# Getting source reference from avatar ID in Unreal

**URL:** <https://community.stereolabs.com/t/getting-source-reference-from-avatar-id-in-unreal/1211>\
**Category:** Uncategorized\
**Created:** [May 30, 2022, 1:29pm UTC](https://community.stereolabs.com/t/getting-source-reference-from-avatar-id-in-unreal/1211 "2022-05-30T13:29:36Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hedgehog](https://community.stereolabs.com/letter_avatar_proxy/v4/letter/h/ea666f/32.png) [@Hedgehog](https://community.stereolabs.com/u/Hedgehog)\
**Post date:** [May 30, 2022, 1:29pm UTC](https://community.stereolabs.com/t/getting-source-reference-from-avatar-id-in-unreal/1211/1 "2022-05-30T13:29:36Z")

</div>

I have a dilema. Running two livelinks with two cameras (spaced apart) into one UE project, all works well, connecting to both providers, but need to find out which generated avatar belongs to which provider. So let’s say I have Avatar\_livelink\_C\_2 and Avatar\_livelink\_C\_4 added/generated, but need to know which camera it’s data coming from. So I would know if C\_2 is on left camera or right camera.

Thanks a bunch.

---

<div class="post-metadata">

**Author:** ![BenjaminV](https://community.stereolabs.com/user_avatar/community.stereolabs.com/benjaminv/32/3863_2.png) [@BenjaminV](https://community.stereolabs.com/u/BenjaminV)\
**Post date:** [May 30, 2022, 3:53pm UTC](https://community.stereolabs.com/t/getting-source-reference-from-avatar-id-in-unreal/1211/2 "2022-05-30T15:53:59Z")

</div>

Hi,

I think the first step is to have a different name for each live link source.  
By default, the name of the live link source is “ZED” (here : [https://github.com/stereolabs/zed-livelink-plugin/blob/main/Source/Private/main.cpp#L91](https://github.com/stereolabs/zed-livelink-plugin/blob/main/Source/Private/main.cpp#L91)).  
You can, for example, add the serial number of your camera or rename it completely to be able to recognize it in UE.

Then, in UE, in the level blueprint of the Map (where the avatars are spawned based of the detection), you will be able to know from which source the detection is coming from by using its name (I think it’s called “Source Type” in UE).

Best regards,  
Benjamin Vallon

Stereolabs Support

---

<div class="post-metadata">

**Author:** ![Hedgehog](https://community.stereolabs.com/letter_avatar_proxy/v4/letter/h/ea666f/32.png) [@Hedgehog](https://community.stereolabs.com/u/Hedgehog)\
**Post date:** [May 30, 2022, 4:17pm UTC](https://community.stereolabs.com/t/getting-source-reference-from-avatar-id-in-unreal/1211/3 "2022-05-30T16:17:16Z")

</div>

I have named each source differently in main.cpp, but cannot get this “Source Type” from any of the Current Subject variables, could you give a more information or illustration where to get the “Source Typoe” from.  
Thank you!

---

<div class="post-metadata">

**Author:** ![BenjaminV](https://community.stereolabs.com/user_avatar/community.stereolabs.com/benjaminv/32/3863_2.png) [@BenjaminV](https://community.stereolabs.com/u/BenjaminV)\
**Post date:** [May 30, 2022, 4:31pm UTC](https://community.stereolabs.com/t/getting-source-reference-from-avatar-id-in-unreal/1211/4 "2022-05-30T16:31:46Z")

</div>

I think you are right, you can access the name of the Source via the Live link Source Handle, but I don’t see how you can know from which Source each Subject is coming from.

The workaround would be to add the name of the source in each subject’s name.  
For the moment, the name of the subject is only the ID provided by the detection module.  
You can, for example, add the Source’s name as a prefix. That way you can filter each detection with its name and you avoid duplicates (you can have two ID 1 for example, one for each camera).

The name is set here in the code : [https://github.com/stereolabs/zed-livelink-plugin/blob/main/Source/Private/main.cpp#L295](https://github.com/stereolabs/zed-livelink-plugin/blob/main/Source/Private/main.cpp#L295).

Best,  
Benjamin V.

Stereolabs Support

---

<div class="post-metadata">

**Author:** ![Hedgehog](https://community.stereolabs.com/letter_avatar_proxy/v4/letter/h/ea666f/32.png) [@Hedgehog](https://community.stereolabs.com/u/Hedgehog)\
**Post date:** [May 31, 2022, 10:00am UTC](https://community.stereolabs.com/t/getting-source-reference-from-avatar-id-in-unreal/1211/5 "2022-05-31T10:00:30Z")

</div>

It sounds like a good solution, but when I just add prefix to the id and it’s passed into blueprints, breaks the logic. Unless I’m adding prefix incorrectly. Can you give me an example of adding a prefix please.

---

<div class="post-metadata">

**Author:** ![BenjaminV](https://community.stereolabs.com/user_avatar/community.stereolabs.com/benjaminv/32/3863_2.png) [@BenjaminV](https://community.stereolabs.com/u/BenjaminV)\
**Post date:** [May 31, 2022, 10:16am UTC](https://community.stereolabs.com/t/getting-source-reference-from-avatar-id-in-unreal/1211/6 "2022-05-31T10:16:04Z")

</div>

Hi,

The name of the “Subject” is set in the cpp code. Instead of using the ID of the detection, use something like “LeftCamera\_” + FString::FromInt(objectData.id). I’ve not tested it but it should work.

Which part of the blueprint does not work ?

Best,  
Benjamin

Stereolabs Support

---

<div class="post-metadata">

**Author:** ![Hedgehog](https://community.stereolabs.com/letter_avatar_proxy/v4/letter/h/ea666f/32.png) [@Hedgehog](https://community.stereolabs.com/u/Hedgehog)\
**Post date:** [May 31, 2022, 10:34am UTC](https://community.stereolabs.com/t/getting-source-reference-from-avatar-id-in-unreal/1211/7 "2022-05-31T10:34:26Z")

</div>

![pb](https://community.stereolabs.com/uploads/default/original/1X/b61a2d921c86f3121bd0cd74dc919a3c7db59113.png)

Stops at Evaluate Live Link Frame and no avatars are being generated.

---

<div class="post-metadata">

**Author:** ![BenjaminV](https://community.stereolabs.com/user_avatar/community.stereolabs.com/benjaminv/32/3863_2.png) [@BenjaminV](https://community.stereolabs.com/u/BenjaminV)\
**Post date:** [May 31, 2022, 11:38am UTC](https://community.stereolabs.com/t/getting-source-reference-from-avatar-id-in-unreal/1211/8 "2022-05-31T11:38:48Z")

</div>

Make sure you updated the Subject name here ([https://github.com/stereolabs/zed-livelink-plugin/blob/main/Source/Private/main.cpp#L295](https://github.com/stereolabs/zed-livelink-plugin/blob/main/Source/Private/main.cpp#L295)) and also here : [https://github.com/stereolabs/zed-livelink-plugin/blob/main/Source/Private/main.cpp#L129](https://github.com/stereolabs/zed-livelink-plugin/blob/main/Source/Private/main.cpp#L129).

I’ll try to improve that and make it easier to modify in the future.

Best,  
Benjamin V

Stereolabs Support

---

<div class="post-metadata">

**Author:** ![Hedgehog](https://community.stereolabs.com/letter_avatar_proxy/v4/letter/h/ea666f/32.png) [@Hedgehog](https://community.stereolabs.com/u/Hedgehog)\
**Post date:** [May 31, 2022, 11:46am UTC](https://community.stereolabs.com/t/getting-source-reference-from-avatar-id-in-unreal/1211/9 "2022-05-31T11:46:28Z")

</div>

Line 129 ? UpdateAnimationFrameData(it.Value); ?

---

<div class="post-metadata">

**Author:** ![BenjaminV](https://community.stereolabs.com/user_avatar/community.stereolabs.com/benjaminv/32/3863_2.png) [@BenjaminV](https://community.stereolabs.com/u/BenjaminV)\
**Post date:** [May 31, 2022, 11:48am UTC](https://community.stereolabs.com/t/getting-source-reference-from-avatar-id-in-unreal/1211/10 "2022-05-31T11:48:48Z")

</div>

Yes, it updates the skeleton data of the current detection (Here it.Value is the ID as the skeletons are store in a map).

Stereolabs Support

---

<div class="post-metadata">

**Author:** ![Hedgehog](https://community.stereolabs.com/letter_avatar_proxy/v4/letter/h/ea666f/32.png) [@Hedgehog](https://community.stereolabs.com/u/Hedgehog)\
**Post date:** [May 31, 2022, 12:13pm UTC](https://community.stereolabs.com/t/getting-source-reference-from-avatar-id-in-unreal/1211/11 "2022-05-31T12:13:10Z")

</div>

but it.Value is int, can’t add append a string to it ?

---

<div class="post-metadata">

**Author:** ![BenjaminV](https://community.stereolabs.com/user_avatar/community.stereolabs.com/benjaminv/32/3863_2.png) [@BenjaminV](https://community.stereolabs.com/u/BenjaminV)\
**Post date:** [May 31, 2022, 12:19pm UTC](https://community.stereolabs.com/t/getting-source-reference-from-avatar-id-in-unreal/1211/12 "2022-05-31T12:19:36Z")

</div>

What I meant is that you have to change the Subject name in **UpdateSkeletonStaticData()** and **UpdateAnimationFrameData().** I linked the wrong line indeed, the exact line to modify is l.368 I think.

Stereolabs Support

---

<div class="post-metadata">

**Author:** ![Hedgehog](https://community.stereolabs.com/letter_avatar_proxy/v4/letter/h/ea666f/32.png) [@Hedgehog](https://community.stereolabs.com/u/Hedgehog)\
**Post date:** [May 31, 2022, 2:54pm UTC](https://community.stereolabs.com/t/getting-source-reference-from-avatar-id-in-unreal/1211/13 "2022-05-31T14:54:42Z")

</div>

I have also added ID index to RemoveSubject l. 308 otherwise “dead” avatars are left in the world outliner.

Thanks so much for your help, would be good if you could add avatar\>camera identification procedure in your next release.

---

<div class="post-metadata">

**Author:** ![BenjaminV](https://community.stereolabs.com/user_avatar/community.stereolabs.com/benjaminv/32/3863_2.png) [@BenjaminV](https://community.stereolabs.com/u/BenjaminV)\
**Post date:** [May 31, 2022, 3:08pm UTC](https://community.stereolabs.com/t/getting-source-reference-from-avatar-id-in-unreal/1211/14 "2022-05-31T15:08:10Z")

</div>

We planned some “quality of life” improvements of the live link sample for the next release.

I’ll see what can be done.

Best,  
Benjamin Vallon

Stereolabs Support
