# Missing mapping for RenderTags from usdtokens to hydratokens

**URL:** https://forum.aousd.org/t/missing-mapping-for-rendertags-from-usdtokens-to-hydratokens/297
**Category:** Hydra
**Created:** [August 10, 2023, 2:38pm UTC](https://forum.aousd.org/t/missing-mapping-for-rendertags-from-usdtokens-to-hydratokens/297 "2023-08-10T14:38:33Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Rak](https://avatars.discourse-cdn.com/v4/letter/r/3da27b/32.png) [@Rak](https://forum.aousd.org/u/Rak)
#### Post date: [August 10, 2023, 2:38pm UTC](https://forum.aousd.org/t/missing-mapping-for-rendertags-from-usdtokens-to-hydratokens/297/1 "2023-08-10T14:38:33Z")

</div>

Hello,

We have encountered an issue when a HdPurposeSchema schema is defined and set to “default”, Hydra skips rendering objects with those tags.

The problem seems to be the way HdSceneIndexAdapterSceneDelegate(HdSIASD) is handling the render tags. There needs to be a mapping from _usdtokens_ to _hydratokens_.

For ex: in usdview, there is a mapping that maps usdtoken “default” to hydratoken “geometry” in [GetRenderTag()](https://github.com/PixarAnimationStudios/OpenUSD/blob/release/pxr/usdImaging/usdImaging/delegate.cpp#L1967C1-L1970) of the usdview scene delegate.

However, HdSIASD 's [GetRenderTag()](https://github.com/PixarAnimationStudios/OpenUSD/blob/release/pxr/imaging/hd/sceneIndexAdapterSceneDelegate.cpp#L593) is not doing this mapping causing Hydra to receive an unrecognized token. It works for the case when no purpose tag is specified.

if (!purposeSchema.IsDefined())  
{  
return HdRenderTagTokens-\>geometry; // default render tag.  
}

But when a “default” tag is defined in the USD Stage, the current logic fails to return the appropriately mapped tag.

If I add the required mapping to HdSISD’s GetRenderTag() it fixes the issue. For ex:

if (purposeDs-\>GetTypedValue(0) == TfToken(“default”))  
return HdRenderTagTokens-\>geometry;

Additionally to confirm this behaviour, I also disabled the token mapping in the usdview’s scene delegate and I could reproduce the issue with usdview as well.

Internally, we are inserting a sceneindex relying mainly on the UsdImagingStageSceneIndex for handle the USD data. So I am unclear if there is anything on our end that could be handled differently?

Let us know if there are workarounds for this and/if any fixes expected to be coming out soon.

---

<div class="post-metadata">

### Author: ![tomc](https://avatars.discourse-cdn.com/v4/letter/t/8dc957/32.png) [@tomc](https://forum.aousd.org/u/tomc)
#### Post date: [August 11, 2023, 9:42pm UTC](https://forum.aousd.org/t/missing-mapping-for-rendertags-from-usdtokens-to-hydratokens/297/2 "2023-08-11T21:42:58Z")

</div>

Hey Rakesh!

This is a bit unfortunate, but the semantic is that in the hydra domain, “default” is called “geometry”; any token mapping is the responsibility of the scene integration code. Here, that would be UsdImagingDelegate, whose GetRenderTag does the replacement; and also UsdImagingDataSourcePurpose, which likewise pulls the purpose attribute and swaps “default” for “geometry”. We view this as a detail that the concisely named HdSIASD should specifically not be aware of.

If you’re reading USD with UsdImagingStageSceneIndex, I’d expect it to have already done the conversion, so the real question is where the “default” purpose value is coming from… Is there any chance you can figure that out from the hydra scene browser?

Thanks!  
Tom

---

<div class="post-metadata">

### Author: ![Rak](https://avatars.discourse-cdn.com/v4/letter/r/3da27b/32.png) [@Rak](https://forum.aousd.org/u/Rak)
#### Post date: [August 11, 2023, 10:42pm UTC](https://forum.aousd.org/t/missing-mapping-for-rendertags-from-usdtokens-to-hydratokens/297/3 "2023-08-11T22:42:13Z")

</div>

> [@tomc](#):
>
> If you’re reading USD with UsdImagingStageSceneIndex, I’d expect it to have already done the conversion

Just so I understand it clearly, is the expectation that UsdImagingStageSceneIndex would already have done the conversion? so purposeDs-\>GetTypedValue(0) inside HdSIASD should return “geometry”?

---

<div class="post-metadata">

### Author: ![Rak](https://avatars.discourse-cdn.com/v4/letter/r/3da27b/32.png) [@Rak](https://forum.aousd.org/u/Rak)
#### Post date: [August 16, 2023, 5:13pm UTC](https://forum.aousd.org/t/missing-mapping-for-rendertags-from-usdtokens-to-hydratokens/297/4 "2023-08-16T17:13:30Z")

</div>

![image](https://us1.discourse-cdn.com/flex016/uploads/aousd/original/1X/c59d7f4eb008684d2dcd61c526465e2593bafac6.png)

Attaching the chain from Hydra Scene Browser.

---

<div class="post-metadata">

### Author: ![tomc](https://avatars.discourse-cdn.com/v4/letter/t/8dc957/32.png) [@tomc](https://forum.aousd.org/u/tomc)
#### Post date: [August 16, 2023, 6:48pm UTC](https://forum.aousd.org/t/missing-mapping-for-rendertags-from-usdtokens-to-hydratokens/297/5 "2023-08-16T18:48:38Z")

</div>

From 23.08: [https://github.com/PixarAnimationStudios/OpenUSD/blob/v23.08/pxr/usdImaging/usdImaging/dataSourcePrim.cpp#L130](https://github.com/PixarAnimationStudios/OpenUSD/blob/v23.08/pxr/usdImaging/usdImaging/dataSourcePrim.cpp#L130) … but clearly that’s not what’s going on in your screenshot…

If you’re using a different version, could you check dataSourcePrim.cpp and see if it’s different, or if you’re getting the purpose value from a different codesite? Or if you can repro this in usdview, you can file a github issue and we can take a look.

---

<div class="post-metadata">

### Author: ![Rak](https://avatars.discourse-cdn.com/v4/letter/r/3da27b/32.png) [@Rak](https://forum.aousd.org/u/Rak)
#### Post date: [August 16, 2023, 11:47pm UTC](https://forum.aousd.org/t/missing-mapping-for-rendertags-from-usdtokens-to-hydratokens/297/6 "2023-08-16T23:47:28Z")

</div>

We are on 23.02 and this is what the corresponding function looks like:

> HdDataSourceBaseHandle  
> UsdImagingDataSourcePurpose::Get(const TfToken &name)  
> {  
> if (name == HdPurposeSchemaTokens-\>purpose) {  
> return UsdImagingDataSourceAttributeNew(\_purposeQuery, \_stageGlobals);  
> }
> 
> ```
> return nullptr;
> 
> ```
> 
> }

So it is indeed different.

We will be moving to 23.08 so I will test it with the updated one and check if the issue still persists.

---

<div class="post-metadata">

### Author: ![Rak](https://avatars.discourse-cdn.com/v4/letter/r/3da27b/32.png) [@Rak](https://forum.aousd.org/u/Rak)
#### Post date: [August 24, 2023, 4:24pm UTC](https://forum.aousd.org/t/missing-mapping-for-rendertags-from-usdtokens-to-hydratokens/297/7 "2023-08-24T16:24:46Z")

</div>

Just wanted to confirm that switching to 23.08 fixes the issue. Thanks, Tom.

---

<div class="post-metadata">

### Author: ![tomc](https://avatars.discourse-cdn.com/v4/letter/t/8dc957/32.png) [@tomc](https://forum.aousd.org/u/tomc)
#### Post date: [September 5, 2023, 6:43pm UTC](https://forum.aousd.org/t/missing-mapping-for-rendertags-from-usdtokens-to-hydratokens/297/8 "2023-09-05T18:43:58Z")

</div>

Awesome, glad to hear it! 🙂
