GlennimusPrime Posted March 20, 2024 Share Posted March 20, 2024 (edited) Hello helpful wizards! As the title says, I'd like to emit one particle per second, with the first particle being emitted on frame 1. I'm currently making use of the 'constant birth rate' setting, as I would eventually like to be able to adjust this to say, 10 per sec, or 0.5 per sec. My problem is, the first particle doesn't emit until after the first second has elapsed. How can I begin emission on frame 1 instead of waiting? The only way I can get a similar result is by using 'all points' emission type and setting the 'impulse activation' to 1 - Although this does not give me the control I'm after by wanting to emit 1 particle per second, or 10 per sec, or 0.5 per sec. Here is a very simple .hip file emit_particles.hipnc Edited March 20, 2024 by GlennimusPrime Quote Link to comment Share on other sites More sharing options...
Atom Posted March 20, 2024 Share Posted March 20, 2024 Try setting the source emission type to "All Points" and try this expression in the impulse activation field. $SF%$FPS==1 By referencing the FPS, you can determine what one second is. Quote Link to comment Share on other sites More sharing options...
GlennimusPrime Posted March 21, 2024 Author Share Posted March 21, 2024 Thanks @Atom this works but doesn't give me the control I'm after, of wanting to eventually emit say, 10 particles per sec, or 100 particles per sec. Any ideas to help in this situation? Quote Link to comment Share on other sites More sharing options...
dleonhardt Posted March 21, 2024 Share Posted March 21, 2024 You could tell the DOP Network to start the simulation one second earlier so you have your first particle on the first frame. Just use a negative frame number on the Start Frame parameter. Quote Link to comment Share on other sites More sharing options...
Atom Posted March 21, 2024 Share Posted March 21, 2024 (edited) You control the point input count. Just use a scatter before the popnet instead of an add to set the number of points per second. Or do the math to alter the expression. $FPS defaults to 24. $SF%24==1 is one per second. $SF%12==1 is two per second. Edited March 23, 2024 by Atom 1 Quote Link to comment Share on other sites More sharing options...
GlennimusPrime Posted March 24, 2024 Author Share Posted March 24, 2024 I've been working with controlling the input count like you've suggested @Atom, by removing the point when I don't want it firing with this vex: if ($F % chi("shoot_every_frames")){ removepoint(0,@ptnum); } Although I have the same issue with the first 'bullet' not firing on frame 1 (I also realise I will eventually have the issue of the bullet not firing when I toggle a 'fire' on/off attribute too). I wasn't sure what you meant about using the scatter node - This wants to scatter points onto geometry right? emit_particles_v02.hipnc Quote Link to comment Share on other sites More sharing options...
Atom Posted March 25, 2024 Share Posted March 25, 2024 The simplest fix might be to simply special case frame #1. if(@Frame!=1){ if ($FF % chi("shoot_every_frames")){ removepoint(0,@ptnum); } } Quote Link to comment Share on other sites More sharing options...
GlennimusPrime Posted March 25, 2024 Author Share Posted March 25, 2024 Thanks @Atom! Making great progress! I've also created a 'firing' toggle with your previous vex wrapped in another if statement (if firing == 1, shoot bullets, else remove all points). int fire = chi("firing"); if(fire==1){ if(@Frame!=1){ if ($FF % chf("shoot_every_frames")){ removepoint(0,@ptnum); } } } else{ removepoint(0,@ptnum); } I think I now need to know which frame that fire toggle has been activated? My thoughts are to replace: '@Frame!=1` With: '@Frame!=@fire_activation_frame' I just need to work out how to store that '@fire_activation_frame' attribute when the fire toggle is first set to 1. Any ideas? emit_particles_v03.hipnc 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.