You can get and set properties like point_position
or voxel_fog_density
on geometric objects like meshes and volumes. You can also create your own properties to control custom effects.
In general, properties are key-value pairs on objects. The key is a name (character string) and the value can be almost anything. In many cases, the value is another object with one or more properties of its own.
In particular, geometric objects can have geo properties. Both point_position
and voxel_fog_density
are examples of geo properties. The value of a geo property is itself an object with its own properties, including:
point_position
, point_normal
, and point_size
all target point_component
, while voxel_fog_density
and voxel_temperature
target voxel_tile_tree
.float3
point positions.There are several nodes for getting and setting properties. Much of the time, you should use get_geo_property
and set_geo_property_data
. For example, to to change the size of particles you first use get_geo_property
to get the point_size
data, then modify the values, and finally use set_geo_property_data
to store them on the object.
get_geo_property
Use get_geo_property
to return the array of values of a geo property. It also returns the default value and the name of the targeted component. However, if the property does not exist on the geometric object, the returned data is an empty array.
There is a variation named get_geo_property_check
that additionally returns a Boolean value to indicate whether the property was found.
There are also specialized nodes for some commonly used properties, such as get_particle_position
and get_particle_velocity
. These are more convenient because you do not need to type in a property name.
set_geo_property_data
Use set_geo_property_data
to update the array of data of an existing geo property. It is more convenient than set_geo_property
because you do not need to specify the default value or the targeted component because the property already exists.
set_geo_property
Use set_geo_property
to create a geo property and set its initial data values. You can create and modify custom geo properties for any purpose. Once the geo property has been created, you can get and set it using get_geo_property
and set_geo_property_data
.
One reason for using set_geo_property
to create custom properties is to store user data for use in rendering. Renderers that support Bifrost have ways to use this data. For example, with Arnold you can use user-data shaders to get the value of geo properties and connect them in a shader tree. Floating-point geo property values are interpolated between vertices. See "Bifrost Graph" in the Arnold guide for a list of supported types and how they are converted.
get_property
, set_property
Use get_property
and set_property
to get and set any property. They are not restricted to geo properties. Be careful to make sure the values are the correct type because these nodes do not perform any checking.