Limit Extrude to Primitives

   1857   8   2
User Avatar
Member
768 posts
Joined: April 2014
Offline
I want to control the zscale attribute of a extrude; whereas, if the number of points for a primitive is greater then or equal to four points, then don't apply an extrude ?
Edited by _Christopher_ - Aug. 11, 2017 19:56:59
【T】【C】【S】
User Avatar
Member
253 posts
Joined: July 2006
Offline
primvertexcount() vex function should help. If you need further assistance just shout.
User Avatar
Member
768 posts
Joined: April 2014
Offline
Within an attribute vop; running over primitives. Not sure I have this straight, NumVtx is less then 4 plugged into a for loop as a condition. How do I set within the for loop those primitives with less then 4 vertices to have a value of 0 when bind out to the attribute zScale ?
【T】【C】【S】
User Avatar
Member
7789 posts
Joined: Sept. 2011
Online
to create a prim group in vex based on number of edges, bind the result of the comparison of numvtx with the desired face count. No for loop required.

@group_myquads =primvertexcount(0,@primnum)==4;
User Avatar
Member
768 posts
Joined: April 2014
Offline


? Or bypass the add vop ?

Edit:
I realized I need to search for and exclude adjacent faces as well to the attribute zscale since I have dozens of prims with 4 vertices. Reflect can search for all adjacent prims. I need to loop over all the prims, and reflect the adjacent normals; then bind to the attribute.
Edited by _Christopher_ - Aug. 13, 2017 13:00:10
【T】【C】【S】
User Avatar
Member
7789 posts
Joined: Sept. 2011
Online
don't use zscale for selective extrusion. Simply create a primitive group, and enter the group name in the polyextrude group parameter.
Reflect doesn't search for anything, it gives the relfected direction, give an incident and normal vector.
To exclude faces that share an edge with faces that are also in the group, you will need to determine which faces share an edge with the current primitive, and loop over those, checking if any are in the first group. The prim vop/wrangle are by definition looping over primitives. You can narrow down the second steps search scope by using the first group as the runover group for the second prim vop.
User Avatar
Member
768 posts
Joined: April 2014
Offline
Can it be done with the zscale attribute ?
【T】【C】【S】
User Avatar
Member
253 posts
Joined: July 2006
Offline
This is what I meant.

Attachments:
zscale.hipnc (77.4 KB)

User Avatar
Member
768 posts
Joined: April 2014
Offline
@A-OC your example is more or less what I thought you described in your earlier post and what I attempted, now I'll re-attempt in vops.
【T】【C】【S】
  • Quick Links