when i want delte groups by the group center, i found two way: copy_stamp and foreach, but both way are too slow,is there other methord to do it?
here is a hip showing what i want!
find primGroup center faster
3150 4 1- luoqiulin
- Member
- 303 posts
- Joined: May 2007
- Offline
- Pagefan
- Member
- 519 posts
- Joined:
- Offline
Is this what you are after?
You can use a primitive attribute prim(“../mountain1”, $PR, “P”, 0) which, according to the help, provides the X component of the centroid (or the barycenter, not sure, see this post: http://www.sidefx.com/index.php?option=com_forum&Itemid=172&page=viewtopic&t=19407 [sidefx.com] )
After that just a delete sop and it is waaay faster than copy-stamping and for eaches
You can use a primitive attribute prim(“../mountain1”, $PR, “P”, 0) which, according to the help, provides the X component of the centroid (or the barycenter, not sure, see this post: http://www.sidefx.com/index.php?option=com_forum&Itemid=172&page=viewtopic&t=19407 [sidefx.com] )
After that just a delete sop and it is waaay faster than copy-stamping and for eaches
- luoqiulin
- Member
- 303 posts
- Joined: May 2007
- Offline
Pagefan
Is this what you are after?
You can use a primitive attribute prim(“../mountain1”, $PR, “P”, 0) which, according to the help, provides the X component of the centroid (or the barycenter, not sure, see this post: http://www.sidefx.com/index.php?option=com_forum&Itemid=172&page=viewtopic&t=19407 [sidefx.com] )
After that just a delete sop and it is waaay faster than copy-stamping and for eaches
thank you for your reply,but $PR finds every prim value, what i need is each group's value
- tamte
- Member
- 8637 posts
- Joined: July 2007
- Offline
what about this?
precomputing Group Center as Primitive attribute before mountain SOP
so the foreach or copy will process only once
then after mountain delete by this attribute
it will work for your example since mountain is not moving pieces in X but if you
want centers to update according to deformation you'll probably need other solution like:
creating points for each group center, then deform, then delete groups whose corresponding point meets the criteria
look at the attached file for both methods
they are realtime now (after a few seconds of waiting for preprocess)
precomputing Group Center as Primitive attribute before mountain SOP
so the foreach or copy will process only once
then after mountain delete by this attribute
it will work for your example since mountain is not moving pieces in X but if you
want centers to update according to deformation you'll probably need other solution like:
creating points for each group center, then deform, then delete groups whose corresponding point meets the criteria
look at the attached file for both methods
they are realtime now (after a few seconds of waiting for preprocess)
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
- luoqiulin
- Member
- 303 posts
- Joined: May 2007
- Offline
tamte
what about this?
precomputing Group Center as Primitive attribute before mountain SOP
so the foreach or copy will process only once
then after mountain delete by this attribute
it will work for your example since mountain is not moving pieces in X but if you
want centers to update according to deformation you'll probably need other solution like:
creating points for each group center, then deform, then delete groups whose corresponding point meets the criteria
look at the attached file for both methods
they are realtime now (after a few seconds of waiting for preprocess)
thank you very much!
it's helpful for me
-
- Quick Links