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 small Python module for determining appropriate platform-specific dirs, e.g. a "user data dir".

the problem What directory should your app use for storing user data? If running on macOS, you should use: ~/Library/Application Support/AppName If

ActiveState Software 948 Dec 31, 2022
OnedataFS is a PyFilesystem interface to Onedata virtual file system

OnedataFS OnedataFS is a PyFilesystem interface to Onedata virtual file system. As a PyFilesystem concrete class, OnedataFS allows you to work with On

onedata 0 Jan 10, 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
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
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 07, 2023
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
pydicom - Read, modify and write DICOM files with python code

pydicom is a pure Python package for working with DICOM files. It lets you read, modify and write DICOM data in an easy "pythonic" way.

DICOM in Python 1.5k Jan 04, 2023
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
FileGenerator - File Generator for sites that accepts documents

File Generator for sites that accepts documents This code generates files as per

Shaunak 2 Mar 19, 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

1 May 17, 2022
This is a junk file creator tool which creates junk files in Internal Storage

This is a junk file creator tool which creates junk files in Internal Storage

KiLL3R_xRO 3 Jun 20, 2021
Simple, convenient and cross-platform file date changing library. 📝📅

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

kubinka0505 15 Dec 18, 2022
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
Python interface for reading and appending tar files

Python interface for reading and appending tar files, while keeping a fast index for finding and reading files in the archive. This interface has been

Lawrence Livermore National Laboratory 1 Nov 12, 2021
BOOTH宛先印刷用CSVから色々な便利なリストを作成してCSVで出力するプログラムです。

BOOTH注文リスト作成スクリプト このPythonスクリプトは、BOOTHの「宛名印刷用CSV」から、 未発送の注文 今月の注文 特定期間の注文 を抽出した上で、各注文を商品毎に一覧化したCSVとして出力するスクリプトです。 簡単な使い方 ダウンロード 通常は、Relaseから、booth_ord

hinananoha 1 Nov 28, 2021
Small Python script to generate a calendar (.ics) file from SIMASTER courses schedule.

simaster.ics Small Python script to generate a calendar (.ics) file from SIMASTER courses schedule. Usage Getting the events.json file from SIMASTER O

Faiz Jazadi 8 Nov 02, 2022
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
Utils for streaming large files (S3, HDFS, gzip, bz2...)

smart_open — utils for streaming large files in Python What? smart_open is a Python 3 library for efficient streaming of very large files from/to stor

RARE Technologies 2.7k Jan 06, 2023
This python project contains a class FileProcessor which allows one to grab a file and get some meta data and header information from it

This python project contains a class FileProcessor which allows one to grab a file and get some meta data and header information from it. In the current state, it outputs a PrettyTable to txt file as

Joshua Wren 1 Nov 09, 2021
The best way to convert files on your computer, be it .pdf to .png, .pdf to .docx, .png to .ico, or anything you can imagine.

The best way to convert files on your computer, be it .pdf to .png, .pdf to .docx, .png to .ico, or anything you can imagine.

JareBear 2 Nov 20, 2021