diff --git a/.vscode/settings.json b/.vscode/settings.json index e69de29..e685f8d 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -0,0 +1,11 @@ +{ + "python.analysis.extraPaths": [ + "D:\\SteamLibrary\\steamapps\\common\\Blender\\4.3\\scripts\\addons", + "C:\\Users\\Onan\\AppData\\Roaming\\Blender Foundation\\Blender\\4.3\\extensions\\user_default\\",//C:/Users/Onan/AppData/Roaming/Blender Foundation/Blender/4.0/scripts/addons + "D:\\blender stuff\\blendercodestuff\\4.3" + ], + "python.analysis.diagnosticSeverityOverrides": { + "reportInvalidTypeForm": "none" + }, + "python.REPL.enableREPLSmartSend": false, +} \ No newline at end of file diff --git a/core/properties.py b/core/properties.py new file mode 100644 index 0000000..530a53b --- /dev/null +++ b/core/properties.py @@ -0,0 +1,25 @@ +from bpy.types import Scene, PropertyGroup, Object, Material, TextureNode +from bpy.props import BoolProperty, EnumProperty, FloatProperty, IntProperty, CollectionProperty, StringProperty, FloatVectorProperty, PointerProperty +from bpy.utils import register_class + + + +def register_properties(): + class Material_Texture_Atlas_PropertyGroup(PropertyGroup): + normal: PointerProperty(type=TextureNode) + albedo: PointerProperty(type=TextureNode) + emission: PointerProperty(type=TextureNode) + ambient_occlusion: PointerProperty(type=TextureNode) + height: PointerProperty(type=TextureNode) + + + register_class(Material_Texture_Atlas_PropertyGroup) + Material.texture_atlas = PointerProperty(type=Material_Texture_Atlas_PropertyGroup) + + class Texture_Atlas_PropertyGroup(PropertyGroup): + materials: CollectionProperty(type=Material) + + Scene.texture_atlas_properties = PointerProperty(type=Texture_Atlas_PropertyGroup) + + + \ No newline at end of file diff --git a/functions/texture_atlas.py b/functions/texture_atlas.py new file mode 100644 index 0000000..e303838 --- /dev/null +++ b/functions/texture_atlas.py @@ -0,0 +1,23 @@ +import bpy +from typing import List, Optional +from bpy.types import Operator, Context, Object, TextureNode +from ..core.register import register_wrap +from ..core.common import get_armature, simplify_bonename + +@register_wrap +class Atlas_Textures(Operator): + bl_idname = "avatar_toolkit.atlas_textures" + bl_label = "Atlas Textures" + bl_description = """Combines materials and their textures to optimize the model. +Although this combines materials, it may not reduce your VRAM usage. Other tools +like Tuxedo can vastly reduce your VRAM usage as well as many other optimizations, +rather than just duct taping the textures together like material combiner and this tool. +""" + bl_options = {'REGISTER', 'UNDO'} + + def execute(self, context: Context) -> set: + + + return {'FINISHED'} + +