[Bf-extensions-cvs] [bbf44f74] master: Bsurfaces: Cleanup some statements that make no sense

Jacques Lucke noreply at git.blender.org
Wed Sep 26 11:13:44 CEST 2018


Commit: bbf44f7484487f3a2913f53715062fff05ac449d
Author: Jacques Lucke
Date:   Wed Sep 26 11:13:14 2018 +0200
Branches: master
https://developer.blender.org/rBAbbf44f7484487f3a2913f53715062fff05ac449d

Bsurfaces: Cleanup some statements that make no sense

Differential: https://developer.blender.org/D3734

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

M	mesh_bsurfaces.py

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

diff --git a/mesh_bsurfaces.py b/mesh_bsurfaces.py
index d6c855de..9020dc94 100644
--- a/mesh_bsurfaces.py
+++ b/mesh_bsurfaces.py
@@ -400,21 +400,21 @@ class GPENCIL_OT_SURFSK_add_surface(Operator):
         if not self.using_external_curves:
             try:
                 bpy.ops.object.select_all('INVOKE_REGION_WIN', action='DESELECT')
-                bpy.data.objects[self.original_curve.name].select = True
-                bpy.context.scene.objects.active = bpy.data.objects[self.original_curve.name]
+                self.original_curve.select = True
+                bpy.context.scene.objects.active = self.original_curve
 
                 bpy.ops.object.delete()
             except:
                 pass
 
             bpy.ops.object.select_all('INVOKE_REGION_WIN', action='DESELECT')
-            bpy.data.objects[self.main_object.name].select = True
-            bpy.context.scene.objects.active = bpy.data.objects[self.main_object.name]
+            self.main_object.select = True
+            bpy.context.scene.objects.active = self.main_object
         else:
             bpy.ops.object.select_all('INVOKE_REGION_WIN', action='DESELECT')
-            bpy.data.objects[self.original_curve.name].select = True
-            bpy.data.objects[self.main_object.name].select = True
-            bpy.context.scene.objects.active = bpy.data.objects[self.main_object.name]
+            self.original_curve.select = True
+            self.main_object.select = True
+            bpy.context.scene.objects.active = self.main_object
 
         bpy.ops.object.editmode_toggle('INVOKE_REGION_WIN')
 
@@ -996,8 +996,8 @@ class GPENCIL_OT_SURFSK_add_surface(Operator):
                 self.main_object.modifiers[m_idx].show_viewport = False
 
         bpy.ops.object.select_all('INVOKE_REGION_WIN', action='DESELECT')
-        bpy.data.objects[ob_original_splines.name].select = True
-        bpy.context.scene.objects.active = bpy.data.objects[ob_original_splines.name]
+        ob_original_splines.select = True
+        bpy.context.scene.objects.active = ob_original_splines
 
         if len(ob_original_splines.data.splines) >= 2:
             bpy.ops.object.duplicate('INVOKE_REGION_WIN')
@@ -1122,8 +1122,8 @@ class GPENCIL_OT_SURFSK_add_surface(Operator):
                 self.crosshatch_merge_distance = shortest_dist / 3
 
             bpy.ops.object.select_all('INVOKE_REGION_WIN', action='DESELECT')
-            bpy.data.objects[ob_splines.name].select = True
-            bpy.context.scene.objects.active = bpy.data.objects[ob_splines.name]
+            ob_splines.select = True
+            bpy.context.scene.objects.active = ob_splines
 
             # Deselect all points
             bpy.ops.object.editmode_toggle('INVOKE_REGION_WIN')
@@ -1310,8 +1310,8 @@ class GPENCIL_OT_SURFSK_add_surface(Operator):
         # Delete all duplicates
         for o in objects_to_delete:
             bpy.ops.object.select_all('INVOKE_REGION_WIN', action='DESELECT')
-            bpy.data.objects[o.name].select = True
-            bpy.context.scene.objects.active = bpy.data.objects[o.name]
+            o.select = True
+            bpy.context.scene.objects.active = o
             bpy.ops.object.delete()
 
         # If the main object has modifiers, turn their "viewport view status" to
