squardis Posted June 15, 2018 Share Posted June 15, 2018 Hi, I have large scene with alot of geometry wher some have UV's and some who doesnt. I imported the whole scene as one obj file so it thinks it has UV's. I know there is a way to determine if it has to uv's I saw in the simple baker that it has a switch that unwraps the model if it doesnt have any: haspointattrib(0, "uv")||hasvertexattrib(0, "uv") But this doesnt work. because it has a attribute uv, which is empty on some object. Is there another way to look for objects that doesnt have uv's? or where the uv attr views none uv's? thnx Quote Link to comment Share on other sites More sharing options...
ThomasPara Posted June 15, 2018 Share Posted June 15, 2018 One way is to use a for-each loop with connectivity. Make an attribute on your geo that checks the length of the uvs. Promote that attribute to detail twice, where one is set to maximum, and one to minimum. Compare the values, and if they are equal, its likely that there is no uvs. 1 Quote Link to comment Share on other sites More sharing options...
davpe Posted June 15, 2018 Share Posted June 15, 2018 (edited) ...or in vertex wrangle: i@hasuv = 0; float test = max(uv); if(test >0) {@hasuv = 1;} that should generate and attribute with values 0 for vertices with no uvs and 1 for verts with uvs. if you promote to primitive you can isolate polygons. Edited June 15, 2018 by davpe 1 Quote Link to comment Share on other sites More sharing options...
squardis Posted June 15, 2018 Author Share Posted June 15, 2018 Thank you both!! The wrangle is realy easy to read! It should be: float test = max(@uv); Also it gave me by testing it on a unwrapped cube one value on the spreadsheet of 0. But by promoting it, it luckely disappeared. Hopefully it works on the rest of the stuff now. uhmmm... damn nope it didnt realy worked as expected... there are some objects that are just getting deleted who has uv's. if(test != 0) // did some fix too.. Im almost there float test = abs(length(@uv)); //gives me also some result for uv's that are placed in a negative uv sheet: i@hasuv = 0; float test = abs(length(@uv)); if(test > 0) {@hasuv = 1;} Now Im almost there... How to find overlap procedurally? Any idea? scene2_uvCleanUp-ViaWrangle.hip 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.