CinnamonMetal Posted August 21, 2018 Share Posted August 21, 2018 I'm running the Scatter SOP within a ForEach SOP, when entering in three for the Force Total Count parameter, I obviously get three points, but when I enter this expression rand(detail("../foreach_begin3_metadata1/","iteration",0)) Those three points disappear and there is zero points; yet those three points should remain in the scene ? Quote Link to comment Share on other sites More sharing options...
Noobini Posted August 21, 2018 Share Posted August 21, 2018 (edited) cuz rand returns a float between 0-1 so after generating a random float say...0.2, mult this by say 10...and you'll get 2 Edited August 21, 2018 by Noobini 1 Quote Link to comment Share on other sites More sharing options...
jamesr Posted August 21, 2018 Share Posted August 21, 2018 (edited) To expand up Noobini's reply, you should put the result of the rand() into a fit01() function and you'll get results that range between your desired amounts. Can throw a floor() on there to force an integer while you're at it too, but not really necessary in this case (but maybe others in the future....) floor(fit01(rand(detail("../m", "iteration", 0)), 2, 10)) Edited August 21, 2018 by jamesr Quote Link to comment Share on other sites More sharing options...
CinnamonMetal Posted August 22, 2018 Author Share Posted August 22, 2018 @Noobini The first argument of the fit function multiplies by 10 or that was just an arbitrary number ? Quote Link to comment Share on other sites More sharing options...
jamesr Posted August 22, 2018 Share Posted August 22, 2018 (edited) @CinnamonMetal I just picked an arbitrary range as an example Edit: whoops you were replying to the other Edited August 22, 2018 by jamesr 1 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.