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()
You might also like...
A simple file module for creating, editing and saving files.

A simple file module for creating, editing and saving files.

Simple, convenient and cross-platform file date changing library. 📝📅

Simple, convenient and cross-platform file date changing library.

A simple bulk file renamer, written in python.

Python File Editor A simple bulk file renamer, written in python. There are two functions, the bulk rename and the bulk file extention change. Bulk Fi

A simple library for temporary storage of small files

TemporaryStorage An simple library for temporary storage of small files. Navigation Install Usage In Python console As a standalone application List o

A simple Python code that takes input from a csv file and makes it into a vcf file.

Contacts-Maker A simple Python code that takes input from a csv file and makes it into a vcf file. Imagine a college or a large community where each y

Easytile blender - Simple Blender 2.83 addon for tiling meshes easily

easytile_blender Dead simple, barebones Blender (2.83) addon for placing meshes as tiles. Installation In Blender, go to Edit Preferences Add-ons

Blender addon that enables exporting of xmodels from blender. Great for custom asset creation for cod games
Blender addon that enables exporting of xmodels from blender. Great for custom asset creation for cod games

Birdman's XModel Tools For Blender Greetings everyone in the custom cod community. This blender addon should finally enable exporting of custom assets

Backup a folder to an another folder by using mirror update method.

Mirror Update Backup Backup a folder to an another folder by using mirror update method. How to use Install requirement pip install -r requirements.tx

A scrapy pipeline that provides an easy way to store files and images using various folder structures.

scrapy-folder-tree This is a scrapy pipeline that provides an easy way to store files and images using various folder structures. Supported folder str

Data Structures and Algorithms Python - Practice data structures and algorithms in python with few small projects

Data Structures and Algorithms All the essential resources and template code nee

Blender addon - Scrub timeline from viewport with a shortcut
Blender addon - Scrub timeline from viewport with a shortcut

Viewport scrub timeline Move in the timeline directly in viewport and snap to nearest keyframe Note : This standalone feature will be added in the nat

addon for blender to import mocap data from tools like easymocap, frankmocap and Vibe

b3d_mocap_import addon for blender to import mocap data from tools like easymocap, frankmocap and Vibe ==================VIBE================== To use

 A small Blender addon for changing an object's local orientation while in edit mode
A small Blender addon for changing an object's local orientation while in edit mode

A small Blender addon for changing an object's local orientation while in edit mode.

Blender 2.93 addon for loading Quake II MD2 files

io_mesh_md2 is a Blender 2.93 addon for importing Quake II MD2 files.

A blender 2.9x addon for managing camera settings
A blender 2.9x addon for managing camera settings

TMG-Camera-Tools A blender 2.9x addon for managing camera settings Tutorial showcasing current features

Blender addon to generate better building models from satellite imagery.

Blender addon to generate better building models from satellite imagery.

An addon uses SMPL's poses and global translation to drive cartoon character in Blender.
An addon uses SMPL's poses and global translation to drive cartoon character in Blender.

Blender addon for driving character The addon drives the cartoon character by passing SMPL's poses and global translation into model's armature in Ble

Purge all transformation orientations addon for Blender 2.8 and newer versions
Purge all transformation orientations addon for Blender 2.8 and newer versions

CTO Purge This add-on adds a new button to Blender's Transformation Orientation panel which empowers the user to purge all of his/her custom transform

Addon for adding subtitle files to blender VSE as Text sequences. Using pysub2 python module.
Addon for adding subtitle files to blender VSE as Text sequences. Using pysub2 python module.

Import Subtitles for Blender VSE Addon for adding subtitle files to blender VSE as Text sequences. Using pysub2 python module. Supported formats by py

Owner
Dominik Strasser
3D Generalist at SOMAREALITY
Dominik Strasser
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
Ini adalah program python untuk mengubah background foto dalam 1 folder, tidak perlu satu satu

Myherokuapp my web drive You can see my web drive and can request film/Application do you want in here my blog you can visit my blog RemBg ini adalah

XnuxersXploitXen 13 Dec 1, 2022
OneDriveExplorer - A command line and GUI based application for reconstructing the folder strucure of OneDrive from the UserCid.dat file

OneDriveExplorer - A command line and GUI based application for reconstructing the folder strucure of OneDrive from the <UserCid>.dat file

Brian Maloney 100 Dec 13, 2022
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

null 1 May 17, 2022
This project is a set of programs that I use to create a README.md file.

?? codex-readme ?? codex-readme What is it? This project is a set of programs that I use to create a README.md file. How does it work? It reads progra

Tom Dörr 224 Jan 7, 2023
A bot discord that can create directories, file, rename, move, navigate throw directories etc....

File Manager Discord What is the purpose of this program ? This program is made for a Discord bot. Its purpose is to organize the messages sent in a c

null 1 Feb 2, 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 7, 2022
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
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
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