@@ -1358,8 +1358,8 @@ class GPENCIL_OT_SURFSK_add_surface(Operator):
         bpy.context.scene.objects.link(ob)
 
         bpy.ops.object.select_all('INVOKE_REGION_WIN', action='DESELECT')
-        bpy.data.objects[ob.name].select = True
-        bpy.context.scene.objects.active = bpy.data.objects[ob.name]
+        ob.select = True
+        bpy.context.scene.objects.active = ob
 
         # Get together each vert and its nearest, to the middle position
         verts = ob.data.vertices
@@ -1537,15 +1537,15 @@ class GPENCIL_OT_SURFSK_add_surface(Operator):
 
         # Delete final points temporal object
         bpy.ops.object.select_all('INVOKE_REGION_WIN', action='DESELECT')
-        bpy.data.objects[final_points_ob.name].select = True
-        bpy.context.scene.objects.active = bpy.data.objects[final_points_ob.name]
+        final_points_ob.select = True
+        bpy.context.scene.objects.active = final_points_ob
 
         bpy.ops.object.delete()
 
         # Delete isolated verts if there are any
         bpy.ops.object.select_all('INVOKE_REGION_WIN', action='DESELECT')
-        bpy.data.objects[ob_surface.name].select = True
-        bpy.context.scene.objects.active = bpy.data.objects[ob_surface.name]
+        ob_surface.select = True
+        bpy.context.scene.objects.active = ob_surface
 
         bpy.ops.object.editmode_toggle('INVOKE_REGION_WIN')
         bpy.ops.mesh.select_all(action='DESELECT')
@@ -1682,15 +1682,15 @@ class GPENCIL_OT_SURFSK_add_surface(Operator):
 
         # Delete duplicated object
         bpy.ops.object.select_all('INVOKE_REGION_WIN', action='DESELECT')
-        bpy.data.objects[final_ob_duplicate.name].select = True
-        bpy.context.scene.objects.active = bpy.data.objects[final_ob_duplicate.name]
+        final_ob_duplicate.select = True
+        bpy.context.scene.objects.active = final_ob_duplicate
         bpy.ops.object.delete()
 
         # Join crosshatched surface and main object
         bpy.ops.object.select_all('INVOKE_REGION_WIN', action='DESELECT')
-        bpy.data.objects[ob_surface.name].select = True
-        bpy.data.objects[self.main_object.name].select = True
-        bpy.context.scene.objects.active = bpy.data.objects[self.main_object.name]
+        ob_surface.select = True
+        self.main_object.select = True
+        bpy.context.scene.objects.active = self.main_object
 
         bpy.ops.object.join('INVOKE_REGION_WIN')
 
@@ -1893,8 +1893,8 @@ class GPENCIL_OT_SURFSK_add_surface(Operator):
         bpy.ops.object.editmode_toggle('INVOKE_REGION_WIN')
 
         bpy.ops.object.select_all('INVOKE_REGION_WIN', action='DESELECT')
-        bpy.data.objects[self.main_splines.name].select = True
-        bpy.context.scene.objects.active = bpy.context.scene.objects[self.main_splines.name]
+        self.main_splines.select = True
+        bpy.context.scene.objects.active = self.main_splines
 
         # Enter editmode for the new curve (converted from grease pencil strokes), to smooth it out
         bpy.ops.object.editmode_toggle('INVOKE_REGION_WIN')
@@ -2445,8 +2445,8 @@ class GPENCIL_OT_SURFSK_add_surface(Operator):
                 spline_bp_count = len(spline.bezier_points)
 
                 bpy.ops.object.select_all('INVOKE_REGION_WIN', action='DESELECT')
