Tracking faces after separating objects

Hi, all.

I’m trying to keep track of certain faces, after I separate some of the faces into a new object. Apparently, the new faces are created, so neither index, nor reference to the face before the separation are no longer valid. Is there any way to find a new face in the separated object?

So far I’ve managed to do it with BMesh layer. I’ve added faces index in old object as custom int layer to the faces before separating, apparently the BMesh layers are copied over when objects are separated. But There should be a more elegant way to do this probably.

BMesh module operations usually return newly created geometry. But otherwise, it’s a very tricky business. In C code, you would probably tag faces somehow.

Perhaps you could store the ID of the face as well as other related information of the face (i.e. sourceID, destinationID, vertices[], edges[]). Later you will have to regenerate the faces from scratch instead of using the default separation operator.

Thanks for answers, guys.

I’ve sticked to my original solutions, which is:

  1. Grab bmesh from object
  2. Create custom layer
  3. Store the data in the layer for each face I want to track
  4. Push the bmesh back into the object

When I separate faces from my object, the custom layers are being copied into a new object as well, so if I need to find those faces again, I just grab a bmesh again and look them up according to the data in the custom layer.

Not really elegant, but it works.