RT_SD Posted April 24 Share Posted April 24 (edited) 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: Edited April 24 by RT_SD Quote Link to comment Share on other sites More sharing options...
Librarian Posted April 24 Share Posted April 24 @RT_SD I have this on my Spreadsheet<<<< Totally different from yours Quote Link to comment Share on other sites More sharing options...
RT_SD Posted April 24 Author Share Posted April 24 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) Quote Link to comment Share on other sites More sharing options...
Librarian Posted April 24 Share Posted April 24 @RT_SD I found this file with diff methods, can be useful just to Post here. vellumPressure_methods.hipnc 1 Quote Link to comment Share on other sites More sharing options...
RT_SD Posted April 24 Author Share Posted April 24 7 minutes ago, Librarian said: @RT_SD I found this file with diff methods, can be useful just to Post here. vellumPressure_methods.hipnc 1.29 MB · 0 downloads Oh excellent! Thanks. I'll be diving into this asap. 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.