Splitting Selections maintaining Point Order
-
Hello,
I'm trying to combine UVW tags so I can use one texture for several objects (without having to go through the Bodypaint Setup Wizard). I have found a method that is successful:- Run the Connect command on the objects
- Run the UVCommand "Realign"
- Separate the objects
- Copy the UVW tag of the separated object to the original object
I'm trying to write a script that does this. The trouble comes with step 3: Separate the objects. When I use the "Polygon Groups to Objects" command, this method works.
Often, though, I don't want to separate all of the objects completely; I just want to realign the existing UV islands and keep the polygon groups as one object. So I tried a different method: combining them with polygon Selection Tags for each object, selecting each object with a Selection Tag, then running the Split modeling command (as described in this forum post: https://developers.maxon.net/forum/topic/8716/11415_how-to-create-polygonobj-from-selection-solved/4).
For some reason, this Split seems to rearrange the points, because when I drag the split object's UVW tag to the original geometry, many of the points jump to the same UV space.
Can someone please help me separate objects using Selection Tags (or another method) without separating all the polygon groups while maintaining the point order so I can copy the UVW tag to the original object?
Thank you!
-
Hi, maybe I misunderstand the issue, but the split command does work here to preserve point order, could you provide a scene with an exact reproduction step by step where it does not work?
At least doing the following:
- Creates a character object.
- Make it editable
- Middle Click to select everything
- Connect Object
- Go to UV, Optimal Mapping, Apply Optimal Cubic mapping
- Realign mode, Apply
- Select parts (U,W)
- Left click Split
- Copy Past the UV tag
- Works great.
Of course when you split if you only split a part (meaning not the full polygon/vertex of the target part) you will get issue when copy past, since your original (the splitten part) have less vertex/polygon than the object, so the uv have to be created for theses vertex and they are set to the origins 0.0.
Cheers,
Maxime. -
Hello @m_adam and thank you for the response. Getting this to work is very important for my project.
I have recorded a screencast of a simple example.
I have attached my scene file here:
Steps.c4dIn this example, the Cube and the Platonic work correctly when I drag the UVW tags to the original objects. There is an issue with the Pyramid's UVs, however, and as you can see in my original post, there were UVs issues created when I dragged the UVW tags to the original objects with the Figure I split as well.
I should point out that there is a difference between our techniques, but I do not believe it is the issue: I have mapped the UVs myself before the connection (so no 'Optimal Cubic Mapping').
The Polygon Selections I am using for the Split are the ones automatically created by assigning different materials to the objects before Connecting so I am not splitting a part of the objects.
Thank you for your time.
-
Hi @blastframe, thanks for the video.
Unfortunately, I can only confirm the issue.
So far Polygon Groups to Object command is the exact inverse command of Connect Objects commands, so that's why it's working since polygon and points are recreated in the same order where the split command is not capable of this.With that's said here 3 ways to investigates:
- Recreates the Connects and the Split command yourself so you can track points manually here and know which point belongs to what.
- Creates a copy UV command that will use the global point position instead of ID. But that means if two points share the same global position they will also share the same UV position (this can be an issue, but if it's not going to happen this method is probably the easiest to implement).
- Uses the Polygon Groups to Objects commands, then by doing a CRC of all sources points position in global position with the global point position of each generated object you can quickly see if a mesh is equivalent or not.
This may have some limitation but I think it's still a robust way if pointCount + polygon count are the same, and CRC the same its most likely the mesh are equals so it's more or less safe to copy UV.
This can be an issue if you have for example 10 time the same objects positioned in the same global position (I don't see why anyone will do this) and you want to have UV in a different position, this will not works.
For sure if you need help for one of the way provided or even yours feel free to ask.
Cheers,
Maxime. -
I did hear back from Maxon Support about this who said this is a known bug with UVs that may be fixed in future updates.
I, unfortunately, didn't have the time to pursue all three methods you're suggesting but I will when I have the time. For the task I'm trying to automate, I am currently using scripts for the connecting and splitting while manually Realigning the UVs. Rather than tracking point IDs or positions, I'm outright replacing the original geometry with the Split geometry. It's clunky and takes more time, but it works. Hopefully I can script the Connect and Split soon as you suggested. I will definitely reach out when I do!
Sorry, what is CRC?
-
A CRC or a Checksum is basically a way to uniquely identify data.
https://www.howtogeek.com/363735/what-is-a-checksum-and-why-should-you-care/