Hi forum,
I have slightly adapted the template operator_simple.py
import bpy
import math
class SimpleOperator(bpy.types.Operator):
''''''
bl_idname = "object.simple_operator"
bl_label = "Simple Object Operator"
@classmethod
def poll(cls, context):
return context.active_object != None
def execute(self, context):
print(math.pi)
return {'FINISHED'}
if I run that, and press space in the viewport and type in simple object operator and select it, the console prints out the follow error
AttributeError: 'NoneType' object has no attribute 'pi'
changing the print statement to
print(math)
results in None
How do I use the math (and mathutils) library inside the class?