Jump to content

SOP/Group Loop


TheDunadan

Recommended Posts

Hi,

searching through the help I could find no answer on the following:

I have an object and virtually subdivided it, into a multitude of point / primitive groups. Almost all operators allow me to use group patterns to specify which primitives / points the operator is supposed to effect: no problem. But how can I avoid using multiple operators if I want to effect X groups, but the the operator is supposed to work on a perGroup-basis (each group is treated seperatly).

I was thinking of some kinda Loop op for groups with two inputs and possibly one parameter field. One input for the desired (S)OP, another one used for the geometry/data and a parameter field used for group Pattern.

Jens

Link to comment
Share on other sites

Not hundred percent sure what you mean, but if you are doing something say with a transform sop and you want it to transform each group seperately by different amounts but you don't want to put down a seperate transform sop for each group then the only way I know at the moment is my old friend the copy sop and by using stamping you can create a group loop when used in conjunction with the delete sop.

If you look at that prim sort otl i posted you should get the idea.

You would need to create numbered groups and loop through them in the delete sop with a pattern something like:

`strcat("group",param("currentgroup",0))`

the currentgroup would be a variable created in the stamp tab of the copy sop and would be set to $CY, you'd just need a way to specify how many groups you want to loop through and you would set the copy sop to make that many copies.

:ph34r:

Link to comment
Share on other sites

I wanted an easy way to extrude/fuse/divide... faces or points on a per group basis. Thanks for the help, though I haven't menaged to get your solution working yet ;). But still I'd like it, if there would be a somewhat more direct approach.

If I got it right: the idea behind your solution is, that if I had 100 groups, I'd create 100 copies via stamping and do what ever I have in mind with these copies and afterwards I delete all the unwanted parts again. If that's the case, this sounds pretty ineffcient to me.

Some "group loop" OP would go nicely hand in hand with the partitionOP B) and it doesn't sound very hard to code either.

Jens

Link to comment
Share on other sites

No that's not really how it works. Using the delete sop in conjunction with stamping create a loop that means between the delete and the copy sop you are only processing one piece of geometry at a time. Basically the delete sop deletes everything except one piece of geometry and for each "loop" this piece is different. Once the copy sop has finished processing all the pieces your model is re-assembled as it was when you started except any sops that you put in between the delete and the copy have been processed on each piece.

Watch this space and i'll post an example.

I don't think though that it will do what you are looking for in this case but it might be useful to know about anyway. :ph34r:

Link to comment
Share on other sites

  • 1 month later...

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