Can't edit Shader in Interactable Theme
Describe the bug
When creating a new Interactable Theme, there is no way to edit the shaderName property. When selecting an existing Theme, the shader name is displayed but can't be changed either, and disappear when changing back and forth the theme property(see below for repro).
So, currently, i don't see any easy way to (re)create a new color theme for, let's say as an example, a Textmeshpro text with mrtk.textmeshpro shader. I don't even know how i could just recreate the same theme as AppBarButtonTextTheme that is available in MRTK (except with a copy&paste).
Maybe there is a way, but it's not clear on how to procede.
To reproduce
-in Project View > Assets, right click -in contextual menu, select Create > Mixed Reality Toolkit > Interactable > Theme
-
in the theme asset, select the theme property to InteractableColorTheme => observe that you can't select the shader of your choice, and by consequence can't select the material colorId.
-
if you select an existing theme, you can't change the shader, despite it is visible
-
and if you change the theme property, and come back to interactablecolortheme, the sahder infos disappeared!
Expected behavior
-ideally a dropdown list of all shader, so that we can select the shader of our choice, and then select the colorId -or maybe, if a way exists, enhance documentation on how to be able to select the wanted shader.
Screenshots
upper : the existing AppBarButtonTextTheme
lower: a freshly new created theme

Your Setup (please complete the following information)
- Unity Version 2018.4.2f1
- MRTK Version v2.0.0 RC2.1
Target Platform (please complete the following information)
- unity editor
Hi @gilbdev ! I think I may have a workaround for you. if you assign your newly created theme asset to an Interactable component, you should be able to assign shader property. You should also then be able to select the asset directly and modify the shader property in the inspector
When assigned in Interactable in inspector

When you double click the Theme asset and view directly in inspector:

@killerantz FYI, looks like there is a discrepency between theme profile visualization when in Interactable and the inspector the theme asset directly
Thanks, workaround works :)
But yeah, it means the Theme depends on this process to be able to select the shader on the 'target'. it also mean that if you assign the theme to 2 different objects with different shaders ..expected behaviour is ... unknown :p
@Railboy also FYI in case this may be related in some way to PR #5033
"-ideally a dropdown list of all shader, so that we can select the shader of our choice, and then select the colorId"
I like this idea. If nothing else, it should be more clear in the inspector on what to do.
Because a theme is a scriptableObject, the ShaderTheme and the ColorThemes are more complicated. I wanted to be able to find property names in a material, especially for the MRTK standard shader. I never remember what those properties are, plus less chance of typos.
The theme automatically looks for a shader on an object to figure out a list of properties, if a target is assigned. I like the idea of selecting the shader in the theme, if no target is found, We can definitely have better instructions in the theme inspector and provide more information about the expected shader, and communicate when a theme is used on an object that does not have a shader with the assigned shader property.
In theory, a theme placed on objects with different shaders should work as long as the have the same properties. Though, the property names used to be stored as strings, but we recently started storing them as a hash, so this needs to be tested.
As a side note, any text components should be covered with a ColorTheme. the theme checks for Text, TextMesh, TextMeshPro, and TextMeshProUGUI and will assign the color through the components if one is found. In this case the color property is ignored entirely, so we can use the same color themes on a mesh based object and a text component.
Also, the shader property determines which kind of property field to show, a float field or color field. If we do any validation, we should validate the property name and type