Object.ray_cast (and all RNA functions using "ob->runtime") broken in Blender 2.80 #57861
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
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
6 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#57861
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 and graphics card
macOS X Mojave with GTX 980
Blender Version
Broken: 2.80.
59f0db430a
Worked: no solution
Short description of error
Object.ray_cast is broken in Blender 2.80.
I have attached a blend that contains a simple ray_cast that works in 2.79 and fails in 2.80. Run blender from a console to see the error messages.
Exact steps for others to reproduce the error
Click Run Script to see the result of ray_cast in Blender 2.80
ray_cast_test.blend
Added subscriber: @KofiGarbrah
blender/blender-addons#58317 was marked as duplicate of this issue
#59791 was marked as duplicate of this issue
blender/blender-addons#59790 was marked as duplicate of this issue
This comment was removed by @KofiGarbrah
Added subscriber: @lichtwerk
Confirmed, will have a look...
Added subscribers: @mont29, @brecht
Hm, seems like since the removal of DerrivedMesh from RNA (
79615c5adb
) there are a couple of issues.Checked
rna_object_api()
and all RNA functions usingob->runtime
fail.rna_Object_ray_cast():
rna_Object_closest_point_on_mesh():
rna_Object_me_eval_info():
ob->data
directly)@mont29: any ideas here (assigning to you first)?
or maybe @brecht can comment?
@KofiGarbrah: As a (temporary) workaround for this report you can create a BVH manually and raycast that:
Object.ray_cast broken in Blender 2.80to Object.ray_cast (and all RNA functions using "ob->runtime") broken in Blender 2.80Imho there is no bug here… that has more to see with how blender/depsgraph/CoW work now in 2.8. Original data (from Main, of
bpy.data
in python) is not supposed to have evaluated stuff, although we do 'backport' a few things for objects…You should use context's despgraph object, something like:
if obj.type == "MESH":
obj_eval = depsgraph.objects.get(obj.name, None)
if obj_eval is not None:
print(obj_eval.ray_cast(start_ray, dir_ray))
I would expect this ray cast function to get a depsgraph parameter, which it will then look up the object in. That will at least make it more clear to users what is missing.
Changed status from 'Open' to: 'Resolved'
Thanks for the workarounds! I've marked this as resolved.
Added subscribers: @Darcvizer, @MichelAnders
Changed status from 'Resolved' to: 'Open'
Somehow missed @brecht's comment, indeed think that would be a nice addition, will do that now.
This issue was referenced by
61cb1a81a8
Changed status from 'Open' to: 'Resolved'
We can even use depsgraph from context, in fact, should work perfect for 99% of usecases ;)
Just tested it with the daily build (blender-2.80-e4dbfe0a98c1-linux-glibc224-x86_64) and repeatedly ray casting on the bvh now works but if I invoke the operator again (and create a new bvh from the same object) I get a segmentation fault. I'll create a separate bug report that references this one just in case this is not related.
Added subscribers: @Vax456, @Sherm, @capnm, @Joefelix, @Dragon.Studio, @JacquesLucke