THEONLYraider Posted February 4, 2022 Share Posted February 4, 2022 (edited) Hey all, Trying to separate out multiple meshes within a single .obj file, but not coming up with any results. They all have their own named groups, but using the "name from group" node I'm not seeing all the groups correctly named. I'm seeing that the groups that only contain a single pieces of mesh are being put under the "mesh" group. So when I look at the mesh attribute created from the "name from group" node I'm seeing almost half of my meshes incorrectly in it. Ideally I'd like to use a split node within a for each loop to separate each mesh out by group, but I haven't found a way to accomplish that yet. The end goal is to make an HDA that takes in a single .obj file that contains multiple meshes and separate each out so that I can apply the correct texture maps to them and then bake them. Edit: Attached an image of the split node workflow I've done to get them separated. Edited February 5, 2022 by THEONLYraider Image Quote Link to comment Share on other sites More sharing options...
flcc Posted February 5, 2022 Share Posted February 5, 2022 As there don't seem to be many objects you can use the group name or path directly to assign the materials. From what I understand it seems that the group names in the obj file are not correct. Maybe similar names for different groups. If this is the case it may be easier to correct the obj file directly. The group or path names are lines of the form o objectname (for path) or g objectname (for groups) I don't know if this is useful but without seeing the file it is difficult to be more precise import separated obj.hipnc Three Object (groupes).obj Three Object (path).obj Quote Link to comment Share on other sites More sharing options...
THEONLYraider Posted February 6, 2022 Author Share Posted February 6, 2022 (edited) The number of objects within a single file will vary, so it could be 5 or 100's. Doing some more research I found that there might be a python solution that could create nodes from the groups within the file. @f1480187 can hopefully supply a little more info based on the post supplied. I'll still need to delete some groups due to a suffix of "_lod#". If the python code works for creating the nodes based on the groups, would there be a way to delete the groups if they have the "_lod#" suffix? That's something hopefully someone have help out with in the meantime. Thanks for the examples! Edit: Some of the naming issues I'm trying to work around. Each new color is an individual object. In this case I'd like to eliminate each "_2" group. Here's how it looks within the geo spreadsheet for the primitive groups As you can see the values range from 1 - 0 for each group. Since the "name to group" node doesn't correctly copy over the name as an attribute maybe I can use these 1-0 values to fill in the attribute value through vex? Edited February 6, 2022 by THEONLYraider Quote Link to comment Share on other sites More sharing options...
THEONLYraider Posted February 7, 2022 Author Share Posted February 7, 2022 I was able to get an index for the prim groups thanks to this post https://www.sidefx.com/forum/topic/56135/?page=1#post-251672 Not sure where to got from here, but it's something.lol Quote Link to comment Share on other sites More sharing options...
Fenolis Posted February 9, 2022 Share Posted February 9, 2022 The Group and Group Delete nodes accepts syntax like *_2 and lod*, where the asterisk's position indicates if the given string is prefix, suffix, or somewhere in the middle of the group name (asterisk on both ends) Quote Link to comment Share on other sites More sharing options...
THEONLYraider Posted February 9, 2022 Author Share Posted February 9, 2022 13 hours ago, Fenolis said: The Group and Group Delete nodes accepts syntax like *_2 and lod*, where the asterisk's position indicates if the given string is prefix, suffix, or somewhere in the middle of the group name (asterisk on both ends) Thanks for this! This helps filtering out the geo a lot! 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.