Ansh Kathuria Posted December 28, 2021 Share Posted December 28, 2021 Hey there!! Please can anyone tell me the basic difference between the name & class attribute. In what situation both will be used? Thanks in advance... Quote Link to comment Share on other sites More sharing options...
Atom Posted December 29, 2021 Share Posted December 29, 2021 (edited) 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 December 29, 2021 by Atom 1 Quote Link to comment Share on other sites More sharing options...
Kvale Posted December 29, 2021 Share Posted December 29, 2021 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. 1 Quote Link to comment Share on other sites More sharing options...
Ansh Kathuria Posted December 29, 2021 Author Share Posted December 29, 2021 Thanks Atom & Kvale for simplifying me this concept. I appreciate your answers. Thanks!! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.