hatrick Posted November 25, 2013 Share Posted November 25, 2013 (edited) Hi, I d like to use the foreach workflow for several ideas. Could you please take a look at the attached file which hopefully illustrates my attempts. 1) How to setup the loop to rotate each single piece around a given vector? 2) How i can setup uv's for each single piece? 3) How i can randomly assign different materials to each single part in the loop? Thank you ! Lucas !!sorry wrong place for this !! foreach_012.hip Edited November 25, 2013 by hatrick Quote Link to comment Share on other sites More sharing options...
rafaelfs Posted November 25, 2013 Share Posted November 25, 2013 (edited) Check the attached file and let me know. I'm not sure you need a foreach for everything you wanted to accomplish there,scaling and rotating for example, but I did implement something. Hope it helps. Cheers Edited November 26, 2013 by rafaelfs Quote Link to comment Share on other sites More sharing options...
hatrick Posted November 25, 2013 Author Share Posted November 25, 2013 sounds promising rafaelfs. it seems you did not attach the file! thank you Quote Link to comment Share on other sites More sharing options...
rafaelfs Posted November 26, 2013 Share Posted November 26, 2013 (edited) sounds promising rafaelfs. it seems you did not attach the file! As promising as a big fat ball of nothing! Sorry, here goes the file. Cheers foreach_012.hip Edited November 26, 2013 by rafaelfs 1 Quote Link to comment Share on other sites More sharing options...
hatrick Posted November 26, 2013 Author Share Posted November 26, 2013 exactly what i need ! thanks again ! Quote Link to comment Share on other sites More sharing options...
hatrick Posted November 28, 2013 Author Share Posted November 28, 2013 (edited) could you please recheck the file.. another issue came up with the axis setup cheers foreach_014_odforce.hip Edited November 28, 2013 by hatrick Quote Link to comment Share on other sites More sharing options...
rafaelfs Posted November 28, 2013 Share Posted November 28, 2013 could you please recheck the file.. another issue came up with the axis setup Can you elaborate a bit on the issue? What was your intention? Quote Link to comment Share on other sites More sharing options...
hatrick Posted November 28, 2013 Author Share Posted November 28, 2013 rotating each face around its centerpoint ... the rotation axis should point outwards , in the initial example i setup N as Axis via $TX $TY etc. when transforming the geo away from centerpoint the rotations axis gets messed up. i also tried to setup the normal in other ways without sucess ... Quote Link to comment Share on other sites More sharing options...
rafaelfs Posted November 28, 2013 Share Posted November 28, 2013 I see, this new file should do the trick. I missed the point about rotating around the center point in my previous example, sorry about that. Cheers foreach_014_odforce.hip 1 Quote Link to comment Share on other sites More sharing options...
rafaelfs Posted November 28, 2013 Share Posted November 28, 2013 Also, there's a small setup with the facet SOP and a couple attribute promote nodes inside the foreach. It could have been put outside the foreach for extra performance, but I left it inside just to make obvious what it's meant for. You should fix that in your final setup as there's no need to recalculate it for every piece at every iteration. Cheers Quote Link to comment Share on other sites More sharing options...
petz Posted November 28, 2013 Share Posted November 28, 2013 rotating each face around its centerpoint ... the rotation axis should point outwards , in the initial example i setup N as Axis via $TX $TY etc. when transforming the geo away from centerpoint the rotations axis gets messed up. i also tried to setup the normal in other ways without sucess ... the problem is not the axis but the pivot of rotation. however, this can easily be done in vops without using the foreach-sop. hth. petz foreach_014_odforce1.hip 1 Quote Link to comment Share on other sites More sharing options...
hatrick Posted November 28, 2013 Author Share Posted November 28, 2013 it is so nice to see how passionate things are handled at this place ! thank you! Quote Link to comment Share on other sites More sharing options...
hatrick Posted November 29, 2013 Author Share Posted November 29, 2013 (edited) so for the random material assignement the foreach is the way to go ? further there are issues with the uv mapping...i need the same projection plane allignement found in the uv project SOP looped for every single piece in the forech. thanks in advance Edited November 29, 2013 by hatrick Quote Link to comment Share on other sites More sharing options...
hatrick Posted November 30, 2013 Author Share Posted November 30, 2013 (edited) ... the uv rotation is still a problem with this method.... anyone ? thank you ! foreach_uvmapper11.hip Edited November 30, 2013 by hatrick Quote Link to comment Share on other sites More sharing options...
hatrick Posted November 30, 2013 Author Share Posted November 30, 2013 next version with fixed distortion .... but the corret uv rotation is still missing... foreach_uvmapper22.hip Quote Link to comment Share on other sites More sharing options...
petz Posted November 30, 2013 Share Posted November 30, 2013 (edited) not sure what you mean with "correct rotation" but maybe this is what you are looking for. petz foreach_014_odforce1.hip Edited November 30, 2013 by petz 1 Quote Link to comment Share on other sites More sharing options...
hatrick Posted November 30, 2013 Author Share Posted November 30, 2013 you provide great learning sources petz!! so a lot of questions come up. maybe you find some time to answer a few... 1) i am completly lost with the vector syntax in the first attrib wrangler ... vector tri[] = {{0.0, 0.0, 0.5}, {0.5, 1.0, 0.5}, {1.0, 0.0, 0.5}}; @uv = tri[@vtxnum % 3]; no idea how you get uv's forech faceset ... do you manually setup a triangle with the vector matrix? how would you set this up for other polygonal shapes? 2) what is the idea behind sorting "by vertex order" ? 3) why you promote the id attrib "by first match" ? 4) what about the translate and the invert VOP in the VOPSOP where you cycle throu every set of points which share the the same id attrib? Thank you ! Lucas Quote Link to comment Share on other sites More sharing options...
hatrick Posted November 30, 2013 Author Share Posted November 30, 2013 (edited) @rafaelfs: for everyone who is interested. your methods give a lot of insigths into a foreachSOP workflow. Thank you for that! Edited December 1, 2013 by hatrick Quote Link to comment Share on other sites More sharing options...
caleb Posted December 2, 2013 Share Posted December 2, 2013 Hi! Might help - I've just uploaded a trace_foreach SOp asset to orbolt. I'll post the link when it clears. -caleb Quote Link to comment Share on other sites More sharing options...
hatrick Posted December 2, 2013 Author Share Posted December 2, 2013 (edited) thx! i'll take a look. in the meantime: Could anyone please explain where s the failure in the attached network. i tried to follow petz' method with manual uv setup with an attribwrangle. it should work for a hex and the uv's are getting messed up when cycling throung the 6th vertex. THX... ATTRIB_wrang_uv_03.hip Edited December 2, 2013 by hatrick 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.