[Bf-extensions-cvs] [8ca82330] master: Archipack bugfix: manipulators auto hide

Stephen Leger noreply at git.blender.org
Sat Nov 28 20:35:21 CET 2020


Commit: 8ca8233069579b253dcfb881200321b99e1b612c
Author: Stephen Leger
Date:   Sat Nov 28 20:34:17 2020 +0100
Branches: master
https://developer.blender.org/rBA8ca8233069579b253dcfb881200321b99e1b612c

Archipack bugfix: manipulators auto hide

===================================================================

M	archipack/archipack_manipulator.py
M	archipack/archipack_snap.py
M	archipack/archipack_wall2.py

===================================================================

diff --git a/archipack/archipack_manipulator.py b/archipack/archipack_manipulator.py
index fb454f69..f1d91cad 100644
--- a/archipack/archipack_manipulator.py
+++ b/archipack/archipack_manipulator.py
@@ -112,6 +112,12 @@ class ArchipackActiveManip:
         # reference to object manipulable instance
         self.manipulable = None
 
+    def is_snapping(self, ctx):
+        """
+            Check if snap is active
+        """
+        return ctx.active_object and ctx.active_object.name.startswith("Archipack_")
+
     @property
     def dirty(self):
         """
@@ -122,7 +128,8 @@ class ArchipackActiveManip:
         return (
             self.manipulable is None or
             o is None or
-            not o.select_get()
+            # The object is not selected and snap is not active
+            not (self.is_snapping(bpy.context) or o.select_get())
             )
 
     def exit(self):
diff --git a/archipack/archipack_snap.py b/archipack/archipack_snap.py
index 346b64dd..9d50add7 100644
--- a/archipack/archipack_snap.py
+++ b/archipack/archipack_snap.py
@@ -228,13 +228,13 @@ class ArchipackSnapBase():
         """
         helper = bpy.data.objects.get('Archipack_snap_helper')
         if helper is not None:
-            print("helper found")
+            # print("helper found")
             if context.scene.objects.get('Archipack_snap_helper') is None:
-                print("link helper")
+                # print("link helper")
                 # self.link_object_to_scene(context, helper)
                 context.scene.collection.objects.link(helper)
         else:
-            print("create helper")
+            # print("create helper")
             m = bpy.data.meshes.new("Archipack_snap_helper")
             m.vertices.add(count=1)
             helper = bpy.data.objects.new("Archipack_snap_helper", m)
diff --git a/archipack/archipack_wall2.py b/archipack/archipack_wall2.py
index 53375992..4469bc9a 100644
--- a/archipack/archipack_wall2.py
+++ b/archipack/archipack_wall2.py
@@ -2257,7 +2257,7 @@ class ARCHIPACK_OT_wall2_draw(ArchipackDrawTool, Operator):
                     d.t_part = self.parent
 
                 if bpy.ops.archipack.manipulate.poll():
-                    bpy.ops.archipack.manipulate('INVOKE_DEFAULT')
+                    bpy.ops.archipack.manipulate('INVOKE_DEFAULT', object_name=o.name)
 
             return {'FINISHED'}



More information about the Bf-extensions-cvs mailing list