catchyid Posted August 18, 2016 Share Posted August 18, 2016 Hi, Beginner question. https://www.sidefx.com/docs/houdini15.5/nodes/sop/attribcreate#locals In "attribute create" node, I found many generic locals that does not make sense to be there, for example: (NX,NY,NZ), Mass (point mass), etc. My question, why define such generic locals in "attribute create" node? Would not make more sense to define these locals in nodes that need them? e.g. "box" node defines its normals, dynamic node defines its mass? As far as I understand it, "attribute create" should define geometrical attributes and not locals... I would really appreciate it If someone can explain why "attribute create" has all these locals and most importantly what are their use cases... Quote Link to comment Share on other sites More sharing options...
catchyid Posted August 18, 2016 Author Share Posted August 18, 2016 Okay, I think I need to rephrase my question Let's say I a create grid SOP, then I am allowed to use $PT (point number) in expressions, NOW, if I check grid SOP node documenation, I see no reference to $PT? However, I see a reference to its definition in Create Attribute SOP node? So, my question is: why there is no reference to $PT in grid SOP, and why its definition is found a "Create Attribute"? Thanks Quote Link to comment Share on other sites More sharing options...
Atom Posted August 18, 2016 Share Posted August 18, 2016 That is just legacy stuff. Houdini is constantly changing. The new approach is to use attributes instead of those $ variables. Quote Link to comment Share on other sites More sharing options...
catchyid Posted August 18, 2016 Author Share Posted August 18, 2016 okay... got it, thanks Quote Link to comment Share on other sites More sharing options...
f1480187 Posted August 19, 2016 Share Posted August 19, 2016 (edited) You can use them to set your values inside expressions. They may contain: "Common" geometry attributes, if they exist on this type of geometry and even if there is no local variable for them exist. They listed in help page: $N, $AGE, and so on. They just predefined for this node by devs, and attributes itself are not special. $NX (@N.x) will access point normal's first component when create point attribute. User-defined geometry attributes, if they have local variable defined. $MYATTR1 will access first component of any vector attribute with local MYATTR defined. Probably it will be @myattr, but there is no restriction to use same name in uppercase, it's just a convention. Default values of non-existent attributes. Usually 0, it may be -1 or something else for unknown subset of "common" attributes with "common" defaults. So, if you have no @id attribute, but use $ID in expression, it will be evaluated to -1. Global expression variables like $T (@Time). Some shortcut values, like $XMIN (no @-syntax alternative?). Implicit geometry attributes like $PT (it's attribute notation is also uses wrangle-style names like @ptnum, not @pt). You still may want to use locals for some variables which have no (known?) alternatives: $XMIN, $BBZ and so on. Otherwise, access existing attributes in @-style, because you don't have to maintain locals for such cases anymore. attribcreate_locals.hipnc Edited August 19, 2016 by f1480187 1 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.