When I try to do a ray_cast in object mode, I get an error “Object has no mesh data to be used for ray casting”
I tried to fix it with following the steps:
bpy.context.scene.update()
context.active_object.data.update()
context.active_object.data.update(calc_edges=False)
context.active_object.update_tag(refresh={‘OBJECT’, ‘DATA’, ‘TIME’})
And even:
bpy.ops.object.mode_set(mode=‘EDIT’)
bpy.ops.object.mode_set(mode=‘OBJECT’)
Code Line 208
C.object.raycast(v, d)The template operator raycast exhibits this behaviour too. (once fixed for missing dupli in 2.8) Re your script, not sure about the logic remw.inverted() * f.normal.Suggest converting to global space, and then to local space of the object you are raycasting from. global normal – batFINGER Dec 23 '18 at 11:27