diff --git a/curve_simplify.py b/curve_simplify.py index e0d59c60ded8527dfaf35de0480105d869ba4a8d..4a390feb54e4bbfbfc49eff48fade307841433c4 100644 --- a/curve_simplify.py +++ b/curve_simplify.py @@ -309,7 +309,7 @@ def main(context, obj, options, curve_dimension): newCurve = bpy.data.objects.new("Simple_" + obj.name, curve) coll = context.view_layer.active_layer_collection.collection coll.objects.link(newCurve) - newCurve.select_set('SELECT') + newCurve.select_set(True) context.view_layer.objects.active = newCurve newCurve.matrix_world = obj.matrix_world diff --git a/io_anim_bvh/import_bvh.py b/io_anim_bvh/import_bvh.py index 0a9e4b30cef2e140d9ca06a789ff11eb0dde90c1..f609ca6cae7a192b02fb9898242bd4240b6644c9 100644 --- a/io_anim_bvh/import_bvh.py +++ b/io_anim_bvh/import_bvh.py @@ -348,7 +348,7 @@ def bvh_node_dict2objects(context, bvh_name, bvh_nodes, rotate_mode='NATIVE', fr scene = context.scene for obj in scene.objects: - obj.select_set("DESELECT") + obj.select_set(False) objects = [] @@ -356,7 +356,7 @@ def bvh_node_dict2objects(context, bvh_name, bvh_nodes, rotate_mode='NATIVE', fr obj = bpy.data.objects.new(name, None) context.collection.objects.link(obj) objects.append(obj) - obj.select_set("SELECT") + obj.select_set(True) # nicer drawing. obj.empty_display_type = 'CUBE' @@ -422,14 +422,14 @@ def bvh_node_dict2armature( # Add the new armature, scene = context.scene for obj in scene.objects: - obj.select_set("DESELECT") + obj.select_set(False) arm_data = bpy.data.armatures.new(bvh_name) arm_ob = bpy.data.objects.new(bvh_name, arm_data) context.collection.objects.link(arm_ob) - arm_ob.select_set("SELECT") + arm_ob.select_set(True) context.view_layer.objects.active = arm_ob bpy.ops.object.mode_set(mode='OBJECT', toggle=False) diff --git a/io_coat3D/__init__.py b/io_coat3D/__init__.py index 751e56f70e57b79f4facf2ec5c62253658e7c396..88278787ed7d8edef9ab88dc97604d8b348a8d43 100644 --- a/io_coat3D/__init__.py +++ b/io_coat3D/__init__.py @@ -194,15 +194,15 @@ def updatemesh(objekti, proxy): if(objekti.vertex_groups.keys() != []): bpy.ops.object.select_all(action='DESELECT') - proxy.select_set('SELECT') - objekti.select_set('SELECT') + proxy.select_set(True) + objekti.select_set(True) bpy.ops.object.vertex_group_copy_to_selected() bpy.ops.object.select_all(action='DESELECT') # UV Set Copy - proxy.select_set('SELECT') - objekti.select_set('SELECT') + proxy.select_set(True) + objekti.select_set(True) if len(objekti.data.uv_layers) > 1: obj_uv_index = objekti.data.uv_layers.active_index @@ -220,7 +220,7 @@ def updatemesh(objekti, proxy): #Mesh Copy - proxy.select_set('SELECT') + proxy.select_set(True) obj_data = objekti.data.id_data objekti.data = proxy.data.id_data objekti.data.id_data.name = obj_data.name @@ -566,7 +566,7 @@ class SCENE_OT_import(bpy.types.Operator): objekti = bpy.data.objects[oname] if(objekti.coat3D.import_mesh and coat3D.importmesh == True): objekti.coat3D.import_mesh = False - objekti.select_set('SELECT') + objekti.select_set(True) new_name = objekti.data.name name_boxs = new_name.split('.') @@ -627,7 +627,7 @@ class SCENE_OT_import(bpy.types.Operator): mat_list.append(obj_mat.material) bpy.ops.object.select_all(action='DESELECT') - obj_proxy.select_set('SELECT') + obj_proxy.select_set(True) bpy.ops.object.select_all(action='TOGGLE') @@ -650,7 +650,7 @@ class SCENE_OT_import(bpy.types.Operator): #tärkee että saadaan oikein käännettyä objekt - objekti.select_set('SELECT') + objekti.select_set(True) bpy.ops.object.origin_set(type='GEOMETRY_ORIGIN') objekti.data.materials.pop() @@ -675,14 +675,14 @@ class SCENE_OT_import(bpy.types.Operator): if(coat3D.importmesh and not(os.path.isfile(objekti.coat3D.applink_address))): coat3D.importmesh = False - objekti.select_set('SELECT') + objekti.select_set(True) if(coat3D.importtextures): is_new = False print('matlist: ', mat_list) print('objekti: ', objekti) print('is_new: ', is_new) tex.matlab(objekti,mat_list,texturelist,is_new) - objekti.select_set('DESELECT') + objekti.select_set(False) else: mat_list = [] @@ -696,13 +696,13 @@ class SCENE_OT_import(bpy.types.Operator): print('objekti: ', objekti) print('is_new: ', is_new) tex.matlab(objekti,mat_list,texturelist, is_new) - objekti.select_set('DESELECT') + objekti.select_set(False) bpy.ops.object.select_all(action='DESELECT') if(import_list): for del_obj in diff_objects: - bpy.context.collection.all_objects[del_obj].select_set('SELECT') + bpy.context.collection.all_objects[del_obj].select_set(True) bpy.ops.object.delete() @@ -760,12 +760,12 @@ class SCENE_OT_import(bpy.types.Operator): if(new_obj.coat3D.applink_old == False): nimi += new_obj.data.name + ':::' - new_obj.select_set('SELECT') + new_obj.select_set(True) #bpy.ops.object.origin_set(type='GEOMETRY_ORIGIN') new_obj.rotation_euler = (0, 0, 0) new_obj.scale = (1, 1, 1) new_obj.coat3D.applink_firsttime = False - new_obj.select_set('DESELECT') + new_obj.select_set(False) new_obj.coat3D.applink_address = new_applink_address new_obj.coat3D.objecttime = str(os.path.getmtime(new_obj.coat3D.applink_address)) splittext = ntpath.basename(new_applink_address) diff --git a/io_import_images_as_planes.py b/io_import_images_as_planes.py index e0c71426388018ed0f1e87658444deef9e587b1e..6a04357949b90ee1a361cc921e5e577c4f0ff479 100644 --- a/io_import_images_as_planes.py +++ b/io_import_images_as_planes.py @@ -908,7 +908,7 @@ class IMPORT_IMAGE_OT_to_plane(Operator, AddObjectHelper): # setup new selection for plane in planes: - plane.select_set('SELECT') + plane.select_set(True) # all done! self.report({'INFO'}, "Added {} Image Plane(s)".format(len(planes))) diff --git a/io_mesh_ply/import_ply.py b/io_mesh_ply/import_ply.py index f05e1caacb9dceeae400865632717b3bb6ff6d0a..5ec24f8a9e66042f7d0ba8cb8b670a4c06b62512 100644 --- a/io_mesh_ply/import_ply.py +++ b/io_mesh_ply/import_ply.py @@ -398,7 +398,7 @@ def load_ply(filepath): obj = bpy.data.objects.new(ply_name, mesh) bpy.context.collection.objects.link(obj) bpy.context.view_layer.objects.active = obj - obj.select_set("SELECT") + obj.select_set(True) print('\nSuccessfully imported %r in %.3f sec' % (filepath, time.time() - t)) return {'FINISHED'} diff --git a/io_mesh_stl/blender_utils.py b/io_mesh_stl/blender_utils.py index 1dfa76d88ebf2c77f67c579c0b6511397792e74c..fcc4889a4af5d786d3ba2f35c0c24dc9b8c4c6d7 100644 --- a/io_mesh_stl/blender_utils.py +++ b/io_mesh_stl/blender_utils.py @@ -60,7 +60,7 @@ def create_and_link_mesh(name, faces, face_nors, points, global_matrix): obj = bpy.data.objects.new(name, mesh) bpy.context.collection.objects.link(obj) bpy.context.view_layer.objects.active = obj - obj.select_set("SELECT") + obj.select_set(True) def faces_from_mesh(ob, global_matrix, use_mesh_modifiers=False): diff --git a/io_scene_fbx/import_fbx.py b/io_scene_fbx/import_fbx.py index 0a8be6cf80b92bb3d6d8c4c0a65976d192dbc199..8e4747b052ade52715abc8ad89b6274cd3b471b3 100644 --- a/io_scene_fbx/import_fbx.py +++ b/io_scene_fbx/import_fbx.py @@ -1971,7 +1971,7 @@ class FbxImportHelperNode: # instance in scene view_layer.active_layer_collection.collection.objects.link(obj) - obj.select_set('SELECT') + obj.select_set(True) return obj @@ -2098,7 +2098,7 @@ class FbxImportHelperNode: # instance in scene view_layer.active_layer_collection.collection.objects.link(arm) - arm.select_set('SELECT') + arm.select_set(True) # Add bones: @@ -2141,7 +2141,7 @@ class FbxImportHelperNode: # instance in scene view_layer.active_layer_collection.collection.objects.link(obj) - obj.select_set('SELECT') + obj.select_set(True) return obj else: diff --git a/io_scene_obj/import_obj.py b/io_scene_obj/import_obj.py index 71810bcc6c1a253993558ae2f2b162ac19a61c08..5980a0b250a5600a4610af24ee82c26c68b32dec 100644 --- a/io_scene_obj/import_obj.py +++ b/io_scene_obj/import_obj.py @@ -1184,7 +1184,7 @@ def load(context, # Create new obj for obj in new_objects: collection.objects.link(obj) - obj.select_set('SELECT') + obj.select_set(True) # we could apply this anywhere before scaling. obj.matrix_world = global_matrix diff --git a/object_collections.py b/object_collections.py index 9c7d6d767d464ff95d0407c145f1d6c98c8de3d9..b7ec5c56e8ff08c66c22a71d9ee1b95885e0ce62 100644 --- a/object_collections.py +++ b/object_collections.py @@ -193,7 +193,7 @@ class OBJECT_OT_collection_unlink(Operator): def select_collection_objects(collection): for ob in collection.objects: - ob.select_set('SELECT') + ob.select_set(True) for collection_nested in collection.collections: select_collection_objects(collection_nested) diff --git a/object_print3d_utils/mesh_helpers.py b/object_print3d_utils/mesh_helpers.py index 44cce337a40470209c82e07335945fea51e0b2fe..6a18e3e297ae0df53e9eb89ec5b0defc50a93e0c 100644 --- a/object_print3d_utils/mesh_helpers.py +++ b/object_print3d_utils/mesh_helpers.py @@ -242,14 +242,14 @@ def object_merge(context, objects): # deselect all for obj in scene.objects: - obj.select_set('DESELECT') + obj.select_set(False) # add empty object mesh_base = bpy.data.meshes.new(name="~tmp~") obj_base = bpy.data.objects.new(name="~tmp~", object_data=mesh_base) scene_collection.objects.link(obj_base) layer.objects.active = obj_base - obj_base.select_set('SELECT') + obj_base.select_set(True) # loop over all meshes for obj in objects: diff --git a/rigify/generate.py b/rigify/generate.py index b38bfd6d7ca9f18b3de1b2aba82e7748f87ae90e..c804cb69319f6c529996acfc072a01c0dd5ac4e1 100644 --- a/rigify/generate.py +++ b/rigify/generate.py @@ -116,8 +116,8 @@ def generate_rig(context, metarig): obj.animation_data_clear() # Select generated rig object - metarig.select_set('DESELECT') - obj.select_set('SELECT') + metarig.select_set(False) + obj.select_set(True) view_layer.objects.active = obj # Remove wgts if force update is set @@ -125,7 +125,7 @@ def generate_rig(context, metarig): if wgts_group_name in scene.objects and id_store.rigify_force_widget_update: bpy.ops.object.select_all(action='DESELECT') for wgt in bpy.data.objects[wgts_group_name].children: - wgt.select_set('SELECT') + wgt.select_set(True) bpy.ops.object.delete(use_global=False) if rig_old_name: bpy.data.objects[wgts_group_name].name = "WGTS_" + obj.name @@ -154,9 +154,9 @@ def generate_rig(context, metarig): # Select the temp rigs for merging for objt in scene.objects: - objt.select_set('DESELECT') # deselect all objects - temp_rig_1.select_set('SELECT') - temp_rig_2.select_set('SELECT') + objt.select_set(False) # deselect all objects + temp_rig_1.select_set(True) + temp_rig_2.select_set(True) view_layer.objects.active = temp_rig_2 # Merge the temporary rigs @@ -167,8 +167,8 @@ def generate_rig(context, metarig): # Select the generated rig for objt in scene.objects: - objt.select_set('DESELECT') # deselect all objects - obj.select_set('SELECT') + objt.select_set(False) # deselect all objects + obj.select_set(True) view_layer.objects.active = obj # Copy over bone properties @@ -318,7 +318,7 @@ def generate_rig(context, metarig): # if id_store.rigify_generate_mode == 'new': # bpy.ops.object.select_all(action='DESELECT') # for wgt in bpy.data.objects[wgts_group_name].children: - # wgt.select_set('SELECT') + # wgt.select_set(True) # bpy.ops.object.make_single_user(obdata=True) #---------------------------------- @@ -336,7 +336,7 @@ def generate_rig(context, metarig): # Go into editmode in the rig armature bpy.ops.object.mode_set(mode='OBJECT') context.view_layer.objects.active = obj - obj.select_set('SELECT') + obj.select_set(True) bpy.ops.object.mode_set(mode='EDIT') scripts = rig.generate() if scripts is not None: @@ -534,8 +534,8 @@ def create_selection_sets(obj, metarig): bpy.ops.object.mode_set(mode='POSE') bpy.context.view_layer.objects.active = obj - obj.select_set('SELECT') - metarig.select_set('DESELECT') + obj.select_set(True) + metarig.select_set(False) pbones = obj.pose.bones for i, name in enumerate(metarig.data.rigify_layers.keys()): diff --git a/rigify/legacy/generate.py b/rigify/legacy/generate.py index 77c4e28e9dd0a2a37f043097f5b2f7a71e16885e..4c571c3fd1e33d7d454b09643602c5dbb22c1446 100644 --- a/rigify/legacy/generate.py +++ b/rigify/legacy/generate.py @@ -101,8 +101,8 @@ def generate_rig(context, metarig): obj.animation_data_clear() # Select generated rig object - metarig.select_set('DESELECT') - obj.select_set('SELECT') + metarig.select_set(False) + obj.select_set(True) view_layer.objects.active = obj # Remove all bones from the generated rig armature. @@ -122,9 +122,9 @@ def generate_rig(context, metarig): # Select the temp rigs for merging for objt in scene.objects: - objt.select_set('DESELECT') # deselect all objects - temp_rig_1.select_set('SELECT') - temp_rig_2.select_set('SELECT') + objt.select_set(False) # deselect all objects + temp_rig_1.select_set(True) + temp_rig_2.select_set(True) view_layer.objects.active = temp_rig_2 # Merge the temporary rigs @@ -135,8 +135,8 @@ def generate_rig(context, metarig): # Select the generated rig for objt in scene.objects: - objt.select_set('DESELECT') # deselect all objects - obj.select_set('SELECT') + objt.select_set(False) # deselect all objects + obj.select_set(True) view_layer.objects.active = obj # Copy over bone properties @@ -281,7 +281,7 @@ def generate_rig(context, metarig): # Go into editmode in the rig armature bpy.ops.object.mode_set(mode='OBJECT') context.view_layer.objects.active = obj - obj.select_set('SELECT') + obj.select_set(True) bpy.ops.object.mode_set(mode='EDIT') scripts = rig.generate() if scripts is not None: