Jump to content

name & class attribute

Recommended Posts

They are kind of the same. @name is a string, an @class is often an integer. They are both similar to @id for particles. Name is used quite often to "name" the pieces of a fracture, while class might be used to simply "group" a bunch of primitives that are not necessarily connected by any constraints. (i. e. for assigning materials or filtering primitives within a loop).

Edited by Atom
  • Like 1
Link to comment
Share on other sites

Simplest difference is this:
The @name attribute is a string attribute. (Eg. "foo_0, foo_1")
The @class attribute is an integer attribute. (Eg. "0", "1")

Both attribute are very similar to groups. You can easily select geometry based on attributes. In the "group" tab in most nodes you can type @name="foo_1", or @class="1".
Storing groups as attributes rather than groups are actually more efficient.

The name attribute is often used in rbd simulations and other simulations that use constraints.
When packing geometry the @name attribute is used to determine how many packed pieces you'll end up with after packing.

The @class attribute is pretty much just an attribute created when calculating how many separate 3d islands there are. 

Both the connectivity node(used to create @class attribute based on primitives) and the assemble node (used to create @names) create their attributes based on how the incoming geometry is connected. 3d islands etc.

The @class attribute is often used to create names manually in vex. Eg. s@name = sprintf("foo%d", i@class");


Read more about @class in the documentation here.

And read more about @name in the documentation here.

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...