[Bf-extensions-cvs] [fb23ec0c] master: Fix T68856: rigify adds widgets to the wrong collection.

Alexander Gavrilov noreply at git.blender.org
Sun Sep 8 20:56:55 CEST 2019


Commit: fb23ec0c0bbfd5fcc208aa6729d42121adba9a49
Author: Alexander Gavrilov
Date:   Sun Sep 8 21:56:45 2019 +0300
Branches: master
https://developer.blender.org/rBAfb23ec0c0bbfd5fcc208aa6729d42121adba9a49

Fix T68856: rigify adds widgets to the wrong collection.

Patch suggested by @pioverfour.

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

M	rigify/utils/widgets.py

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

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:



More information about the Bf-extensions-cvs mailing list