Jump to content
[[Template core/front/profile/profileHeader is throwing an error. This theme may be out of date. Run the support tool in the AdminCP to restore the default theme.]]

animatrix last won the day on September 24

animatrix had the most liked content!

Community Reputation

308 Excellent

About animatrix

  • Rank

Contact Methods

  • Website URL

Personal Information

  • Name

Recent Profile Visitors

5,079 profile views
  1. Poly Carve SOP

    I recreated this tool from scratch for Pragmatic VEX: Volume 2, and did some comparisons with the Clip SOP method. While the Clip SOP method is super easy to use, it has some major flaws: 1. Clip SOP doesn't always clip out the geometry accurately at a specific position. As you can see in the screenshot, those highlighted points have values outside the range that should be clipped. (bug pending) Not sure how else to clip out these since we can't just delete the points. So this would be a deal breaker if you need to accurately carve out a geometry using an arbitrary scalar attribute. I reckon for polylines, this is not an issue, which was what was tested in this thread. But for complex geometry, it's a lot harder to just clip out sections appropriately. Poly Carve SOP had 0 points that are outside the range. 2. Clip SOP also clips away geometry within the range rather than carving out sections of it properly, meaning the entire polygon is deleted. Here is an example polygon that shows the issue (bug pending): Left shows original polygon, right shows the result of Poly Carve SOP that carves from 0.308 to 0.73849. Here you can see the Clip SOP's clipping plane that completely removes the polygon. 3. Clip SOP doesn't have a way to invert the carving operation. Imagine a poly line where you are keeping the middle part. If you invert the operation, you need to have the 2 ends that were carved out before. But it's not possible to do this using Clip SOP, unless you keep all parts and then delete the middle part, which may or may not work. I don't know it you can use it to consistently keep out the "middle section". Right shows Poly Carve SOP operation inverted. Combining both modes will get the whole geometry for all polygons, whether they are polylines or closed polygons. They are handled differently. 4. When you use a primitive group for the Clip SOP, it won't properly stitch the adjacent primitives, therefore introduce new holes to the geometry. Even if not the default, there should be an option for this. Poly Carve SOP handles adjacent primitives correctly. Of course this takes some of the cooking time, so the comparison is not completely 1 to 1. I used 2 Clip SOPs since Poly Carve SOP does Min/Max Clipping by default, so some of this cost is amortized throughout the entire operation. Clip method also includes the swapping of P back and forth. Both methods use compiled networks. So in the end for ~5.8M polygons geometry with a single attribute to be used for carving, Poly Carve SOP is about 3x faster.
  2. Yes in that case it's possible. Have to implement a line line intersection such as this one: paulbourke.net/geometry/pointlineplane/lineline.c Point, Line, Plane (paulbourke.net)
  3. Hi, There are more than 1 intersection in this case. Do you require the intersected lines form 90 degrees? But even then, there are infinite number of intersections that would revolve around the vector defined by your 2 points.
  4. can't select @P.y with point function

    Yes, you can't use subscript as attribute name, you have to do it after you read the proper attribute type. In this case vector, and then access the Y component.
  5. CLIP (but with non-plane geo)?

    Hi, Clip SOP is a compiled SOP so you can't dive inside. For your use case I would actually store P as rest, apply the mountain to the input geometry before clipping and then reset P back to rest.
  6. Hi, There is no specialized function to do this but you can run this in a Detail Wrangle: vector p0 = point ( 0, "P", 0 ); vector p1 = point ( 0, "P", 1 ); vector dir = p1 - p0; if ( length ( dir ) > 0.5 ) { vector n = normalize ( dir ); addpoint ( 0, p0 + n * 0.25 ); }
  7. Hi, You can fire rays for each given point within a cone in the opposite direction of the point normal: Here is the VEX code: int numrays = chi("numrays"); float maxangle = radians ( ch("maxangle") ); float maxdist = ch("maxdist"); int visualize = chi("visualize"); vector phit = 0; vector uvhit = 0; float nearestdist = 1e32; vector nearestp = @P; for ( int i = 0; i < numrays; ++i ) { vector2 u = rand ( i + 4523.4376 + @ptnum + ( @ptnum + 1 ) * 54.21 ); vector dir = sample_direction_cone ( -@N, maxangle, u ); if ( visualize ) { int pt = addpoint ( 0, @P ); setpointattrib ( 0, "N", pt, dir ); } int pr = intersect ( 1, @P, dir * maxdist, phit, uvhit ); if ( pr != -1 ) { float dsq = distance2 ( phit, @P ); if ( dsq < nearestdist ) { nearestdist = dsq; nearestp = phit; } } if ( visualize ) { int pt = addpoint ( 0, phit ); setpointattrib ( 0, "P", pt, phit ); } } @P = nearestp;
  8. Subdivision - transfer edge groups

    Hi, You can update your edge groups automatically using VEX (Detail Wrangle), but you will pay performance penalty for very high res geometry that has very large edge groups: string edgegroups [ ] = split ( chs("edgegroups"), " " ); foreach ( string edgegroup; edgegroups ) { int pts [ ] = expandedgegroup ( 1, edgegroup ); int count = len ( pts ); for ( int i = 0; i < count; i += 2 ) { int pt0 = pts [ i ]; int pt1 = pts [ i + 1 ]; int pts0 [ ] = neighbours ( 0, pt0 ); int pts1 [ ] = neighbours ( 0, pt1 ); int sharedpt = -1; foreach ( int pt; pts0 ) { if ( find ( pts1, pt ) >= 0 ) { sharedpt = pt; break; } } if ( sharedpt != -1 ) { setedgegroup ( 0, edgegroup, pt0, sharedpt, 1 ); setedgegroup ( 0, edgegroup, pt1, sharedpt, 1 ); } } } Edge group expression: `edgegrouplist(-1)` If you need multiple levels of subdivision, you need to encapsulate the Subdivide and Attribute Wrangle inside a For Each Loop network, as the edges have to be updated at each subdivision. Alternatively you can change the VEX code to walk the edges instead, then it would handle any edge group regardless of the subdivision levels difference between 2 geometries.
  9. Combination MidJourney with Houdini

    There is also a new open source one called stable diffusion, so it will be great to use this. I heard it's not censoring stuff also. So the price of running on cloud and locally could actually be much cheaper than MJ.
  10. Pragmatic VEX: Volume 1 [4K] [H19.5]

    FREE Patreon giveaway! To celebrate the 2 year anniversary of Pragmatic VEX: Volume 1, I am giving away 1 month of FREE patreon subscription for the new purchases of the course in this month. https://www.patreon.com/animatrix Started in 2017, I posted over 120 advanced production tools, tips, tricks and techniques with a lot more to come at 3 posts per month! Simply contact me after and I will arrange the patreon subscription!
  11. It seems like SESI changed the behaviour of ramps so now no more implicit cycling behaviour. The author needs to update his tuto.
  12. Circle tagents

    You have to specify the type for the arguments: function float[] common_tangent_line(float x1, y1, r1, x2, y2, r2) { }
  13. Circle tagents

    Hi, You also have to change the function calls like: Math.sqrt(delta1) results.push(l21) to: sqrt(delta1) push(results, l21)
  14. Hi, I haven't seen this tuto, but you can explicitly keep the fraction part of the time like this: float blend = @Time % 1.0; Otherwise the values get larger than 1, and so the ramp caps them at 1, hence why the "bounce" stops.