The datagen.api.catalog.glasses.count() function tells you how many glasses assets match your query. You can count how many glasses assets there are in total, or filter the catalog using glasses attributes.
When you get a glasses object from the catalog, you can edit that object in certain ways. These are the editable properties of glasses objects:
id
string
The id property defines the specific pair of glasses that the actor should wear, chosen from Datagen’s asset library. This property defines the shape of the glasses - not its color, reflectivity, or other attributes.
To download a CSV with a complete list of UUIDs that identify individual glasses shapes, click here
frame_color
Enum
The frame_color property defines the base color of the frame of the actor’s glasses. This color will be further affected by the value of the frame_metalness property property.
The frame_metalness property defines the reflectivity of the frames of the actor’s glasses, which can grant the frames a more plastic or more metallic character. This property accepts floating-point values from 0 to 1.
The lens_color property determines the base color of the lenses of the actor’s glasses. This base color will be further affected by the values of the lens transparency and reflectivity properties.
The lens_reflectivity and lens_transparency properties define how light behaves as it hits the glasses lens.
lens_reflectivity defines how much light is reflected off of the lens. The higher the reflectivity, the more you will see the actor’s surroundings in the glasses lens. lens_reflectivity accepts floating-point values from 0 to 1.
lens_transparency defines how much light is able to pass directly through the lens. The higher the transparency, the more you can see of the actor’s eyes. lens_transparency accepts floating-point values from 0 to 1.
This code takes a glasses asset from the catalog and changes the default lens reflectivity and transparency:
The position property defines where the actor is wearing his or her glasses. Currently we support glasses being worn only in the default position, on the nose.
This code takes a glasses asset from the catalog and resets the default position: