How costly is the use of Attributes?

lets say for example, I had a large 100 piece model, and I wanted to make it transparent. But at a later time, I also wanted to make the model visible again. This model is composed of several semitransparent pieces, and I would want them to retain that semitransparency when I make them visible again. How resource expensive would it be to save that transparency value in an attribute assigned to each part?

2 Likes

I’d guess on the order of 4 or 8 bytes per number saved. The String used for attribute names is probably reused across Instances, so that’d be constant and negligible.

You could try testing it in a place with 1000000 things, and checking Studio’s memory usage before and after setting an attribute on the things. If it’s around 4 to 8 MB then that’d support 4-8 bytes per.

If it’s just a single 100 piece model having this done to it, that shouldn’t be a problem. If you’re reusing the same model several times, and each copy needs the same behavior, then you could make them reference the original’s transparencies instead of tracking the initial transparencies of each copy - hope that makes sense.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.