How to highlight a single model based on 3dtiles attribute fields?

My 3dtiles data contains two properties, id and name, both of which are string types.How to use the CesiumFeaturesMetadata Component to highlight the model by the name filed.How to correspond string types to material layers.



If your strings correspond to numbers, you can use the “Coerce” conversion. If the strings are CSS style color codes, you can use the “Parse Color from String” option. But if they are something else, there is currently no way to do it (short of modifying the Cesium for Unreal source code). You’d need something like this issue to be implemented:

Ok,Thank you for your reply!

I have been striving to find ways to individually modify the materials of each component in a 3DTiles model but have encountered challenges along the way. Specifically, after converting a BIM model to 3DTiles format, I aim to dynamically adjust the color of certain building elements through a RESTful API interface. For instance, I would like to color some building columns red, others green, or set them to be transparent. Considering the potential need to transmit substantial data via the API, such as altering the color of up to 1,000 columns at once, I am uncertain whether the Cesium for Unreal plugin supports this functionality or if it is technologically unfeasible altogether. Please help confirm the viability of this requirement and suggest feasible approaches. Thank you.

@cqliao please start a new thread, as your question appears unrelated to the previous discussion in this one.

To answer briefly: dynamically changing styling based on metadata properties as you describe should be doable, though the specifics may vary. You’ll need to provide a custom material, and then it’s a matter of getting the information needed to drive the styling into that material. One way to do that is with a Material Parameter Collection:

Another possibility is to bake the style into a texture that your material samples, and then you update that texture as needed.

Hello, it seems that storing the string field previously did not achieve a highlighting effect. Now, I have saved the float field in 3dtiles.
I can set the model to highlight by using the CesiumEncodedmetadata component in CesiumForUnreal version 1.31.2.

However, using the CesiumFeaturesmetadata component in CesiumForUnreal version 2.5.0 does not seem to work properly.

The problem may be that the PTABLE_propertyTableName_propertyName has not been updated.

Hi @842661047, I’m not sure what might cause that problem. Can you give us step-by-step instructions for reproducing the problem you’re seeing, preferably starting with the Cesium for Unreal Samples project, so that we can investigate?

Hi @Kevin_Ring I see that I can convert string property to shader by “Parse color from string” and support format is rgb and hexcode e.g ff0000 like this image:


I want to ask if it supports rgba too? for example my string color property is “#f2f2f2b2”

Hi @Join_Hans,
Unfortunately, no, “Parse Color from String” currently does not support alpha. For reference, the code that does the parsing is here:

1 Like

@Join_Hans Kevin is right, but I just wanted to add that you’re welcome to open a Github issue for this feature if you’d like it to be supported in the plugin.

You’re also welcome to modify the plugin for your needs – and if you do, we’d love to see a PR opened for the contribution! :smile:

1 Like