[Bf-extensions-cvs] [07ec6458] master: Remove base from addons

Dalai Felinto noreply at git.blender.org
Wed May 22 01:09:07 CEST 2019


Commit: 07ec645862275ffe2d60e2d6481080aa0ae8b1f0
Author: Dalai Felinto
Date:   Tue May 21 20:07:49 2019 -0300
Branches: master
https://developer.blender.org/rBA07ec645862275ffe2d60e2d6481080aa0ae8b1f0

Remove base from addons

This is a follow up to rB0910932e71d2.

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

M	io_mesh_atomic/utility_panel.py
M	object_fracture_cell/fracture_cell_setup.py
M	object_print3d_utils/export.py
M	render_povray/primitives.py

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

diff --git a/io_mesh_atomic/utility_panel.py b/io_mesh_atomic/utility_panel.py
index 776786c8..7fb2d8fa 100644
--- a/io_mesh_atomic/utility_panel.py
+++ b/io_mesh_atomic/utility_panel.py
@@ -190,7 +190,7 @@ def distance():
     # In the 'OBJECT' mode
     else:
 
-        if len(bpy.context.selected_bases) > 1:
+        if len(bpy.context.selected_objects) > 1:
             location1 = bpy.context.selected_objects[0].location
             location2 = bpy.context.selected_objects[1].location
         else:
diff --git a/object_fracture_cell/fracture_cell_setup.py b/object_fracture_cell/fracture_cell_setup.py
index 0412a206..fcafa247 100644
--- a/object_fracture_cell/fracture_cell_setup.py
+++ b/object_fracture_cell/fracture_cell_setup.py
@@ -324,6 +324,7 @@ def cell_fracture_boolean(context, obj, objects,
     objects_boolean = []
     collection = context.collection
     scene = context.scene
+    view_layer = context.view_layer
     depsgraph = context.evaluated_depsgraph_get()
 
     if use_interior_hide and level == 0:
@@ -394,9 +395,8 @@ def cell_fracture_boolean(context, obj, objects,
 
     if (not use_debug_bool) and use_island_split:
         # this is ugly and Im not proud of this - campbell
-        base = None
-        for base in scene.object_bases:
-            base.select_set(False)
+        for ob in view_layer.objects:
+            ob.select_set(True)
         for obj_cell in objects_boolean:
             obj_cell.select_set(True)
 
diff --git a/object_print3d_utils/export.py b/object_print3d_utils/export.py
index d980bcc4..8a657dee 100644
--- a/object_print3d_utils/export.py
+++ b/object_print3d_utils/export.py
@@ -58,7 +58,6 @@ def write_mesh(context, info, report_cb):
     unit = scene.unit_settings
     print_3d = scene.print_3d
 
-    # obj_base = layer.object_bases.active
     obj = layer.objects.active
 
     export_format = print_3d.export_format
@@ -67,7 +66,7 @@ def write_mesh(context, info, report_cb):
 
     context_override = context.copy()
 
-    obj_base_tmp = None
+    obj_tmp = None
 
     # PLY can only export single mesh objects!
     if export_format == 'PLY':
@@ -77,14 +76,8 @@ def write_mesh(context, info, report_cb):
         from . import mesh_helpers
         obj_tmp = mesh_helpers.object_merge(context, context_override["selected_objects"])
         context_override["active_object"] = obj_tmp
-        # context_override["selected_bases"] = [obj_base_tmp]
         context_override["selected_objects"] = [obj_tmp]
     else:
-        # XXX28
-        '''
-        if obj_base not in context_override["selected_bases"]:
-            context_override["selected_bases"].append(obj_base)
-        '''
         if obj not in context_override["selected_objects"]:
             context_override["selected_objects"].append(obj)
 
@@ -182,19 +175,17 @@ def write_mesh(context, info, report_cb):
         if path_mode == 'COPY':
             image_copy_guess(filepath, context_override["selected_objects"])
 
-    if obj_base_tmp is not None:
-        obj = obj_base_tmp.object
+    if obj_tmp is not None:
+        obj = obj_tmp
         mesh = obj.data
         collection.objects.unlink(obj)
         bpy.data.objects.remove(obj)
         bpy.data.meshes.remove(mesh)
-        del obj_base_tmp, obj, mesh
+        del obj_tmp, obj, mesh
 
         # restore context
-        base = None
-        for base in context_backup["selected_bases"]:
-            base.select_set(True)
-        del base
+        for ob in context_backup["selected_objects"]
+            ob.select_set(True)
         layer.objects.active = context_backup["active_object"]
 
     if 'FINISHED' in ret:
diff --git a/render_povray/primitives.py b/render_povray/primitives.py
index 416c1db1..5e51b02c 100644
--- a/render_povray/primitives.py
+++ b/render_povray/primitives.py
@@ -189,8 +189,7 @@ def pov_superellipsoid_define(context, op, ob):
         mesh = pov_define_mesh(mesh, verts, [], faces, "SuperEllipsoid")
 
         if not ob:
-            ob_base = object_utils.object_data_add(context, mesh, operator=None)
-            ob = ob_base.object
+            ob = object_utils.object_data_add(context, mesh, operator=None)
             #engine = context.scene.render.engine what for?
             ob = context.object
             ob.name =  ob.data.name = "PovSuperellipsoid"
@@ -395,9 +394,7 @@ def pov_supertorus_define(context, op, ob):
                                   st_n2)
         mesh = pov_define_mesh(mesh, verts, [], faces, "PovSuperTorus", True)
         if not ob:
-            ob_base = object_utils.object_data_add(context, mesh, operator=None)
-
-            ob = ob_base.object
+            ob = object_utils.object_data_add(context, mesh, operator=None)
             ob.pov.object_as = 'SUPERTORUS'
             ob.pov.st_major_radius = st_R
             ob.pov.st_minor_radius = st_r
@@ -896,8 +893,7 @@ def pov_cone_define(context, op, ob):
 
     mesh = pov_define_mesh(mesh, verts, [], faces, "PovCone", True)
     if not ob:
-        ob_base = object_utils.object_data_add(context, mesh, operator=None)
-        ob = ob_base.object
+        ob = object_utils.object_data_add(context, mesh, operator=None)
         ob.pov.object_as = "CONE"
         ob.pov.cone_base_radius = base
         ob.pov.cone_cap_radius = cap
@@ -1822,8 +1818,7 @@ class ImportPOV(bpy.types.Operator, ImportHelper):
                                     materials.append((int(cache[m0]),int(cache[m1]),int(cache[m2])))
                                     faces.append((int(cache[v0]),int(cache[v1]),int(cache[v2])))
                             #mesh = pov_define_mesh(None, verts, [], faces, name, hide_geometry=False)
-                            #ob_base = object_utils.object_data_add(context, mesh, operator=None)
-                            #ob = ob_base.object
+                            #ob = object_utils.object_data_add(context, mesh, operator=None)
 
                             me = bpy.data.meshes.new(name) ########
                             ob = bpy.data.objects.new(name, me) ##########



More information about the Bf-extensions-cvs mailing list