Page MenuHome

Object polygon indices are decoupled from bmesh face indices
Closed, ArchivedPublic

Description

Windows 7 Pro 64 bit. Nvidia geforce 540LE


Current build 59393 broken
Last build that works. 58839

--- Short description of error ---
Not really an error, more of behavioral inconsistency that has popped up.

This only happens on objects which have a modifier. I've tried using two methods.

bmesh.from_object() and
object.to_mesh() + bmesh.from_mesh()

In the Contour Tools addon, I raycast a blender object to get a starting face to then use in a bmesh operator. In the past (before 58839) the index returned by ray_cast would always return an index which was reliably the index of the corresponding face in the bmesh. (with exception, ray_cast intersecting an Ngon)

The fidelity seemed to be preserved in both object -> bmesh and bmesh -> object directions before this error started popping up

This is partially related to issue #36363 but I believe it is a separate issue as I'm encountering it with meshes without ngons
https://projects.blender.org/tracker/?func=detail&atid=498&aid=36363&group_id=9

--- Steps for others to reproduce the error (preferably based on attached .blend file) ---
open the blend
run the script

Notice that the bmesh face as specified by the index returned from ob.ray_cast does not match!



Event Timeline

This is working as intended, if you want to get the index of the mesh which is converted from a modifier,
you will have to assign that mesh to an object and do the ray-cast.

Any tools which depended on this behavior would break with ngons as you point out, so this wasn't working reliably.

closing.

Campbell Barton (campbellbarton) changed the task status from Unknown Status to Archived.Aug 27 2013, 2:24 AM