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:

context.active_object.update_tag(refresh={‘OBJECT’, ‘DATA’, ‘TIME’})

And even:


Code Line 208

  • $\begingroup$ I think this is a currently bug or oversight. Fails with same error in console 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 re mw.inverted() * f.normal. Suggest converting to global space, and then to local space of the object you are raycasting from. global normal $\endgroup$ – batFINGER Dec 23 '18 at 11:27
  • $\begingroup$ Thank you very much. Regarding logic, you are right, thanks! $\endgroup$ – Влад Киндюшов Dec 23 '18 at 12:42
  • $\begingroup$ unfortunately at the moment blender2.8 gives the same behaviour for the closest_point_on_mesh method. $\endgroup$ – richard Dec 31 '18 at 12:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.