From 4f539912ebde3fa27b8d58b956d6772088201384 Mon Sep 17 00:00:00 2001 From: Aurelien Vaillant Date: Sun, 12 May 2024 18:15:19 +0200 Subject: [PATCH] Refactoring model inside properties Make a Property Group for blender --- Fange Pipeline/__init__.py | 6 +++++- Fange Pipeline/operators/exports.py | 2 +- Fange Pipeline/operators/outline.py | 2 +- Fange Pipeline/properties/__init__.py | 0 Fange Pipeline/properties/main.py | 10 ++++++++++ Fange Pipeline/{ => properties}/models.py | 0 6 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 Fange Pipeline/properties/__init__.py create mode 100644 Fange Pipeline/properties/main.py rename Fange Pipeline/{ => properties}/models.py (100%) diff --git a/Fange Pipeline/__init__.py b/Fange Pipeline/__init__.py index f178ca8..5bf54dc 100644 --- a/Fange Pipeline/__init__.py +++ b/Fange Pipeline/__init__.py @@ -24,7 +24,7 @@ modules_class = [ # UI GRAOU_PT_panel, # Preference - GRAOU_AddonPreference + GRAOU_AddonPreference, FangeProperties ] @@ -32,11 +32,15 @@ def register(): for cls in modules_class: bpy.utils.register_class(cls) + bpy.types.Scene.graou_props = bpy.props.PointerProperty(type=FangeProperties) + def unregister(): for cls in reversed(modules_class): bpy.utils.unregister_class(cls) + del bpy.types.Scene.graou_props + if __name__ == "__main__": register() diff --git a/Fange Pipeline/operators/exports.py b/Fange Pipeline/operators/exports.py index 9fb2545..39d05dd 100644 --- a/Fange Pipeline/operators/exports.py +++ b/Fange Pipeline/operators/exports.py @@ -1,6 +1,6 @@ import bpy -from ..models import FangeProject +from ..properties.models import FangeProject from pathlib import Path diff --git a/Fange Pipeline/operators/outline.py b/Fange Pipeline/operators/outline.py index 283ca60..d18c501 100644 --- a/Fange Pipeline/operators/outline.py +++ b/Fange Pipeline/operators/outline.py @@ -1,6 +1,6 @@ import bpy -from ..models import Outline +from ..properties.models import Outline class ConfigBlendScene(bpy.types.Operator): diff --git a/Fange Pipeline/properties/__init__.py b/Fange Pipeline/properties/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/Fange Pipeline/properties/main.py b/Fange Pipeline/properties/main.py new file mode 100644 index 0000000..82ff76d --- /dev/null +++ b/Fange Pipeline/properties/main.py @@ -0,0 +1,10 @@ +import bpy + + +class FangeProperties(bpy.types.PropertyGroup): + + socket_collection: bpy.props.BoolProperty( + name='State Socket use', + description='Use the socket collection setup', + default=False + ) diff --git a/Fange Pipeline/models.py b/Fange Pipeline/properties/models.py similarity index 100% rename from Fange Pipeline/models.py rename to Fange Pipeline/properties/models.py