Skip to main content
replaced http://blender.stackexchange.com/ with https://blender.stackexchange.com/
Source Link

If the file is a .blend you can use an application handler

import bpy
from bpy.app.handlers import persistent


@persistent
def load_handler(dummy):
    print("Load Handler:", bpy.data.filepath)

bpy.app.handlers.load_post.append(load_handler)

For other file types there is no callback provided, you could iterate over all text files

for t in bpy.data.texts:
    'check for previously created' -> exec if new and add to list.

and check for new entries triggered by a timer.

Related:

If the file is a .blend you can use an application handler

import bpy
from bpy.app.handlers import persistent


@persistent
def load_handler(dummy):
    print("Load Handler:", bpy.data.filepath)

bpy.app.handlers.load_post.append(load_handler)

For other file types there is no callback provided, you could iterate over all text files

for t in bpy.data.texts:
    'check for previously created' -> exec if new and add to list.

and check for new entries triggered by a timer.

Related:

If the file is a .blend you can use an application handler

import bpy
from bpy.app.handlers import persistent


@persistent
def load_handler(dummy):
    print("Load Handler:", bpy.data.filepath)

bpy.app.handlers.load_post.append(load_handler)

For other file types there is no callback provided, you could iterate over all text files

for t in bpy.data.texts:
    'check for previously created' -> exec if new and add to list.

and check for new entries triggered by a timer.

Related:

Source Link
stacker
  • 38.9k
  • 31
  • 144
  • 245

If the file is a .blend you can use an application handler

import bpy
from bpy.app.handlers import persistent


@persistent
def load_handler(dummy):
    print("Load Handler:", bpy.data.filepath)

bpy.app.handlers.load_post.append(load_handler)

For other file types there is no callback provided, you could iterate over all text files

for t in bpy.data.texts:
    'check for previously created' -> exec if new and add to list.

and check for new entries triggered by a timer.

Related: