Skip to content

Transform your 3D texturing workflow with the power of generative AI, directly within Blender!

move mirror axis selection to operator instead of it being in panel

sakalond17e64dac47a3
diff --git a/stablegen/__init__.py b/stablegen/__init__.py
index df51924..54ae0d5 100644
--- a/stablegen/__init__.py
+++ b/stablegen/__init__.py
@@ -1987,21 +1987,6 @@ def register():
default=True,
update=update_parameters
)
- bpy.types.Scene.stablegen_mirror_axis_x = bpy.props.BoolProperty(
- name="X",
- description="Mirror across X=0 (YZ plane)",
- default=True,
- )
- bpy.types.Scene.stablegen_mirror_axis_y = bpy.props.BoolProperty(
- name="Y",
- description="Mirror across Y=0 (XZ plane)",
- default=False,
- )
- bpy.types.Scene.stablegen_mirror_axis_z = bpy.props.BoolProperty(
- name="Z",
- description="Mirror across Z=0 (XY plane)",
- default=False,
- )
# IPADAPTER parameters
@@ -2125,9 +2110,6 @@ def unregister():
del bpy.types.Scene.qwen_context_cleanup_hue_tolerance
del bpy.types.Scene.qwen_context_cleanup_value_adjust
del bpy.types.Scene.qwen_context_fallback_dilation
- del bpy.types.Scene.stablegen_mirror_axis_x
- del bpy.types.Scene.stablegen_mirror_axis_y
- del bpy.types.Scene.stablegen_mirror_axis_z
for cls in reversed(classes):
bpy.utils.unregister_class(cls)
diff --git a/stablegen/stablegen.py b/stablegen/stablegen.py
index 69e691a..40e4c3e 100644
--- a/stablegen/stablegen.py
+++ b/stablegen/stablegen.py
@@ -1010,12 +1010,6 @@ class StableGenPanel(bpy.types.Panel):
row = tools_box.row()
row.operator("object.stablegen_mirror_reproject", text="Mirror Last Projection", icon="MOD_MIRROR")
- row = tools_box.row(align=True)
- row.label(text="Mirror Axes:")
- row.prop(scene, "stablegen_mirror_axis_x", text="X", toggle=True)
- row.prop(scene, "stablegen_mirror_axis_y", text="Y", toggle=True)
- row.prop(scene, "stablegen_mirror_axis_z", text="Z", toggle=True)
-
layout.separator()
diff --git a/stablegen/util/mirror_color.py b/stablegen/util/mirror_color.py
index ca7bb49..e60aba2 100644
--- a/stablegen/util/mirror_color.py
+++ b/stablegen/util/mirror_color.py
@@ -74,6 +74,10 @@ class MirrorReproject(bpy.types.Operator):
bl_label = "Mirror Last Projection"
bl_options = {'REGISTER', 'UNDO'}
+ mirror_axis_x: bpy.props.BoolProperty(name="X", default=True)
+ mirror_axis_y: bpy.props.BoolProperty(name="Y", default=False)
+ mirror_axis_z: bpy.props.BoolProperty(name="Z", default=False)
+
_original_method = None
_original_overwrite_material = None
_timer = None
@@ -106,6 +110,17 @@ class MirrorReproject(bpy.types.Operator):
return True
+ def invoke(self, context, event):
+ return context.window_manager.invoke_props_dialog(self)
+
+ def draw(self, context):
+ layout = self.layout
+ layout.label(text="Mirror Axes:")
+ row = layout.row()
+ row.prop(self, "mirror_axis_x")
+ row.prop(self, "mirror_axis_y")
+ row.prop(self, "mirror_axis_z")
+
def _mirror_image_file(
self,
src_path: str,
@@ -217,23 +232,23 @@ class MirrorReproject(bpy.types.Operator):
orig_cam = scene.camera if scene.camera in cameras_orig else cameras_orig[0]
src_cam_idx = cameras_orig.index(orig_cam)
- # --- Mirror axes from Scene (UI toggles), same pattern as standard mirror ---
+ # --- Mirror axes from Operator properties ---
axis_configs = [
(
"X",
- getattr(scene, "stablegen_mirror_axis_x", True),
+ self.mirror_axis_x,
dict(mirror_x=True, mirror_y=False, mirror_z=False),
(True, False), # flip_x, flip_y
),
(
"Y",
- getattr(scene, "stablegen_mirror_axis_y", False),
+ self.mirror_axis_y,
dict(mirror_x=False, mirror_y=True, mirror_z=False),
(False, True),
),
(
"Z",
- getattr(scene, "stablegen_mirror_axis_z", False),
+ self.mirror_axis_z,
dict(mirror_x=False, mirror_y=False, mirror_z=True),
(True, True),
),
@@ -393,23 +408,23 @@ class MirrorReproject(bpy.types.Operator):
orig_cam = scene.camera if scene.camera in cameras else cameras[0]
src_cam_idx = cameras.index(orig_cam)
- # --- Mirror axes from Scene (UI toggles) ---
+ # --- Mirror axes from Operator properties ---
axis_configs = [
(
"X",
- getattr(scene, "stablegen_mirror_axis_x", True),
+ self.mirror_axis_x,
dict(mirror_x=True, mirror_y=False, mirror_z=False),
(True, False), # flip_x, flip_y
),
(
"Y",
- getattr(scene, "stablegen_mirror_axis_y", False),
+ self.mirror_axis_y,
dict(mirror_x=False, mirror_y=True, mirror_z=False),
(False, True),
),
(
"Z",
- getattr(scene, "stablegen_mirror_axis_z", False),
+ self.mirror_axis_z,
dict(mirror_x=False, mirror_y=False, mirror_z=True),
(True, True),
),