Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'archipack/archipack_handle.py')
-rw-r--r--archipack/archipack_handle.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/archipack/archipack_handle.py b/archipack/archipack_handle.py
index 852fe2b6..fcdb570e 100644
--- a/archipack/archipack_handle.py
+++ b/archipack/archipack_handle.py
@@ -29,6 +29,7 @@ import bpy
def create_handle(context, parent, mesh):
+ old = context.active_object
handle = bpy.data.objects.new("Handle", mesh)
handle['archipack_handle'] = True
context.scene.objects.link(handle)
@@ -37,6 +38,11 @@ def create_handle(context, parent, mesh):
modif.levels = 1
handle.parent = parent
handle.matrix_world = parent.matrix_world.copy()
+ context.scene.objects.active = handle
+ m = handle.archipack_material.add()
+ m.category = 'handle'
+ m.material = 'DEFAULT'
+ context.scene.objects.active = old
return handle