katisss Posted February 18, 2010 Share Posted February 18, 2010 (edited) 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 February 18, 2010 by katisss Quote Link to comment Share on other sites More sharing options...
edward Posted February 19, 2010 Share Posted February 19, 2010 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 Quote Link to comment Share on other sites More sharing options...
edward Posted February 19, 2010 Share Posted February 19, 2010 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.) 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.