Jump to content

animate vertices in SOP


Recommended Posts

hi,

nob question:

what is the fastet way to animate vertices on a deforming mesh in a sop to my polys?

Rebuilding the mesh is way to slow..

I read the data from a file but are cluesless about how to apply it

any help would be appreciated..

i just found this, is this what i do?

Phandle = gdp->getAttribute(GEO_POINT_DICT, "P");

for (i = 0; i < npts; i++)

{

Phandle.setElement(gdp->points()(i));

Pvalue = Phandle.getV4();

Pvalue.y() = sin(Pvalue.x()*.2 + Pvalue.z()*.3 + frame);

Phandle.setV4(Pvalue);

}

This is my first sop so i am happy with any suggestion for architecture.

Better make it 2 sops: 1 for building and a deformer?

Edited by katisss
Link to comment
Share on other sites

You can just override SOP_Node::shouldResetGeoToEmpty() to return false, then your gdp will be preserved across cooks (as long as it is still cached). Then can probably do some logic like this:

- Check if gdp is empty, if it is then build the geometry. If it's not empty, then we have already built our geometry.

- Update the point positions

Link to comment
Share on other sites

PS. If you end up splitting it into two SOPs (not a bad usability idea), then for your deformer, use SOP_Node::duplicateChangedSource() to copy the geometry. That function will be smart enough to reuse old geometry when it can.(and if it can't, a full copy will be done.)

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...