Kino Posted February 21, 2016 Share Posted February 21, 2016 (edited) I have a system in which points are fed to a copy SOP with stamping enabled. All the data I use (think colors, thickness, etc.) to vary the copies are embedded as attributes on the points I feed the copy SOP and I use stamping only for getting the @ptnum out of the sop. Afterwards my geometry generator SOP system uses the point number via "stamp("../copy/", "pointNum", 0)" and then using the stamped point number and the embedded attribs on the initial points it generates the required geo for that instance.Honestly the stamping drops the performance a lot and I was wondering if the same system could be implemented using a Foreach SOP (especially considering the fact that I'm only using @ptnum from stamping). In the similar fashion the foreach sop could separate points and generate geo based on each of them and then merge the results. If you think it's doable, do you think I'll gain any significant performance boost if I switch from Copy/stamp to Foreach?P.S : There also might be a VEX/Wrangle solution to this I'm not seeing. A detail attribute wrangle can separate the points and extract the geo data from them but from there I'm in the dark. If there is I'd appreciate any pointers. Edited February 21, 2016 by Kino Quote Link to comment Share on other sites More sharing options...
Kino Posted February 21, 2016 Author Share Posted February 21, 2016 Here's a simplified example of what I mean, each method is in a subnet CopyStampVSForeach.hipnc Quote Link to comment Share on other sites More sharing options...
f1480187 Posted February 21, 2016 Share Posted February 21, 2016 Just use Performance Monitor. Cook time should be reasonably big. Foreach is even slower on large number of samples in that case. It can be faster in other cases, however. Quote Link to comment Share on other sites More sharing options...
Atom Posted February 21, 2016 Share Posted February 21, 2016 Take a look at sebakine's example file on speeding up this task by using instancing instead of the Copy SOP. Quote Link to comment Share on other sites More sharing options...
Kino Posted February 21, 2016 Author Share Posted February 21, 2016 Just use Performance Monitor. Cook time should be reasonably big. Foreach is even slower on large number of samples in that case. It can be faster in other cases, however. Didn't know about the monitor, it's indeed a good evaluation tool. You're right, with 50000 points foreach takes twice as long as the copy/stamping. Take a look at sebakine's example file on speeding up this task by using instancing instead of the Copy SOP. Hi Atom, I saw the example. Had no idea about the string "instance" attribute which can affect the geo selection, brilliant! Saying that the instance node really isn't the same as copying, is it? you can not access the geo for further manipulation and although sebakine's method is a neat one, it really doesn't let you vary every instance procedurally, does it? I mean you should have pre-made geo and pass their path as the "instance" attribute, you really don't have the freedom as with the copy/stamp node. (or maybe I didn't catch it completely) Quote Link to comment Share on other sites More sharing options...
Kino Posted February 21, 2016 Author Share Posted February 21, 2016 (edited) For future reference I also measured a third method in which I used a Foreach Loop SOP (Block begin/end) and then deleted all the points except for the one that had the same point number as the current iteration. This method was three time slower that foreach subnet and 6 times slower than copy/stampEDIT : Also found this thread http://forums.odforce.net/topic/23099-efficient-way-to-instancecopy-geometry-onto-points/ Edited February 21, 2016 by Kino 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.