ICE attributes: user-defined versus built-in


ICE attributes are categorized as built-in or user-defined, so you would assume you could easily find your own custom attributes by checking the AttributeCategory property. However, try this: create an empty point cloud and run this script:

si = Application
attrs = si.Selection(0).ActivePrimitive.Geometry.ICEAttributes;

# There's also a "unknown" category but I'll ignore that here
for attr in attrs:
	si.LogMessage( "Attribute: %s, IsDefined: %s, AttributeCategory: %s" % (attr.Name, attr.IsDefined, "Built-in" if attr.AttributeCategory == 1 else "User-defined" ) )

You’ll see that while some attributes, like NbPoints, PointPostion, and PointVelocity are “built-in” as you would expect, most of the attributes are in the “user-defined” category.

For example, size and shape are listed as user-defined attributes. Why’s that?

I think it is because those attributes are dynamic attributes added by [factory-default] ICE compounds. Until you plug in those compounds, the compounds don’t exist and aren’t initialized (in other words, they are not defined yet). They’re not really built into the system (and the attribute explorer is hard-coded to show them as a convenience).

Built-in attributes like PointPosition are intrinsic attributes.

Consider this ICE tree on my empty point cloud. The Size attribute is just like my own custom Xxx attribute, whereas the built-in PointPosition attribute resolves nicely.

If you want to distinguish your own attributes, I’d use a prefix for the attribute names. For example, I sometimes use a “ps” (for Product Support) prefix or a “sisupp” prefix.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s