python .scene_raycast returned object is not selectable #56981

Closed
opened 2018-09-30 13:58:51 +02:00 by stephen leger · 9 comments
Member

System Information
Linux Mint 19 Nvidia 1070

Blender Version
Broken: 2.8
Worked: 2.79

Short description of error
python .scene_raycast returned object is not selectable

Exact steps for others to reproduce the error
Perform a scene ray cast and then use a .select_set(action='SELECT') on returned object.
RuntimeError: Error: Object 'Cube' not in View Layer 'RenderLayer'!

Load startup file, then run this into blender's console.

context = C
orig = Vector((10,10,10))
vec = -orig

res, pos, normal, face_index, obj, matrix_world = context.scene.ray_cast(
            view_layer=context.view_layer,
            origin=orig,
            direction=vec)

obj.select_set(action='SELECT')

**System Information** Linux Mint 19 Nvidia 1070 **Blender Version** Broken: 2.8 Worked: 2.79 **Short description of error** python .scene_raycast returned object is not selectable **Exact steps for others to reproduce the error** Perform a scene ray cast and then use a .select_set(action='SELECT') on returned object. RuntimeError: Error: Object 'Cube' not in View Layer 'RenderLayer'! Load startup file, then run this into blender's console. ``` context = C orig = Vector((10,10,10)) vec = -orig res, pos, normal, face_index, obj, matrix_world = context.scene.ray_cast( view_layer=context.view_layer, origin=orig, direction=vec) obj.select_set(action='SELECT') ```
Author
Member

Added subscriber: @StephenLeger

Added subscriber: @StephenLeger

Added subscriber: @mont29

Added subscriber: @mont29

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Bastien Montagne self-assigned this 2018-09-30 21:48:50 +02:00

No bug here, error message is self-explanatory really. Just how new 2.8 system works.

No bug here, error message is self-explanatory really. Just how new 2.8 system works.
Author
Member

Checked again with factory startup file.

throws RuntimeError: Error: Object 'Cube' not in View Layer 'View Layer'!

but Cube is on 'View Layer' !

>>> C.view_layer.objects[:]

[bpy.data.objects['Cube'], bpy.data.objects['Lamp'], bpy.data.objects['Camera']]
>>> C.view_layer.name

'View Layer'

So i feel there is realy something going wrong here.

Checked again with factory startup file. throws RuntimeError: Error: Object 'Cube' not in View Layer 'View Layer'! but Cube is on 'View Layer' ! ``` >>> C.view_layer.objects[:] [bpy.data.objects['Cube'], bpy.data.objects['Lamp'], bpy.data.objects['Camera']] >>> C.view_layer.name 'View Layer' ``` So i feel there is realy something going wrong here.

Changed status from 'Archived' to: 'Open'

Changed status from 'Archived' to: 'Open'

Eeek, yes indeed, actually it returns evaluated version of the object (COW, you know…), not the 'real' data from bpy.data… will fix.

Eeek, yes indeed, actually it returns evaluated version of the object (COW, you know…), not the 'real' data from bpy.data… will fix.

This issue was referenced by blender/blender@3cd98d9ef7

This issue was referenced by blender/blender@3cd98d9ef7e6b85ec3c186f27879612265e3d85d

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#56981
No description provided.