File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -1292,7 +1292,13 @@ def execute(self, context):
12921292
12931293 rig = bpy_extras .object_utils .object_data_add (context , amt , name = 'Car Rig' )
12941294
1295- bpy .ops .object .mode_set (mode = 'EDIT' )
1295+ # TODO: cannot edit new object added to a hidden collection
1296+ # Could be a better fix (steal code from other addons).
1297+ try :
1298+ bpy .ops .object .mode_set (mode = 'EDIT' )
1299+ except TypeError :
1300+ self .report ({'ERROR' }, "Cannot edit the new armature! Please make sure the active collection is visible and editable" )
1301+ return {'CANCELLED' }
12961302
12971303 self ._create_bone (rig , 'Body' , delta_pos = self .body_pos_delta )
12981304
@@ -1314,7 +1320,7 @@ def execute(self, context):
13141320
13151321 bpy .ops .object .mode_set (mode = 'OBJECT' )
13161322
1317- return {'FINISHED' }
1323+ return {'FINISHED' }
13181324
13191325 def _create_bone (self , rig , name , delta_pos ):
13201326 b = rig .data .edit_bones .new ('DEF-' + name )
You can’t perform that action at this time.
0 commit comments