I'm still quite new to the whole blender python API. One of the thing I struggle with is context. I have a concrete question in mind though: Consider the simple operator below. What's the difference context and bpy.context?
class SimpleOperator(bpy.types.Operator):
bl_idname = "object.simple_operator"
bl_label = "Simple Object Operator"
def execute(self, context):
context.active_object
bpy.context.active_object
return {'FINISHED'}
context
is already passed to the execute method (comes in by default). This is pretty essential since in blender everything hascontext
, recommend try to understand this concept before writing any operators: docs.blender.org/api/current/info_quickstart.html#context $\endgroup$bpy.context
is a new reference. $\endgroup$bpy.context
is the actual context. A better example is perhaps thescene
argument of a handler, which is often ignored andbpy.context.scene
is used instead, which will work as expected; till it doesn't @tokikake No, not necessarily. $\endgroup$