Can't access the point attribute in Vellum Constraint Prop

   3050   4   1
User Avatar
Member
8 posts
Joined: Sept. 2020
Offline
Hey all,

Sincerely hope that somebody could sort this out for me as I am trying to get this done 3 days in a row haha

So I have some grids, copied to points of another grid, and inflated with vellum. The idea is to make separate “cells” to inflate in a specific time. So right before I copy to points, I add an attribute to the points of the grid to which we are copying.
The attribute is there, it is for every single point of the small grids that should be inflated. It is there in the vellum solver.

Now when I get to the vellum constraint property, I try to get the attribute value:

int point = primpoints(0, @primnum)[0];
int attribValue = point(2, "pressure_amount", point);

printf("%i \n", attribValue);

Surprise! doesn't work. Vex console just outputs zeroes.
Strange thing with VEX console is that the output is some kind of corrupted. If I printf just something like P.x, P.y, P.z of a point - it just repeats like 20-30 values. Just keeps repeating it and in the end it just prints 5 equal values.

Please, help me sort this out, the disability to understand whats going on is driving me crazy haha

File attached.

Cheers,
Nick

Attachments:
inflation.hip (539.0 KB)

User Avatar
Member
205 posts
Joined: Jan. 2014
Offline
Hi Nick,

You are iterating over the constraint geometry, which you can find by looking into this parm:
/obj/geo1/vellumsolver1/dopnet1/forces/vellumconstraintproperty1/bindgeo
Your attribute only exists on the geometry points, not the constraints. It's important to know with which geometry you work in dop.

Thanks,
Ivan
Edited by anon_user_09389530 - Nov. 1, 2020 19:10:05
I contribute to the beauty of this world
https://houdininotes.ivanlarinin.com/ [houdininotes.ivanlarinin.com]
User Avatar
Member
8 posts
Joined: Sept. 2020
Offline
Hey Ivan,

Thanks a lot for the clarification.

Could you please correct me where I'm wrong:

1. The constraint property actually shows my custom attribute - it's called pressure_amount and it's there, see screenshot.
2. I've updated my VEX and it is somehow working now, but I'm not sure if that's the correct behavior
I've also changed the second input to copytopoints not attribcreate.

int point = primpoints(2, @primnum)[0]; // gets first point of the primitive from the copytopoints.
int attribValue = point(2, "pressure_amount", point); // gets attribute of this point.

printf("%i \n", attribValue);


Also, the console still acts strange, but it is somehow working. Not in the way I was looking it to work

My idea was to inflate one “cell” (the 2 grid pillow-like thing) at the time and one after another in a row, and now, I think that I will need to introduce some kind of a sorting there, right? Cause as I see @primnum doesnt go 0,1,2 on prims.

Attachments:
Screenshot 2020-11-02 075120.png (67.5 KB)

User Avatar
Member
205 posts
Joined: Jan. 2014
Offline
You're welcome
1. The “vellumobject1” contains 3 “sub-data” on itself (Geometry, ConstraintGeometry, PatchGeometry)
There is only one pressure_amount on your “Geometry” (actual geometry polygons)

Also,
You ask for a primitive attribute from your “Geometry” using “Constraint Geometry”'s @primnum. It just returns a random value.
2. Check my hip file, please

Cheers
Edited by anon_user_09389530 - Nov. 2, 2020 02:45:00

Attachments:
inflation_v02.hiplc (639.1 KB)
4qgreMmm9l.png (56.2 KB)

I contribute to the beauty of this world
https://houdininotes.ivanlarinin.com/ [houdininotes.ivanlarinin.com]
User Avatar
Member
8 posts
Joined: Sept. 2020
Offline
Hey Ivan,


Ooohh, yeah that totally makes sense. Thanks so much, finally after 3 days and your help I've achieved the desired result.
Thanks a lot!

Cheers,
Nick
  • Quick Links