object raycast only returns the original face index for evaluated meshes of objects with mirror modifiers #86766
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#86766
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
System Information
Operating system: Linux-4.15.0-136-generic-x86_64-with-debian-buster-sid 64 Bits
Graphics card: GeForce GTX 1050/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 460.39
Blender Version
Broken: version: 2.92.0, branch: master, commit date: 2021-02-24 16:25, hash:
02948a2cab
Worked: -
Short description of error
If you have and object with mirror modifiers and
obj.raycast
on them, the returned face index will be wrong, especially on the mirrored side. If the modifier uses bisect, the face index will be wrong on the original side as well.I'm only aware of the mirror modifier doings this. For instance, I have boolean modifiers on the object in the sample scene, creating faces only present in the evaluated mesh, and those indices are returned correctly.
edit: The weld mod (if at the end of the stack) seems to be affected as well. Can report separately if necessary.
My current workaround is creating the evaluated meshes manually via
bpy.data.meshes.new_from_object(obj.evaluated_get(dg), depsgraph=dg)
and a BVH raycast, but that's not always practical, and I would really prefer doing this on the fly usingobj.ray_cast(origin, direction, depsgraph=dg)
The supplied blend file, uses the "operator_modal_view3d_raycast.py" template with minimal modification.
obj_raycast_mirror_mod_evaluated_mesh_face_index.blend
demonstration:
https://www.youtube.com/watch?v=crbCdO6mItM
Exact steps for others to reproduce the error
Added subscriber: @MACHIN3
Added subscriber: @filedescriptor
Changed status from 'Needs Triage' to: 'Confirmed'
I can confirm this issue on the latest 2.93.0 Alpha, branch: master, commit date: 2021-03-22 11:23, hash:
c4c195672d
.Added subscriber: @ideasman42
Currently the original index is looked up, we could optionally support returning the final index.
See:
rna_Object_ray_cast
Setting as TODO.
object raycast returns wrong face index for evaluated meshes of objects with mirror modifiersto object raycast only returns the original face index for evaluated meshes of objects with mirror modifiersReturning the final index is what I would expect yes. It already does return the final distance, location and normal. For boolean mods it also already returns the final index too, hence why I was caught off guard, when getting these results for mirror(and potentially other?) mods.
Current workarounds to get the final index are inefficient.
FWIW, scene.ray_cast does not have these issues either.
This is an effect of the same issue described in #72113
So I'll merge the reports.