Farmfield Posted July 9, 2016 Share Posted July 9, 2016 (edited) Hmm, if I feed a fractured object into DOPs, there just gotta be a simple way to determine if a piece is broken off or not, right? Or do I need to set something "manually", start checking distances to neighbouring pieces or alike? And this is fractured RBD's, not packed primitives, as I'm doing per piece stuff in a SOP solver. Just so that's clear. Edited July 9, 2016 by Farmfield Quote Link to comment Share on other sites More sharing options...
Atom Posted July 9, 2016 Share Posted July 9, 2016 You can examine the rest position and see if that is different than the actual position. That will tell you if the piece has moved since the start of the simulation. if (v@P.x != v@rest.x){ f@is_moving = 1; } else { f@is_moving = 0; } Quote Link to comment Share on other sites More sharing options...
Farmfield Posted July 9, 2016 Author Share Posted July 9, 2016 Aah, no, that won't help. Think about like you wanted to color any broken off piece of a fractured object. Worst case scenario I have to set something up manually, measure relative distances on a per piece basis and split them up using some kind of limit - but I was hoping for a simpler solution. Quote Link to comment Share on other sites More sharing options...
rayman Posted July 10, 2016 Share Posted July 10, 2016 Something like this maybe? SOP_PiecesRelativeBreak_v01.hiplc Quote Link to comment Share on other sites More sharing options...
rayman Posted July 10, 2016 Share Posted July 10, 2016 (edited) Also non-pacekd version ( a bit broken with the rotations :/ ) SOP_PiecesRelativeBreak_v02.hiplc Edited July 10, 2016 by rayman Quote Link to comment Share on other sites More sharing options...
Farmfield Posted July 10, 2016 Author Share Posted July 10, 2016 (edited) My problem is I need to identify single pieces only. My ideas so far is to either use the debrissource SOP and measure the amount of source points (one exposed prim will equal one value, two the double, etc) against a limit - or perhaps dissect and mod the debrissource subnet to fit my needs. My second idea was to measure the centroid of each piece to the centroid of its neighbouring pieces (the connect adjacent pieces would work for that), then compare that distance to determine if a piece is disconnected or not. Dunno how the connectadjacent pieces sequences itself, but I might be able to use it in SOPs and again in DOPs using a SOP solver and compare between the outputs... And I just love how I get these ideas that seems so simple at first but turns out to be surprisingly complicated to figure out - especially if you, like me, want to uncomplicate it into a really, really simple solution. Edited July 10, 2016 by Farmfield Quote Link to comment Share on other sites More sharing options...
alksndr Posted July 10, 2016 Share Posted July 10, 2016 Can you compare the velocity of each piece vs the whole? So if the velocity is different then we know something must have changed and it broke off. I guess it would also need to then remove that piece from the "whole" calculation. Was messing around with it but I haven't used non packed stuff in forever, don't see a v attribute. Failed at the first step smh. Connect adjacent sounds better though, think thats the right way to go. Quote Link to comment Share on other sites More sharing options...
rayman Posted July 11, 2016 Share Posted July 11, 2016 Well if you check the files above you can see that there is a "broken" attribute which is float. broken=1 means that all connections to that piece are broken, so it is a single chunk. broken>0 && broken<1 means that some of the connections to that piece are broken. I modified the file again, so it now works much better with non-packed. Red pieces are single chunks (broken=1.0), yellows are partially broken. SOP_PiecesRelativeBreak_v03b.hiplc 2 Quote Link to comment Share on other sites More sharing options...
Farmfield Posted July 11, 2016 Author Share Posted July 11, 2016 (edited) Aah, I missed that, Pavel, the attribute. I've been locked up with other stuff so I didn't take the time to dig into your setup deep enough - that's on me, sorry. Here's what I came up with - the single wrangle, though, haven't managed to figure out how to compare two arrays in an if statement... SOP_PiecesRelativeBreak_FF.v2.hiplc Edited July 11, 2016 by Farmfield 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.