I2 and TextMesh Pro material presets problems

More
6 years 3 months ago - 6 years 3 months ago #2658 by JP_Nogueira
Hi!
My team is having a problem similar to what is described in this topic: www.inter-illusion.com/forum/i2-localiza...reset-on-localizatio

Hi,

I'm using I2 Localization (2.6.10 f1) with TextMesh Pro (1.0.55.0b7) and I'm trying to figure out how to change the font with it's non default material preset.

I've got two languages. Both are using different fonts. Each TMPro font has two material presets. Default one and customized one that I'm using in a few places throughout the project.
When secondary term is set to Text Mesh Pro Font the font changes as it should but sets each Text Mesh Pro font to default material preset. So my customized material preset is replaced.

I tried using material as the secondary term but it didn't change the font.

Is there any way to select material preset for localization?

(Unity 5.5.2p2)

Hi,

If you set a material as the secondary Term with a reference to the material, it will load automatically the font matching that material.

However, there was an issue where the font HAD to be only in the root of the Resources folder, otherwise it wont find it.
I changed that so that it will look for it in the same folder than the material.

You can download that change from the beta folder v2.6.11 a5. I also modified the TextMeshPro example scene to have one of the labels having FONTS in the secondary term, and another label using MATERIALS.

Hope that helps,
Frank
Are you :-) Give I2L 5


The problem:
I have set the Secondary Term in Localize component as Material, as explained in the previous linked post.
But when we change from English to Hindi (for example) using "Show" option (or changing language in the game itself), it does not work as intended:




Notice how in the second image, we can read the hindi character because it is using the standard material.

All the Secondary Terms are set to Material


But as you can see, I2 doesn't load the font files correctly:


In this image, you can see that font files in TextMeshPro are not changed, but the textbox itself shows the Hindi localization, and the Material Preset shows the standard one for the font (instead of the one shown in the Localize Secondary Term).


When the font is not changed (Spanish example), the materials are correct:


Here you can see that all the materials and fonts are in the Reference tab:
Last edit: 6 years 3 months ago by JP_Nogueira.
The following user(s) said Thank You: VitorValadares

Please Log in or Create an account to join the conversation.

More
6 years 3 months ago #2661 by Frank
Hi,
From the images I'm seeing that some of the Hindi texts are working, but some are not.

What I guess is happening is that the materials/fonts were added into the Reference section of the localize component that work, and are missing in in the ones that are failing.

If thats the case, you have three options
1- add the missing material to all the localize components that need them (not recommended)
2- Better, add the material and fonts into the "Assets" section of the I2Languages.prefab, that way, all of the Localize component will have access to them.
3- Those materials/fonts are always going to be loaded as they are referenced by the prefab/gameobject. So, maybe it will be better to have them in a Resources folder. That way, they are loaded on demand (only if needed), and you don't need to keep the references updated.

Hope that helps,
Frank

Are you :-) Give I2L 5 stars!
Are you :-( Please lets us know how to improve it!
To get the betas as soon as they are ready, check this out
The following user(s) said Thank You: JP_Nogueira

Please Log in or Create an account to join the conversation.

More
6 years 3 months ago #2664 by VitorValadares
I don`t think that the second solution apply to his case, since he did added all the materials in the assets tab (as shown in the last picture). Although that would be my guess. Any chance that these being a bug?

Please Log in or Create an account to join the conversation.

More
6 years 3 months ago #2665 by JP_Nogueira

Frank wrote: Hi,
From the images I'm seeing that some of the Hindi texts are working, but some are not.

What I guess is happening is that the materials/fonts were added into the Reference section of the localize component that work, and are missing in in the ones that are failing.

If thats the case, you have three options
1- add the missing material to all the localize components that need them (not recommended)
2- Better, add the material and fonts into the "Assets" section of the I2Languages.prefab, that way, all of the Localize component will have access to them.
3- Those materials/fonts are always going to be loaded as they are referenced by the prefab/gameobject. So, maybe it will be better to have them in a Resources folder. That way, they are loaded on demand (only if needed), and you don't need to keep the references updated.

Hope that helps,
Frank


In those cases (Hindi font working), the standard SDF material is used by default. All the other cases, we are using TextMeshPro material presets.

All the files (font assets, SDF's, and materials) were added to the Assets tab in I2Languages.prefab. and tested inside the following folders:

Resources
Plugins/I2/Resources
Plugins/I2/Localization/Examples/Resources
Plugins/I2/Common/Editor/Resources

None of them worked correctly, all of them showing the material change but not the font change as in the second picture.

We are running more tests here, but by any means, do you have any other idea of what is happening?

Thanks!

Please Log in or Create an account to join the conversation.

Time to create page: 0.412 seconds
Template by JoomlaShine