How to independently edit point attribs?

   4079   5   0
User Avatar
Member
20 posts
Joined: Oct. 2009
Offline
Imagine you have two points created by the Add surface node.
Then you add to each point an attribute say attrbute1 (class point, type integer, size 1) by means of the Attrib Create surface node. Then you want to change the integer value of the atribute just for one point independently say for point number 1. For example point 1 had the attribute1 integer value = 0 and you want to set it as 1. Okay, you may just go to Details View Tab and enter it. But this is done internally and not using some expression or extra node. The question is how to do this EXTERNALLY say using the Null surface node? Or maybe using some other sort of surface nodes?
User Avatar
Member
257 posts
Joined: Nov. 2007
Offline
You generally tend to use either a pointnumber or id attribute to identify which point(s) you want to change, combined with a conditional statement.

So if you have your addattribute in the value you could write something like:

if($PT==0,0,1)

which will result in a value of zero for point number zero and a value of 1 for all other points. These statements can be nested as well if necessary.
eg: if ($PT<5, if($PT==0,1,0), 1) -> this would set point0 to 1 and all the points of point5 and above to 1.


(All of this can also be done inside a vopsop or in vex if you like coding better.)
Cg Supervisor | Effects Supervisor | Expert Technical Artist at Infinity Ward
https://www.linkedin.com/in/peter-claes-10a4854/ [www.linkedin.com]
User Avatar
Member
20 posts
Joined: Oct. 2009
Offline
Okay, I agree, but for me it is still not clear how to implement this idea using the Null node as a control and what kind of field you add inside the Null interface and what expression you put then. I mean an expression that explicitly operates on one point and changes the attribute for only that point
User Avatar
Member
7723 posts
Joined: July 2005
Offline
If you just want to set the same into value of one (or a few) points, just use the Point SOP with the appropriate Group. Or you can use an AttribCreate SOP with a Group and fill in the info for a pre-existing attribute.
User Avatar
Member
257 posts
Joined: Nov. 2007
Offline
valshev
Okay, I agree, but for me it is still not clear how to implement this idea using the Null node as a control and what kind of field you add inside the Null interface and what expression you put then. I mean an expression that explicitly operates on one point and changes the attribute for only that point

If you are using a Null node as some kind of master control node, it is generally used for higher level parameters (such as parameters referenced from other sop nodes). Within a Null there are no local variables declared/recognised. Which is a problem when you are trying to access $PT or $CR for instance, therefore you will have to use a different node then a Null for this specific type of modification.

As mentioned before, you can do this with an AttributeCreate sop or a point sop, not with a Null.

You can also do it inside a vopsop using vop nodes.
Cg Supervisor | Effects Supervisor | Expert Technical Artist at Infinity Ward
https://www.linkedin.com/in/peter-claes-10a4854/ [www.linkedin.com]
User Avatar
Member
1908 posts
Joined: Nov. 2006
Online
Check out the attached otl file. It's an operator I wrote a couple years ago called the AttribOverride Sop. It's a Python Sop that allows you to non-procedurally override any attribute interactively. You basically choose your attribute, select your new value, select the points/verts/whatever and voila. I talked about it briefly in my Advanced Tool Building master class. See the help card for details.

Attachments:
sop_attriboverride.otl (44.8 KB)

Graham Thompson, Technical Artist @ Rockstar Games
  • Quick Links