[Bf-extensions-cvs] [70df942d] blender2.8: Update for changes in Blender's API

Campbell Barton noreply at git.blender.org
Wed Nov 7 23:07:25 CET 2018


Commit: 70df942d31aaaa3d25b7c5543f28529cc51170cc
Author: Campbell Barton
Date:   Thu Nov 8 09:06:57 2018 +1100
Branches: blender2.8
https://developer.blender.org/rBA70df942d31aaaa3d25b7c5543f28529cc51170cc

Update for changes in Blender's API

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

M	curve_simplify.py
M	io_anim_bvh/import_bvh.py
M	io_coat3D/__init__.py
M	io_import_images_as_planes.py
M	io_mesh_ply/import_ply.py
M	io_mesh_stl/blender_utils.py
M	io_scene_fbx/import_fbx.py
M	io_scene_obj/import_obj.py
M	object_collections.py
M	object_print3d_utils/mesh_helpers.py
M	rigify/generate.py
M	rigify/legacy/generate.py

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

diff --git a/curve_simplify.py b/curve_simplify.py
index e0d59c60..4a390feb 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 0a9e4b30..f609ca6c 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 751e56f7..88278787 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 e0c71426..6a043579 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 f05e1caa..5ec24f8a 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 1dfa76d8..fcc4889a 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 0a8be6cf..8e4747b0 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 71810bcc..5980a0b2 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 9c7d6d76..b7ec5c56 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 44cce337..6a18e3e2 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.sele

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-extensions-cvs mailing list