Fix T62436: New added Torus won't appear in Local View
Add Object.local_view_get/set Alternate fix which supports removing from local view & checking if an object is in local view. Also avoids redundant refresh. Matches 2.7x Object.layer_local_view capabilities more closely, without exposing the flag directly.
This commit is contained in:
@@ -133,6 +133,11 @@ def object_data_add(context, obdata, operator=None, name=None):
|
||||
obj_new.select_set(True)
|
||||
obj_new.matrix_world = add_object_align_init(context, operator)
|
||||
|
||||
space_data = context.space_data
|
||||
if space_data.type == 'VIEW_3D':
|
||||
if space_data.local_view:
|
||||
obj_new.local_view_set(space_data, True)
|
||||
|
||||
if obj_act and obj_act.mode == 'EDIT' and obj_act.type == obj_new.type:
|
||||
bpy.ops.mesh.select_all(action='DESELECT')
|
||||
obj_act.select_set(True)
|
||||
|
Reference in New Issue
Block a user