Simple addon to create folder structures in blender.

Overview

BlenderCreateFolderStructure

Simple Add-on to create a folder structure in Blender.

Installation

  1. Download BlenderCreateFolderStructure.py
  2. Open Blender
  3. Go to Edit > Preferences > Add-ons > Install...
  4. Choose BlenderCreateFolderStructure.py

Instruction

  1. Choose File > Create Folder Structure
  2. Choose a structure type
  3. Choose a location and a name
  4. Press Create Folder Structure

Code:

Create Folder Structure", "warning": "", "wiki_url": "", "tracker_url": "", "category": "Development" } import os import bpy import bpy_extras from bpy.props import EnumProperty class CreateFolderStructure(bpy.types.Operator, bpy_extras.io_utils.ExportHelper): """Create Folder Structure""" bl_idname = "wm.create_folder_structure" bl_label = "Create Folder Structure" filename_ext = "" index = 0 structure_type: EnumProperty( name="Structure Type", items=(('Prop', "Prop", ""), ('Character', "Character", ""), ('Environment', "Environment", ""), ('Project', "Project", ""), ), default='Prop', ) def execute(self, context): self.base_structure() if self.structure_type == 'Prop': self.reference_structure() self.geometry_structure() self.texture_structure() self.rig_structure() self.animation_structure() self.audio_structure() if self.structure_type == 'Character': self.reference_structure() self.geometry_structure() self.texture_structure() self.rig_structure() self.animation_structure() self.audio_structure() if self.structure_type == 'Environment': self.simulation_structure() self.audio_structure() if self.structure_type == 'Project': self.props_structure() self.characters_structure() self.environment_structure() self.rendering_structure() self.documentation_structure() self.autosave_structure() self.trash_structure() return {'FINISHED'} def base_structure(self): os.mkdir(self.filepath) open(os.path.join(self.filepath, os.path.basename(self.filepath)+'.blend'), 'a').close() open(os.path.join(self.filepath, os.path.basename(self.filepath)+'.fbx'), 'a').close() def reference_structure(self): os.mkdir(os.path.join(self.filepath, str(self.index).zfill(2)+' References')) self.index += 1 def props_structure(self): os.mkdir(os.path.join(self.filepath, str(self.index).zfill(2)+' Props')) open(os.path.join(self.filepath, ' - Create prop folder structures in here - '), 'a').close() self.index += 1 def characters_structure(self): os.mkdir(os.path.join(self.filepath, str(self.index).zfill(2)+' Characters')) open(os.path.join(self.filepath, ' - Create character folder structures in here - '), 'a').close() self.index += 1 def environment_structure(self): os.mkdir(os.path.join(self.filepath, str(self.index).zfill(2)+' Environment')) open(os.path.join(self.filepath, ' - Create environment folder structures in here - '), 'a').close() self.index += 1 def geometry_structure(self): geometry_path = os.path.join(self.filepath, str(self.index).zfill(2)+' Geometry') os.mkdir(geometry_path) open(os.path.join(geometry_path, ' - Contains a blender and zbrush file for low and high poly models - '), 'a').close() open(os.path.join(geometry_path, 'Geometry.blend'), 'a').close() open(os.path.join(geometry_path, 'Geometry.zpr'), 'a').close() os.mkdir(os.path.join(geometry_path, 'BaseMeshes')) open(os.path.join(geometry_path, 'BaseMeshes', '- Contains all base meshes, you need to model or sculpt -'), 'a').close() open(os.path.join(geometry_path, 'BaseMeshes', 'MeshNameBase.fbx'), 'a').close() os.mkdir(os.path.join(geometry_path, 'HighPoly')) open(os.path.join(geometry_path, 'HighPoly', '- Contains the high poly fbx files for texture baking -'), 'a').close() open(os.path.join(geometry_path, 'HighPoly', 'MeshName_high.fbx'), 'a').close() self.index += 1 def texture_structure(self): texture_path = os.path.join(self.filepath, str(self.index).zfill(2)+' Texture') os.mkdir(texture_path) open(os.path.join(texture_path, ' - Contains a substance painter file and folders with exported texture sets - '), 'a').close() open(os.path.join(texture_path, 'Texture.blend'), 'a').close() open(os.path.join(texture_path, os.path.basename(self.filepath)+'.spp'), 'a').close() self.index += 1 def rig_structure(self): rig_path = os.path.join(self.filepath, str(self.index).zfill(2)+' Rig') os.mkdir(rig_path) open(os.path.join(rig_path, ' - Contains the rigged model - '), 'a').close() open(os.path.join(rig_path, 'Rig.blend'), 'a').close() self.index += 1 def animation_structure(self): animation_path = os.path.join(self.filepath, str(self.index).zfill(2)+' Animation') os.mkdir(animation_path) open(os.path.join(animation_path, ' - Contains one blender file with all animations and all animations exported as fbx files - '), 'a').close() open(os.path.join(animation_path, 'Animation.blend'), 'a').close() open(os.path.join(animation_path, 'AnimationName.fbx'), 'a').close() self.index += 1 def simulation_structure(self): simulation_path = os.path.join(self.filepath, str(self.index).zfill(2)+' Simulation') os.mkdir(simulation_path) open(os.path.join(simulation_path, ' - Contains blender files with the simulations and a cache folder with cached simulations - '), 'a').close() open(os.path.join(simulation_path, 'SimulationName.blend'), 'a').close() os.mkdir(os.path.join(simulation_path, 'Cache')) open(os.path.join(simulation_path,'Cache' , ' - Contains folders with cached simulations - '), 'a').close() self.index += 1 def rendering_structure(self): render_path = os.path.join(self.filepath, str(self.index).zfill(2)+' Render') os.mkdir(render_path) open(os.path.join(render_path, 'RenderName.blend'), 'a').close() open(os.path.join(render_path, ' - Contains blender files to render and folders with rendered images - '), 'a').close() self.index += 1 def audio_structure(self): path = os.path.join(self.filepath, str(self.index).zfill(2)+' Audio') os.mkdir(path) open(os.path.join(path, ' - Contains audio files - '), 'a').close() self.index += 1 def documentation_structure(self): path = os.path.join(self.filepath, str(self.index).zfill(2)+' Documentation') os.mkdir(path) open(os.path.join(path, ' - Contains screenshots, gifs and other forms of documentation - '), 'a').close() self.index += 1 def research_structure(self): research_path = os.path.join(self.filepath, 'Research') os.mkdir(os.path.join(self.filepath, 'Research')) os.mkdir(os.path.join(self.filepath, 'Research', 'Experiments')) os.mkdir(os.path.join(self.filepath, 'Research', 'Scripts')) self.index += 1 def autosave_structure(self): path = os.path.join(self.filepath, str(self.index).zfill(2)+' Autosave') os.mkdir(path) open(os.path.join(path, ' - Contains autosaves - '), 'a').close() self.index += 1 def trash_structure(self): path = os.path.join(self.filepath, str(self.index).zfill(2)+' Autosave') os.mkdir(path) open(os.path.join(path, ' - Contains temporary files which can be deleted - '), 'a').close() self.index += 1 def menu_func(self, context): self.layout.separator() self.layout.operator(CreateFolderStructure.bl_idname) def register(): bpy.types.TOPBAR_MT_file.append(menu_func) bpy.utils.register_class(CreateFolderStructure) def unregister(): bpy.utils.unregister_class(CreateFolderStructure) bpy.types.TOPBAR_MT_file.remove(menu_func) if __name__ == "__main__": register() ">
bl_info = {
    "name": "Create Folder Structure",
    "description": "A simple tool to genereate a folder structure",
    "author": "Dominik Strasser ",
    "version": (1, 0, 0),
    "blender": (2, 93, 0),
    "location": "File > Create Folder Structure",
    "warning": "",
    "wiki_url": "",
    "tracker_url": "",
    "category": "Development"
}


import os
import bpy
import bpy_extras
from bpy.props import EnumProperty


class CreateFolderStructure(bpy.types.Operator, bpy_extras.io_utils.ExportHelper):
    """Create Folder Structure"""
    bl_idname = "wm.create_folder_structure"
    bl_label = "Create Folder Structure"
 
    filename_ext = ""

    index = 0

    structure_type: EnumProperty(
            name="Structure Type",
            items=(('Prop', "Prop", ""),
                   ('Character', "Character", ""),
                   ('Environment', "Environment", ""),
                   ('Project', "Project", ""),
                   ),
            default='Prop',
            )

    def execute(self, context):

        self.base_structure()

        if self.structure_type == 'Prop':
            self.reference_structure()
            self.geometry_structure()
            self.texture_structure()
            self.rig_structure()
            self.animation_structure()
            self.audio_structure()

        if self.structure_type == 'Character':
            self.reference_structure()
            self.geometry_structure()
            self.texture_structure()
            self.rig_structure()
            self.animation_structure()
            self.audio_structure()

        if self.structure_type == 'Environment':
            self.simulation_structure()
            self.audio_structure()

        if self.structure_type == 'Project':
            self.props_structure()
            self.characters_structure()
            self.environment_structure()

        self.rendering_structure()
        self.documentation_structure()
        self.autosave_structure()
        self.trash_structure()
        
        return {'FINISHED'}

    def base_structure(self):
        os.mkdir(self.filepath)
        open(os.path.join(self.filepath, os.path.basename(self.filepath)+'.blend'), 'a').close()
        open(os.path.join(self.filepath, os.path.basename(self.filepath)+'.fbx'), 'a').close()

    def reference_structure(self):
        os.mkdir(os.path.join(self.filepath, str(self.index).zfill(2)+' References'))
        self.index += 1

    def props_structure(self):
        os.mkdir(os.path.join(self.filepath, str(self.index).zfill(2)+' Props'))
        open(os.path.join(self.filepath, ' - Create prop folder structures in here - '), 'a').close()
        self.index += 1

    def characters_structure(self):
        os.mkdir(os.path.join(self.filepath, str(self.index).zfill(2)+' Characters'))
        open(os.path.join(self.filepath, ' - Create character folder structures in here - '), 'a').close()
        self.index += 1

    def environment_structure(self):
        os.mkdir(os.path.join(self.filepath, str(self.index).zfill(2)+' Environment'))
        open(os.path.join(self.filepath, ' - Create environment folder structures in here - '), 'a').close()
        self.index += 1

    def geometry_structure(self):
        geometry_path = os.path.join(self.filepath, str(self.index).zfill(2)+' Geometry')
        os.mkdir(geometry_path)
        open(os.path.join(geometry_path, ' - Contains a blender and zbrush file for low and high poly models - '), 'a').close()
        open(os.path.join(geometry_path, 'Geometry.blend'), 'a').close()
        open(os.path.join(geometry_path, 'Geometry.zpr'), 'a').close()
        os.mkdir(os.path.join(geometry_path, 'BaseMeshes'))
        open(os.path.join(geometry_path, 'BaseMeshes', '- Contains all base meshes, you need to model or sculpt -'), 'a').close()
        open(os.path.join(geometry_path, 'BaseMeshes', 'MeshNameBase.fbx'), 'a').close()
        os.mkdir(os.path.join(geometry_path, 'HighPoly'))
        open(os.path.join(geometry_path, 'HighPoly', '- Contains the high poly fbx files for texture baking -'), 'a').close()
        open(os.path.join(geometry_path, 'HighPoly', 'MeshName_high.fbx'), 'a').close()
        self.index += 1

    def texture_structure(self):
        texture_path = os.path.join(self.filepath, str(self.index).zfill(2)+' Texture')
        os.mkdir(texture_path)
        open(os.path.join(texture_path, ' - Contains a substance painter file and folders with exported texture sets - '), 'a').close()
        open(os.path.join(texture_path, 'Texture.blend'), 'a').close()
        open(os.path.join(texture_path, os.path.basename(self.filepath)+'.spp'), 'a').close()
        self.index += 1

    def rig_structure(self):
        rig_path = os.path.join(self.filepath, str(self.index).zfill(2)+' Rig')
        os.mkdir(rig_path)
        open(os.path.join(rig_path, ' - Contains the rigged model - '), 'a').close()
        open(os.path.join(rig_path, 'Rig.blend'), 'a').close()
        self.index += 1

    def animation_structure(self):
        animation_path = os.path.join(self.filepath, str(self.index).zfill(2)+' Animation')
        os.mkdir(animation_path)
        open(os.path.join(animation_path, ' - Contains one blender file with all animations and all animations exported as fbx files - '), 'a').close()
        open(os.path.join(animation_path, 'Animation.blend'), 'a').close()
        open(os.path.join(animation_path, 'AnimationName.fbx'), 'a').close()
        self.index += 1

    def simulation_structure(self):
        simulation_path = os.path.join(self.filepath, str(self.index).zfill(2)+' Simulation')
        os.mkdir(simulation_path)
        open(os.path.join(simulation_path, ' - Contains blender files with the simulations and a cache folder with cached simulations - '), 'a').close()
        open(os.path.join(simulation_path, 'SimulationName.blend'), 'a').close()
        os.mkdir(os.path.join(simulation_path, 'Cache'))
        open(os.path.join(simulation_path,'Cache' , ' - Contains folders with cached simulations - '), 'a').close()
        self.index += 1

    def rendering_structure(self):
        render_path = os.path.join(self.filepath, str(self.index).zfill(2)+' Render')
        os.mkdir(render_path)
        open(os.path.join(render_path, 'RenderName.blend'), 'a').close()
        open(os.path.join(render_path, ' - Contains blender files to render and folders with rendered images - '), 'a').close()
        self.index += 1

    def audio_structure(self):
        path = os.path.join(self.filepath, str(self.index).zfill(2)+' Audio')
        os.mkdir(path)
        open(os.path.join(path, ' - Contains audio files - '), 'a').close()
        self.index += 1

    def documentation_structure(self):
        path = os.path.join(self.filepath, str(self.index).zfill(2)+' Documentation')
        os.mkdir(path)
        open(os.path.join(path, ' - Contains screenshots, gifs and other forms of documentation - '), 'a').close()
        self.index += 1

    def research_structure(self):
        research_path = os.path.join(self.filepath, 'Research')
        os.mkdir(os.path.join(self.filepath, 'Research'))
        os.mkdir(os.path.join(self.filepath, 'Research', 'Experiments'))
        os.mkdir(os.path.join(self.filepath, 'Research', 'Scripts'))
        self.index += 1

    def autosave_structure(self):
        path = os.path.join(self.filepath, str(self.index).zfill(2)+' Autosave')
        os.mkdir(path)
        open(os.path.join(path, ' - Contains autosaves - '), 'a').close()
        self.index += 1

    def trash_structure(self):
        path = os.path.join(self.filepath, str(self.index).zfill(2)+' Autosave')
        os.mkdir(path)
        open(os.path.join(path, ' - Contains temporary files which can be deleted - '), 'a').close()
        self.index += 1


def menu_func(self, context):
    self.layout.separator()
    self.layout.operator(CreateFolderStructure.bl_idname)


def register():
    bpy.types.TOPBAR_MT_file.append(menu_func)
    bpy.utils.register_class(CreateFolderStructure)


def unregister():
    bpy.utils.unregister_class(CreateFolderStructure)
    bpy.types.TOPBAR_MT_file.remove(menu_func)


if __name__ == "__main__":
    register()
Owner
Dominik Strasser
3D Generalist at SOMAREALITY
Dominik Strasser
A file utility for accessing both local and remote files through a unified interface.

A file utility for accessing both local and remote files through a unified interface.

AI2 19 Nov 16, 2022
Listreqs is a simple requirements.txt generator. It's an alternative to pipreqs

โšก Listreqs Listreqs is a simple requirements.txt generator. It's an alternative to pipreqs. Where in Pipreqs, it helps you to Generate requirements.tx

Soumyadip Sarkar 4 Oct 15, 2021
File-manager - A basic file manager, written in Python

File Manager A basic file manager, written in Python. Installation Install Pytho

Samuel Ko 1 Feb 05, 2022
Python code snippets for extracting PDB codes from .fasta files

Python_snippets_for_bioinformatics Python code snippets for extracting PDB codes from .fasta files If you have a single .fasta file for all protein se

Sofi-Mukhtar 3 Feb 09, 2022
CredSweeper is a tool to detect credentials in any directories or files.

CredSweeper is a tool to detect credentials in any directories or files. CredSweeper could help users to detect unwanted exposure of credentials (such as personal information, token, passwords, api k

Samsung 54 Dec 13, 2022
CleverCSV is a Python package for handling messy CSV files.

CleverCSV is a Python package for handling messy CSV files. It provides a drop-in replacement for the builtin CSV module with improved dialect detection, and comes with a handy command line applicati

The Alan Turing Institute 1k Dec 19, 2022
Object-oriented file system path manipulation

path (aka path pie, formerly path.py) implements path objects as first-class entities, allowing common operations on files to be invoked on those path

Jason R. Coombs 1k Dec 28, 2022
Python library and shell utilities to monitor filesystem events.

Watchdog Python API and shell utilities to monitor file system events. Works on 3.6+. If you want to use Python 2.6, you should stick with watchdog

Yesudeep Mangalapilly 5.6k Jan 04, 2023
A python script generate password files in plain text

KeePass (or any desktop pw manager?) Helper WARNING: This script will generate password files in plain text. ITS NOT SECURE. I needed help remembering

Eric Thomas 1 Nov 21, 2021
CSV-Handler written in Python3

CSVHandler This code allows you to work intelligently with CSV files. A file in CSV syntax is converted into several lists, which are combined in a to

Max Tischberger 1 Jan 13, 2022
๐Ÿงน Create symlinks for .m2ts files and classify them into directories in yyyy-mm format.

๐Ÿงน Create symlinks for .m2ts files and classify them into directories in yyyy-mm format.

Nep 2 Feb 07, 2022
Python Sreamlit Duplicate Records Finder Remover

Python-Sreamlit-Duplicate-Records-Finder-Remover Streamlit is an open-source Python library that makes it easy to create and share beautiful, custom w

RONALD KANYEPI 1 Jan 21, 2022
A simple file sharing tool written in python

Share it A simple file sharing tool written in python Installation If you are using Windows os you can directly Run .exe file -- download If you are

Sachit Yadav 7 Dec 16, 2022
MetaMove is written in Python3 and aims at easing batch renaming operations based on file meta data.

MetaMove MetaMove is written in Python3 and aims at easing batch renaming operations based on file meta data. MetaMove abuses eval combined with f-str

Jan Philippi 2 Dec 28, 2021
A python wrapper for libmagic

python-magic python-magic is a Python interface to the libmagic file type identification library. libmagic identifies file types by checking their hea

Adam Hupp 2.3k Dec 29, 2022
Organizer is a python program that organizes your downloads folder

Organizer Organizer is a python program that organizes your downloads folder, it can run as a service and so will start along with the system, and the

Gustavo 2 Oct 18, 2021
Yadl - it is a simple library for working with both dotenv files and environment variables.

Yadl Yadl - it is a simple library for working with both dotenv files and environment variables. Features Validation of whitespaces. Validation of num

Ivan Kapranov 3 Oct 19, 2021
Annotate your Python requirements.txt file with summaries of each package.

Summarize Requirements ๐Ÿ ๐Ÿ“œ Annotate your Python requirements.txt file with a short summary of each package. This tool: takes a Python requirements.t

Zeke Sikelianos 8 Apr 22, 2022
Simple archive format designed for quickly reading some files without extracting the entire archive

Simple archive format designed for quickly reading some files without extracting the entire archive

Jarred Sumner 336 Dec 30, 2022
CSV To VCF (Multiples en un archivo)

CSV To VCF Convierte archivo CSV a Tarjeta VCF (varias en una) How to use En main.py debes reemplazar CONTACTOS.csv por tu archivo csv, y debes respet

Jorge Ivaldi 2 Jan 12, 2022