AntoineSfx Posted June 14, 2018 Share Posted June 14, 2018 Is there a way to use the uv created by uvunwrap to create groups of primitives which belongs to the same piece (within the same boundaries) I like the way uvunwrap creates those connected components, and I was wondering if there is a way to reuse that information at the geometry level, for example to make an exploded view of the object, or some kind of peeling effect I know there are a lot of other ways to create groups of connected primitives, but uvunwrap optimizes for flatness and deformation, which makes sense for what I want to do Quote Link to comment Share on other sites More sharing options...
Noobini Posted June 14, 2018 Share Posted June 14, 2018 can't remember 100% but have you checked Game Dev Tools ? there's some feature to turn edge/seam or seam/edge...as said, can't remember Quote Link to comment Share on other sites More sharing options...
davpe Posted June 14, 2018 Share Posted June 14, 2018 that's easy.check out this article: https://vfxbrain.wordpress.com/2017/09/15/groups-from-attribute/ 1 Quote Link to comment Share on other sites More sharing options...
AntoineSfx Posted June 14, 2018 Author Share Posted June 14, 2018 Thanks, that solved my problem. Any ideas how the uv islands are computed ? I don't understand from which informations the uv boundaries are computed. e.g. if I wanted to emulate connectivity in a pointwrangle.. Quote Link to comment Share on other sites More sharing options...
StepbyStepVFX Posted June 14, 2018 Share Posted June 14, 2018 3 minutes ago, AntoineSfx said: Thanks, that solved my problem. Any ideas how the uv islands are computed ? I don't understand from which informations the uv boundaries are computed. e.g. if I wanted to emulate connectivity in a pointwrangle.. I think you can also use the Connectivity SOP node, with the UV function. It creates an attribute that you can later use to define groups. Quote Link to comment Share on other sites More sharing options...
davpe Posted June 14, 2018 Share Posted June 14, 2018 no idea how it's computed. i guess it's doable in vex but not trivial. btw. there is UV connectivity selection mode that allows selection UV islands like groups but that's only exposed for viewport selection and it seems you can't address it otherwise... at least I haven't found a way. Quote Link to comment Share on other sites More sharing options...
StepbyStepVFX Posted June 14, 2018 Share Posted June 14, 2018 (edited) The way you would do your own VEX "Connectivity SOP" with "Use UV Connectivity" and therefore determine a border of your UV is by returning the list of all vertex associated with a point, and check if the UV attribute is the same for each one. If one vertex relative to a point has different UV attrobute, then the primitive it belongs to is on another island. So to compute the "class" of each island, a non optimal algorithm could be : take a primitive, assign it a "class" number attribute, list its prim neighbours (take its points, and use pointprims function to retrieve the prims containing this point); then for each points of this prim, list the vertices that refer to it; for each vertices, retrieve the prim to which it belong, and assign the same "class" number to neighbour prims only if the vertices refering to the same point have the same UV attribute. If not, skip the primitve. Iterate over all neighbours prims, and for all those prims that has the same "class", list their neighbours that hasn't been assigned a "class" (to avoid infinite loops over the same island), and apply the algorithm until there are no neighbours that (i) hasn't been assigned a class attribute or (ii) that hasn't been skiped in that loop. Then iterate on the "remaining" primitives (the ones that has not yet been assigned a class or that has been previously skipped because belonging to another island). I am pretty sure this can be run more efficiently to avoid some prims to be visited several times before being assigned a class, but this should work... Edited June 14, 2018 by StepbyStepVFX Quote Link to comment Share on other sites More sharing options...
AntoineSfx Posted June 14, 2018 Author Share Posted June 14, 2018 4 minutes ago, StepbyStepVFX said: The way you would do your own VEX "Connectivity SOP" with "Use UV Connectivity" and therefore determine a border of your UV is by returning the list of all vertex associated with a point, and check if the UV attribute is the same for each one. If one vertex relative to a point has different UV attrobute, then the primitive it belongs to is on another island. So to compute the "class" of each island, a non optimal algorithm could be : take a primitive, assign it a "class" number attribute, list its prim neighbours (take its points, and use pointprims function to retrieve the prims containing this point); then for each points of this prim, list the vertices that refer to it; for each vertices, retrieve the prim to which it belong, and assign the same "class" number to neighbour prims only if the vertices refering to the same point have the same UV attribute. If not, skip the primitve. Iterate over all neighbours prims, and for all those prims that has the same "class", list their neighbours that hasn't been assigned a "class" (to avoid infinite loops over the same island), and apply the algorithm until there are no neighbours that (i) hasn't been assigned a class attribute or (ii) that hasn't been skiped in that loop. Then iterate on the "remaining" primitives (the ones that has not yet been assigned a class or that has been previously skipped because belonging to another island). I am pretty sure this can be run more efficiently to avoid some prims to be visited several times before being assigned a class, but this should work... Absolutely.. I missed the fact that one point is associated with several vertices, and that when they don't also share the same UV coordinates, it means it's on the boundary.. 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.