System Information
Operating system: Windows-7-6.1.7601-SP1 64 Bits
Graphics card: AMD Radeon HD 6900 Series ATI Technologies Inc. 4.5.13399 Core Profile Context 15.200.1062.1003
Blender Version
Broken: version: 2.82 (sub 3), branch: master, commit date: 2019-11-30 17:33, hash: rBf1ac64921b49
Worked: (optional)
Short description of error
With some modifier combinations, Object.ray_cast returns face indices that don't match the indices the object would have if the modifiers were applied or when using Object.evaluated_get. I tested this also in 2.79 and it doesn't work there either.
Attached is a blend file which includes a slightly modified version of the operator_modal_view3d_raycast.py template. It now prints the indices into the console. I included two different test scenarios just in case.
Note, the only changes in the code are the debug print on line 63 and the change to execute the operator only on mouse press on line 84.
Exact steps for others to reproduce the error
- Open the attached blend file
- Open System Console
- Run the "operator_modal_view3d_raycast.py" script
Case 1:
- Select "Bevel + Decimate" object
- See that the Decimate modifier's face count is 24
- Search for "RayCast View Operator" and press Enter
- Click on the object's faces and check the printed indices inside the Console
- Confirm that they go above 23
Case 2:
- Enable Developer Extras in Preferences > Interface
- Select "Boolean + Bevel Applied" object
- Switch into edit mode
- Inside Viewport Overlays popover, enable indices
- Select the top face and check the index
- Switch into object mode
- Search for "RayCast View Operator" and press Enter
- Click on "Boolean + Bevel" object's top face and check the printed index inside the Console
- Confirm that it doesn't match the index of the object which has the modifiers applied