-                bpy.data.objects[ob_simplified_curve[i].name].select = True
-                bpy.context.scene.objects.active = bpy.context.scene.objects[ob_simplified_curve[i].name]
+                ob_simplified_curve[i].select = True
+                bpy.context.scene.objects.active = ob_simplified_curve[i]
 
                 bpy.ops.object.editmode_toggle('INVOKE_REGION_WIN')
                 bpy.ops.curve.select_all('INVOKE_REGION_WIN', action='SELECT')
@@ -2490,8 +2490,8 @@ class GPENCIL_OT_SURFSK_add_surface(Operator):
 
                 # Delete the temporal curve
                 bpy.ops.object.select_all('INVOKE_REGION_WIN', action='DESELECT')
-                bpy.data.objects[ob_simplified_curve[i].name].select = True
-                bpy.context.scene.objects.active = bpy.context.scene.objects[ob_simplified_curve[i].name]
+                ob_simplified_curve[i].select = True
+                bpy.context.scene.objects.active = ob_simplified_curve[i]
 
                 bpy.ops.object.delete()
 
@@ -2629,8 +2629,8 @@ class GPENCIL_OT_SURFSK_add_surface(Operator):
                 vert_num_in_spline += 1
 
         bpy.ops.object.select_all('INVOKE_REGION_WIN', action='DESELECT')
-        bpy.data.objects[ob_ctrl_pts.name].select = True
-        bpy.context.scene.objects.active = bpy.data.objects[ob_ctrl_pts.name]
+        ob_ctrl_pts.select = True
+        bpy.context.scene.objects.active = ob_ctrl_pts
 
         bpy.ops.object.editmode_toggle('INVOKE_REGION_WIN')
         bpy.ops.mesh.select_all(action='DESELECT')
@@ -2771,8 +2771,8 @@ class GPENCIL_OT_SURFSK_add_surface(Operator):
 
             splines_U_objects.append(ob_spline_U)
             bpy.ops.object.select_all('INVOKE_REGION_WIN', action='DESELECT')
-            bpy.data.objects[ob_spline_U.name].select = True
-            bpy.context.scene.objects.active = bpy.data.objects[ob_spline_U.name]
+            ob_spline_U.select = True
+            bpy.context.scene.objects.active = ob_spline_U
 
         # When option "Loops on strokes" is active each "Cross" loop will have
         # its own proportions according to where the original strokes "touch" them
@@ -2975,15 +2975,15 @@ class GPENCIL_OT_SURFSK_add_surface(Operator):
 
         # Delete object with control points and object from grease pencil convertion
         bpy.ops.object.select_all('INVOKE_REGION_WIN', action='DESELECT')
-        bpy.data.objects[ob_ctrl_pts.name].select = True
-        bpy.context.scene.objects.active = bpy.data.objects[ob_ctrl_pts.name]
+        ob_ctrl_pts.select = True
+        bpy.context.scene.objects.active = ob_ctrl_pts
 
         bpy.ops.object.delete()
 
         for sp_ob in splines_U_objects:
             bpy.ops.object.select_all('INVOKE_REGION_WIN', action='DESELECT')
-            bpy.data.objects[sp_ob.name].select = True
-            bpy.context.scene.objects.active = bpy.data.objects[sp_ob.name]
+            sp_ob.select = True
+            bpy.context.scene.objects.active = sp_ob
 
             bpy.ops.object.delete()
 
@@ -3023,7 +3023,7 @@ class GPENCIL_OT_SURFSK_add_surface(Operator):
         # Join the new mesh to the main object
         ob_surface.select = True
         self.main_object.select = True
-        bpy.context.scene.objects.active = bpy.data.objects[self.main_object.name]
+        bpy.context.scene.objects.active = self.main_object
 
         bpy.ops.object.join('INVOKE_REGION_WIN')
 
@@ -3060,8 +3060,8 @@ class GPENCIL_OT_SURFSK_add_surface(Operator):
             bpy.ops.object.editmode_toggle('INVOKE_REGION_WIN')
 
             bpy.ops.object.select_all('INVOKE_REGION_WIN', action='DESELECT')
-            

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-extensions-cvs mailing list