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:
authorAlexander Gavrilov <angavrilov@gmail.com>2019-09-08 21:56:45 +0300
committerAlexander Gavrilov <angavrilov@gmail.com>2019-09-08 21:56:45 +0300
commitfb23ec0c0bbfd5fcc208aa6729d42121adba9a49 (patch)
tree524d5987a3cc3051091d998c28df02896abc4517 /rigify/utils/widgets.py
parent69d8bf08be9c77c02b130c53495da1a56f9879e3 (diff)
Fix T68856: rigify adds widgets to the wrong collection.
Patch suggested by @pioverfour.
Diffstat (limited to 'rigify/utils/widgets.py')
-rw-r--r--rigify/utils/widgets.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/rigify/utils/widgets.py b/rigify/utils/widgets.py
index 85b81cff..fad1065a 100644
--- a/rigify/utils/widgets.py
+++ b/rigify/utils/widgets.py
@@ -22,6 +22,7 @@ import bpy
import math
from .errors import MetarigError
+from .collections import ensure_widget_collection
WGT_PREFIX = "WGT-" # Prefix for widget objects
@@ -65,7 +66,7 @@ def create_widget(rig, bone_name, bone_transform_name=None):
obj_name = WGT_PREFIX + rig.name + '_' + bone_name
scene = bpy.context.scene
- collection = bpy.context.collection
+ collection = ensure_widget_collection(bpy.context)
# Check if it already exists in the scene
if obj_name in scene.objects: