Jump to content

Check value every 10 seconds and trigger animation based on value


Recommended Posts

Hi guys,


I have this constantly moving particles and I create connections between them.

Now I want to 'disconnect' or 'reconnect' them sporadically. 


I would like to create an pre defined animation for that with a carve SOP and trigger that animation based on distance of the connection. I have already captured that distance attribute on the primitives.

Of course I don't want this to happen all the time, just some times. Every 10/20 seconds have a check on every primitive if a reconnection/disconnection is necessary. (Seconds/time ofcourse offsetted on every prim)



Now how would someone go about this?

Is CHOPs required for this? Then maybe this is the trigger for me to go and learn CHOPs....

Or is it better/easier to do this in VEX, if that is possible?


Here is the hip I have so far: CheckEvery10SecondsAndConnectOrDisconnect.hipnc


Thanks in advance. :) 

Edited by Krion
Link to comment
Share on other sites

I'm in exactly the same kind of research.
It seems that CHOP is one of the solutions.
you can look here there is a file with a CHOP example.
Don't sure it matches your needs, but may be a clue.
In my case, animated instance seems to be an alternative solution.
Anyway, I'm also interested if you find a solution.
On my side if I find one I will post it.


Edited by flcc
Link to comment
Share on other sites

I saw your post just before posting mine, but I thought it was a different problem.
Maybe I don't quite understand what you want to achieve: Do you want the repeating bleeps to fade away based on a ramp?


Anyways, in this version of the hip I've also put the animation I want to be triggered: CheckEvery10SecondsAndConnectOrDisconnect-elaborated.hipnc 




I'll keep searching too! 

Edited by Krion
Link to comment
Share on other sites




It seems to happen far more often than 24 frames visually. What I had in mind was that the connections basically start connected, but I want some of them to occasionally disconnect if they become too short or too long or reconnect if some come back to 'normal length' again. And then that connection would go disconnect in an eased (keyframed?) way toward the middle. And I want to check if that is needed every 10 seconds or so.

If I change your %24 too longer it no longer works. I don't quite understand.


Here is the result of my failed trying so far, haha.. my head hurts:


and a psuedocode was written before I went and pre-implemented those CHOPs:


edit: Never mind guys. I think I want to go too fast... 
I need to break this up into smaller problems..

edit: Somebody clued me in that first the @primnum of the created connections need to become stable and not change all the time in order for me to work on them.. somehow. If anyone has an idea, it’s still welcome.


Edited by Krion
Link to comment
Share on other sites

Here is another attempt to control the carve value. I promoted the i@id, from the dopnet from points to primitives to avoid any changing @primnums.

int duration = 240;     // ten seconds @ 24fps. $FEND
int travel_time = 96;   // frame count to traverse length.
i@on_frame = int(fit01(rand(@id),6,(duration-travel_time)));
i@off_frame = i@on_frame + int(fit01(rand(@id+801),6,travel_time));
if ((@Frame>=i@on_frame) && (@Frame<=i@off_frame)) {
    f@carveValue = fit(@Frame,i@on_frame,i@off_frame,0,1);	// or 1,0
} else {
    f@carveValue = 1.0;	// or 0.0.




Edited by Atom
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.

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...