WLVL Posted February 4, 2016 Share Posted February 4, 2016 Hello Everyone! I have a Pop source followed by a pop group; i need the number of points contained in my source group to be stored in a variable that i am using in a fit function. npointsgroup function returns 0, (tried also with the npoints function) what am i doing wrong? int npts = npointsgroup(0,"stream_chunks"); float ptprog = fit(@Frame, ch("s_frame"), ch("e_frame"), ch("s_value"),npts); ingroup = (@id>ptprog); PS_i am trying to print the value but also this seem not to work //void printf("npts= %d", npts); Thank you in advance! Quote Link to comment Share on other sites More sharing options...
loopyllama Posted February 4, 2016 Share Posted February 4, 2016 int npts = npointsgroup(0,"stream_chunks"); float ptprog = fit(@Frame, ch("s_frame"), ch("e_frame"), ch("s_value"),npts); ingroup = (@id>ptprog); If you are doing that business in pops, throw it in a sop solver. Inside the default sop solver in pops, drop down a wrangle with: i@numpts = npoints(0); and hook it up to the Dop Import "dop_geometry". numpts shows up with the correct count in the geometry spreadsheet. Quote Link to comment Share on other sites More sharing options...
WLVL Posted February 4, 2016 Author Share Posted February 4, 2016 Hi loopyllama! thank you for helping, it worked!! I was using that code in the pop_group node. Why does it not work there? thank you Quote Link to comment Share on other sites More sharing options...
loopyllama Posted February 5, 2016 Share Posted February 5, 2016 You can throw down a POP Wrangle in DOPS, go to the Inputs tab, and set Input 1 to Myself. In the Code tab enter: i@foo = npoints(0); i@bar = npointsgroup(0,"MyGroupName"); assuming that "MyGroupName" exists. 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.