Blender API... "context is not defined" Good morning,
I am currently updating an older AddOn and it went very well so far, but now im stuck with an error and I can't find the reason since my knowledge in Python and especially in the Blender API is very limited...
I appreactiate any ideas and suggestions
Nico :)

# Mesh object implementation of ExportObject
class MeshExportObject(ExportObject):
def __init__(self, Config, Exporter, BlenderObject):
    ExportObject.__init__(self, Config, Exporter, BlenderObject)

def __repr__(self):
    return &quot;[MeshExportObject: {}]&quot;.format(self.name)

# &quot;Public&quot; Interface

def Write(self):
    self.Exporter.Log(&quot;Opening frame for {}&quot;.format(self))
    self._OpenFrame()

    if self.Config.ExportMeshes:
        self.Exporter.Log(&quot;Generating mesh for export...&quot;)
        # Generate the export mesh
        Mesh = None
        if self.Config.ApplyModifiers:
            # Certain modifiers shouldn't be applied in some cases
            # Deactivate them until after mesh generation is complete

            DeactivatedModifierList = []

            # If we're exporting armature data, we shouldn't apply
            # armature modifiers to the mesh
            if self.Config.ExportSkinWeights:
                DeactivatedModifierList = [Modifier
                    for Modifier in self.BlenderObject.modifiers
                    if Modifier.type == 'ARMATURE' and \
                    Modifier.show_viewport]

            for Modifier in DeactivatedModifierList:
                Modifier.show_viewport = False

            Mesh = self.BlenderObject.to_mesh(self.Exporter.context.scene,
                True, 'PREVIEW')

            # Restore the deactivated modifiers
            for Modifier in DeactivatedModifierList:
                Modifier.show_viewport = True
        else:
            Mesh = self.BlenderObject.to_mesh(self.Exporter.context.scene,
                False, 'PREVIEW')
        self.Exporter.Log(&quot;Done&quot;)

        self.__WriteMesh(Mesh)

        # Cleanup
        bpy.data.meshes.remove(Mesh)

    self.Exporter.Log(&quot;Writing children of {}&quot;.format(self))
    self._WriteChildren()

    self._CloseFrame()
    self.Exporter.Log(&quot;Closed frame of {}&quot;.format(self))
The presented error seems to have less to do with the blender API, and more to do incorrectly initializing the python object. You need to use the super function to properly call the parent class’s init method, but you don’t need it here anyway since you’re not changing the init method at all. Just remove that redefinition of the init method.
There may be other errors after you do this, but go ahead and try that.