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
Python virtual filesystem for SQLite to read from and write to S3

Python virtual filesystem for SQLite to read from and write to S3

Department for International Trade 70 Jan 04, 2023
Uncompress DEFLATE streams in pure Python

stream-inflate Uncompress DEFLATE streams in pure Python. Installation pip install stream-inflate Usage from stream_inflate import stream_inflate impo

Michal Charemza 7 Oct 13, 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
PyDeleter - delete a specifically formatted file in a directory or delete all other files

PyDeleter If you want to delete a specifically formatted file in a directory or delete all other files, PyDeleter does it for you. How to use? 1- Down

Amirabbas Motamedi 1 Jan 30, 2022
useful files for the Freenove Big Hexapod

FreenoveBigHexapod useful files for the Freenove Big Hexapod HexaDogPos is a utility for converting the Freenove xyz co-ordinate system to servo angle

Alex 2 May 28, 2022
This simple python script pcopy reads a list of file names and copies them to a separate folder

pCopy This simple python script pcopy reads a list of file names and copies them to a separate folder. Pre-requisites Python 3 (ver. 3.6) How to use

Madhuranga Rathnayake 0 Sep 03, 2021
Publicly Open Amazon AWS S3 Bucket Viewer

S3Viewer Publicly open storage viewer (Amazon S3 Bucket, Azure Blob, FTP server, HTTP Index Of/) s3viewer is a free tool for security researchers that

Sharon Brizinov 377 Dec 02, 2022
An universal file format tool kit. At present will handle the ico format problem.

An universal file format tool kit. At present will handle the ico format problem.

Sadam·Sadik 1 Dec 26, 2021
Singer is an open source standard for moving data between databases, web APIs, files, queues, and just about anything else you can think of.

Singer is an open source standard for moving data between databases, web APIs, files, queues, and just about anything else you can think of. Th

Singer 1.1k Jan 05, 2023
Copy only text-like files from the folder

copy-only-text-like-files-from-folder-python copy only text-like files from the folder This project is for those who want to copy only source code or

1 May 17, 2022
A python script to convert an ucompressed Gnucash XML file to a text file for Ledger and hledger.

README 1 gnucash2ledger gnucash2ledger is a Python script based on the Github Gist by nonducor (nonducor/gcash2ledger.py). This Python script will tak

Thomas Freeman 0 Jan 28, 2022
Find potentially sensitive files

find_files Find potentially sensitive files This script searchs for potentially sensitive files based off of file name or string contained in the file

4 Aug 20, 2022
A tool written in python to generate basic repo files from github

A tool written in python to generate basic repo files from github

Riley 7 Dec 02, 2021
Pure Python tools for reading and writing all TIFF IFDs, sub-IFDs, and tags.

Tiff Tools Pure Python tools for reading and writing all TIFF IFDs, sub-IFDs, and tags. Developed by Kitware, Inc. with funding from The National Canc

Digital Slide Archive 32 Dec 14, 2022
A wrapper for DVD file structure and ISO files.

vs-parsedvd DVDs were an error. A wrapper for DVD file structure and ISO files. You can find me in the IEW Discord server

7 Nov 17, 2022
Sheet Data Image/PDF-to-CSV Converter

Sheet Data Image/PDF-to-CSV Converter

Quy Truong 5 Nov 22, 2021
A JupyterLab extension that allows opening files and directories with external desktop applications.

A JupyterLab extension that allows opening files and directories with external desktop applications.

martinRenou 0 Oct 14, 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
Simple Python File Manager

This script lets you automatically relocate files based on their extensions. Very useful from the downloads folder !

Aimé Risson 22 Dec 27, 2022
QSynthesis is a Python3 API to perform I/O based program synthesis of bitvector expressions.

QSynthesis is a Python3 API to perform I/O based program synthesis of bitvector expressions. It aims at facilitating code deobfuscation. The algorithm is greybox approach combining both a blackbox I/

Quarkslab 103 Dec 30, 2022