Render Warning addon

Hi. I’m a bit new to Python with Blender.

I started working on a script that warns you when you try to render an animation and you output directory is set to tmp. I’m planning to extend it to have a list of directory’s to warn you about (the place you store all your .blend files, tmp, etc). I’m also wanting to add support for warnings about folders that have numbered images and pop up windows instead of the print() statement that it currently has.

Heres my current code. Feel free to try it out and tell me how it works.

If you try it you’ll need to switch

if tmp == "/tmp/":

to a different folder depending on your system.

bl_info = {
    "name": "Render Warning",
    "category": "Object",

import bpy

class RenderWarning(bpy.types.Operator):
    """Object Cursor Array"""
    bl_idname = "render.render_warning"
    bl_label = "Render Warning"
    bl_options = {'REGISTER', 'UNDO'}

    def execute(self, context):
        tmp = context.scene.render.filepath
        if tmp == "/tmp/":
  {'WARNING'}, "You are in the /tmp/ directory")
            #bpy.ops.render.render(animation = True)
  {'WARNING'}, "rendering")

        return {'FINISHED'}
def menu_func(self, context):

def register():

def unregister():

if __name__ == "__main__":

Updated the code

If you could give me some suggestions, it would be appreciated.[“Scene”]
should be

    if tmp == "/tmp/":

is not safe across different platforms, on windows it is

print(“You are in the /tmp/ directory”)
You should probably use

Ok. I’ll change it.

I am aware that /tmp/ is not the same across platforms. Thats why I said that you need to switch that folder depending on your system.

If your thinking that all of the code is how it will be when it’s done you are incorrect. I’m just taking it little steps at a time.

Is the method for using that little space at the top of the screen for warnings and stuff?

Thank you for your feedback. I highly appreciate it.

Ok. I got to work. The context.scene thing isn’t giving me any errors and the script is still working fine.

Thank you for That was one of the things I was wanting to do.