Jump to content

VEX problem - add point(s)... [SOLVED]


Recommended Posts

Hi guys, 

 

I want to use the pointwrangle with addpoint(geoself(), @ptnum) to clone the current point for a fulfilled condition in a pointwrangle...and it works, but just once...as soon as it creates the first point, even if the condition is further fulfilled in the animation, not one other point is added...so a point is generated only for the first time the condition makes it...

 

this is what I am using to generate a point for each 0.2 increment of an animated sine wave :

 

@increment = ch("sineInc");
//sineInc is a spare parameter, value 0.2
//crtSine is an animated sine wave attribute going between -1 and 1
//lastSineStep is initialised to the value of crtSine at the first frame of animation, and if the condition bellow is satisfied, increased with the value of increment after the point is created
 
if ( abs(@crtSine - @lastSineStep) > @increment )
    {
    addpoint(geoself(), @ptnum);
    //clone current point
    @lastSineStep += @increment;
    //increase the last threshhold with "increment
    }
 

file is attached bellow...

 

thanks.

 

thanks

 

attached a simplified scene...

sample.hip

Edited by cojoMan
Link to comment
Share on other sites

thanks a lot, Joe :D

help me out a bit more please !

 

looking at the geometry spreadsheet - I don't quite understand why :

1.after the points have been created - I would expect them to stay created - but by the end of the animation they appear and dissapear, though I have nothing that would delete them in the wrangle

2.for some reason I get 3-5 points at a time from one frame to the other - the predictable behaviour I thought would have been 1 at a time, when the condition is met...

 

still looking into it, as I might be missing something relevant, but you definately put me on the right path...I couldn't get more than one point until now, now that they are too many and blinking, I'll sort them out :D

 

thanks again, hope you're doing fine over there ;)

cheers

Link to comment
Share on other sites

I think the reason they don't stay created is because it's re-evaluating the incoming geometry each frame. It only has one point to run over on the input. So it checks the condition and creates the new point if the condition is met. Each frame it starts again from one incoming point and executes the first time the condition is met, then ends. Hence the loop. So it's not that they are being deleted, more like they are not being re-created. Sounds like this is a job for the solver sop!

  • Like 1
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...