Example #1
0
def populate(pathname, is_recursive=True):
    resources = []
    parents = []

    for blend_file in glob.glob(pathname, recursive=is_recursive):
        name = path.splitext(path.basename(blend_file))[0].lower()

        if not name.startswith("morse_default"):
            parents.append((name, blend_file))
            resources.append(blend_file)

    for name, blend_file in explore(resources) + parents:
        last_update = path.getmtime(blend_file)
        BlenderModel.update_or_insert(name, blend_file, last_update)
Example #2
0
def populate(pathname, is_recursive=True):
    resources = []
    parents = []

    for blend_file in glob.glob(pathname, recursive=is_recursive):
        name = path.splitext(path.basename(blend_file))[0].lower()

        if not name.startswith("morse_default"):
            parents.append((name, blend_file))
            resources.append(blend_file)

    for name, blend_file in explore(resources) + parents:
        last_update = path.getmtime(blend_file)
        BlenderModel.update_or_insert(name, blend_file, last_update)