Jump to content

Vellum pressure atribute (Paul Esteves HIVE)


Recommended Posts

I watched Paul Esteves' Hive froma few days ago, and followed his example for inflating a cushion using pressure constraints. I wanted to understand how to control pressure with animated antributes.

I can't get his VEX code to work, and I can't understand why it doesn't, but worse I don't understand why it would if it did!  (It doesn't vary the pressure across the geometry).

He's setting a mask attrib on the main geo, then referencing this on input 3 of a Geometry Wrangle in the solver set to the ConstraintGeometry stream. Here's the code, with my atribute inserts for saving out the varibales so I can try to see what's happening in the spreadsheet.

int pt = primpoint(0, @primnum, 0);
i@mpt = pt;

float falloff = point(2, "mops_falloff", pt);
f@mask = falloff;

falloff = fit01(falloff, chf("min"), chf("max"));

f@restlength = f@restlengthorig * falloff;

The code is using primpoint() to get the point number of the first vertex of each constraint prim, storing it in pt and multiplying this with the mops_falloff mask and saving it to @restlength of the pstretch group (named in the Pressure constraint SOP). But when I inspect @mpt ('mpt' so it's next to 'mask' in the spreadsheet), its all zeros. 'That would explain why it's not working' I think...

iiuc though, the pressure contraint is just a single polyline, 1 prim, connecting many points stored in an array (@pts) and so has just one restlength attribute. So I don't see how this code could write the differnt masked values as there's only a single entry for it. I must be misunderstandning something but cannot figure out what. See grab.

Here's the part of the vid with the code in a Geometry Wrangle in the Vellum Solver:

 

 

Screenshot 2024-04-24 163113.jpg

Edited by RT_SD
Link to comment
Share on other sites

Hey Tesan, thanks for the reply.

If you scroll down a bit do the mask values stop after prim number 15? Presumably so as you have an array of 16 objects.

I think I've confused myself by only doing 1 cushion.

So the pressure constraint IS just a single prim so you can't actually vary the pressure values across the object on that, its all or nothing? The varying is done on the stretch and bend cloth constraints... which PE demos in his video if I paid proper attention!

In my defence it is a bit counter intuitive in that to vary the inflation effect you have to do it with the cloth properties not the pressure. At least hat's how Mr Esteves has done it here.

When I checked the Docs though they have that flippy inflation scene which uses a built-in @pressurescale point atttribue. Presumably that is stored on each point of the pressure prim and *does* allow you to inflate diferentially across an object using pressure, or does it???

(that flippy scene was a bit complicated as it also has a volume variable doing something as well, I will revisit it now I've cleared up my wrong thinking)

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...