I had an animation export script that was working well in Blender 2.7, but I copied it over to my other computer that’s using Blender 2.9 and it’s not working anymore.

It seems that Blender cannot find the string corresponding to the desired path for the exported file. The script always breaks when I try to open the file path, saying: AttributeError: ‘EXPORT_OT_ss_animation has no attribute ‘filepath’.

I’ve looked through several tutorials, but they’re all using the same approach that I’m using (as well as appear to be written for past Blender versions), so I don’t know what’s going wrong. I did learn that I needed to switch to TOPBAR_MT_file_export from INFO_MT_file_export, but that didn’t fix this new problem.

Here’s the relevant code:

import bpy

class AnimationOperator(bpy.types.Operator):
    bl_idname = “export.ss_animation”
    bl_label = “Export SS Animation”

    filepath = bpy.props.StringProperty(subtype=“FILE_PATH”)

    def execute(self, context):
        exportAnimation(self, context)
        return {‘FINISHED’}

    def invoke(self, context, event):
        return {‘RUNNING_MODAL’}

def exportAnimation(self, context):
    #I claim that what comes before attempting to open the file is irrelevant because none of it references self, but I’ll add it if users disagree with me.

    file = open(self.filepath, ‘w’) #Breaks here; states AttributeError: ‘EXPORT_OT_ss_animation has no attribute ‘filepath’
    #More code follows, but it’s irrelevant because it breaks before getting there

def menu_func(self, context):
    self.layout.operator_context = ‘INVOKE_DEFAULT’
    self.layout.operator(AnimationOperator.bl_idname, text=“Animation Exporter”

def register():

def unregister():

if __name__ == ‘__main__’:
  • 3
    $\begingroup$ Just replace filepath = bpy.props... by filepath : bpy.props... . As of 2.93 you have to use annotations. Remove support for non-annotation properties in classes... from: wiki.blender.org/wiki/Reference/Release_Notes/2.93/Python_API $\endgroup$
    – brockmann
    Commented Jun 20, 2021 at 6:23
  • 1
    $\begingroup$ Ah, that did it! Thanks! Now to fix the cascade of remaining errors... >.< $\endgroup$ Commented Jun 20, 2021 at 6:26

1 Answer 1


As of Blender 2.93 you have to use annotations. Support is dropped for 'non-annotation' properties.

From https://wiki.blender.org/wiki/Reference/Release_Notes/2.93/Python_API:

Remove support for non-annotation properties in classes as this was only enabled while porting scripts to 2.8x API (afa5da9ce0)

Means in practice, just replace the assignment operator = for your properties by a colon :

filepath = bpy.props.StringProperty() # OLD
filepath: bpy.props.StringProperty()  # NEW

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .