catchyid Posted April 28, 2017 Share Posted April 28, 2017 Hi, I have a simple simulation for sparks generation (plz see attached). Although I can generate the sparks and control their lengths as I wish, I cannot seem to know how to control their thickness, i.e. I want each spark to have a different size. I've tried three different method to vary the thickness but no works. In the setup, I use pop network to emit particles, then use add to create poly-lines for each spark, then: -If I use wireframe node, I could not find any variable that changes the wire thickness per primitive, I've tried $PR but it does not work (the whole node gets reddish lines) -If I use for each loop to scale each primitive alone, the transform node would scale the spark uniformly and although it's possible to try to orient the transform node with the spark such that it would be possible to scale the thickness only, it would require some math and I don't think it should be that "troublesome" -If I use for each loop and generate each spark individually by sweep+skin, the circle that is used for cross section is outside the loop and it cannot be changed for each primitive! Thanks, laser_sparks_odforce.hip 1 Quote Link to comment Share on other sites More sharing options...
Sepu Posted April 28, 2017 Share Posted April 28, 2017 (edited) Just add a wrangle + the polywire create an attribute in wrangle add this f@width = fit01(rand(@my_id + ch("seed")), .015, .075); then in the polywire on the wire Radius add "@width" attached is a scene with the changes. laser_sparks_odforce.hipnc Edited April 28, 2017 by Sepu 1 Quote Link to comment Share on other sites More sharing options...
dayvbrown Posted April 28, 2017 Share Posted April 28, 2017 (edited) Hi Khaled, The attribute you're looking for is width, it can control the render of a curve. You won't need to "skin" or make geo out of the curves in this instance if you're rendering with mantra. So simplest way is in an attribute wrangle directly after the "add1" run over Primitives something like - @width = fit01(rand(@primnum), 0.1, 0.5); Then you can simply render them as curves, they will be flat (not round) but for most spark type fx i've found this to do the job Edited April 28, 2017 by dayvbrown 1 Quote Link to comment Share on other sites More sharing options...
catchyid Posted April 28, 2017 Author Share Posted April 28, 2017 Thaaaaaaaanks guys for your help One last question: I thought that we could not use attributes in VEX code only (i.e. not in HScript), but obviously, I am mistaken, so my question: is it always the case that we can use @attributes in HScript OR this example is a special case? Once more, thanks for your help Quote Link to comment Share on other sites More sharing options...
Sepu Posted April 28, 2017 Share Posted April 28, 2017 @attrbites are use in Vex, Im not using hscript anywhere on the wrangle that I added. 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.