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
Fast Python reader and editor for ASAM MDF / MF4 (Measurement Data Format) files

asammdf is a fast parser and editor for ASAM (Association for Standardization of Automation and Measuring Systems) MDF (Measurement Data Format) files

Daniel Hrisca 440 Dec 31, 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
A python script to pull the transactions of an Algorand wallet and put them into a CSV file.

AlgoCSV A python script to pull the transactions of an Algorand wallet and put them into a CSV file. Dependancies: Requests Main features: Groups: Com

21 Jun 25, 2022
fast change directory with python and ruby

fcdir fast change directory with python and ruby run run python script , chose drirectoy and change your directory need you need python and ruby deskt

XCO 2 Jun 20, 2022
Python module that parse power builder file (PBD) and analyze code

PowerBuilder-decompile Python module that parse power builder file (PBD) and analyze code (Incomplete) this tool is composed of: pbd_dump.py pbd file

Samy Sultan 8 Dec 15, 2022
dotsend is a web application which helps you to upload your large files and share file via link

dotsend is a web application which helps you to upload your large files and share file via link

Devocoe 0 Dec 03, 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
Uproot is a library for reading and writing ROOT files in pure Python and NumPy.

Uproot is a library for reading and writing ROOT files in pure Python and NumPy. Unlike the standard C++ ROOT implementation, Uproot is only an I/O li

Scikit-HEP Project 164 Dec 31, 2022
Nmap XML output to CSV and HTTP/HTTPS URLS.

xml-to-csv-url Convert NMAP's XML output to CSV file and print URL addresses for HTTP/HTTPS ports. NOTE: OS Version Parsing is not working properly ye

1 Dec 21, 2021
A tiny Configuration File Parser for Python Projects

A tiny Configuration File Parser for Python Projects. Currently working on JSON Config Files only.

Tanmoy Sen Gupta 1 Feb 12, 2022
Python function to construct a ZIP archive with on the fly - without having to store the entire ZIP in memory or disk

Python function to construct a ZIP archive with on the fly - without having to store the entire ZIP in memory or disk

Department for International Trade 34 Jan 05, 2023
Quick and dirty FAT12 filesystem to ZIP file converter

Quick and Dirty FAT12 Filesystem Converter This is a really crappy Python script I wrote to convert a semi-compatible FAT12 filesystem from my HP150's

Tube Time 2 Feb 12, 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
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
Kartothek - a Python library to manage large amounts of tabular data in a blob store

Kartothek - a Python library to manage (create, read, update, delete) large amounts of tabular data in a blob store

15 Dec 25, 2022
Generates a clean .txt file of contents of a 3 lined csv file

Generates a clean .txt file of contents of a 3 lined csv file. File contents is the .gml file of some function which stores the contents of the csv as a map.

Alex Eckardt 1 Jan 09, 2022
This is a file deletion program that asks you for an extension of a file (.mp3, .pdf, .docx, etc.) to delete all of the files in a dir that have that extension.

FileBulk This is a file deletion program that asks you for an extension of a file (.mp3, .pdf, .docx, etc.) to delete all of the files in a dir that h

Enoc Mena 1 Jun 26, 2022
Maltego transforms to pivot between PE files based on their VirusTotal codeblocks

VirusTotal Codeblocks Maltego Transforms Introduction These Maltego transforms allow you to pivot between different PE files based on codeblocks they

Ariel Jungheit 18 Feb 03, 2022
Python function to stream unzip all the files in a ZIP archive: without loading the entire ZIP file or any of its files into memory at once

Python function to stream unzip all the files in a ZIP archive: without loading the entire ZIP file or any of its files into memory at once

Department for International Trade 206 Jan 02, 2023
MHS2 Save file editing tools. Transfers save files between players, switch and pc version, encrypts and decrypts.

SaveTools MHS2 Save file editing tools. Transfers save files between players, switch and pc version, encrypts and decrypts. Credits Written by Asteris

31 Nov 17, 2022