Krion Posted December 8, 2019 Share Posted December 8, 2019 (edited) 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 December 8, 2019 by Krion Quote Link to comment Share on other sites More sharing options...
flcc Posted December 9, 2019 Share Posted December 9, 2019 (edited) 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 December 9, 2019 by flcc Quote Link to comment Share on other sites More sharing options...
Krion Posted December 9, 2019 Author Share Posted December 9, 2019 (edited) 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 December 9, 2019 by Krion Quote Link to comment Share on other sites More sharing options...
Atom Posted December 9, 2019 Share Posted December 9, 2019 Here is an attempt to remove and establish the line between the points. This is every 24 frames. It leverages your idea of programming the Carve with an on off value. ap_CheckEvery10SecondsAndConnectOrDisconnect-elaborated.hipnc 1 Quote Link to comment Share on other sites More sharing options...
Krion Posted December 9, 2019 Author Share Posted December 9, 2019 (edited) @Atom Thanks 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: CheckEvery10SecondsAndConnectOrDisconnect-elaborated2-failedTrying.hipnc and a psuedocode was written before I went and pre-implemented those CHOPs: [image] 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 December 11, 2019 by Krion Quote Link to comment Share on other sites More sharing options...
Atom Posted December 10, 2019 Share Posted December 10, 2019 (edited) 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. } ap_CheckEvery10SecondsAndConnectOrDisconnect-elaborated.hipnc Edited December 10, 2019 by Atom 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.