3

My problem is this: I try and run the script in Blender's text editor and the script fails to math functions, cos() does not work. Failing script within text editor

When I run the same code in Blender's Python console my pasting it directly, there is no problem Same code successfully run by pasting into Python console What is the reason / how to get it work from the Text Editor?

1 Answers1

2

Answered by @batFINGER in a comment: You need to either use the math namespace because you've imported it eg math.cos(angle) or to use directly, from math import cos. For convenience sake the math and mathutils methods have been imported for you in the console. from math import * (See banner message).

dr. Sybren
  • 7,139
  • 1
  • 23
  • 52