Remove base from addons
This is a follow up to rB0910932e71d2.
This commit is contained in:
parent
678f7523b0
commit
07ec645862
Notes:
blender-bot
2023-02-14 19:19:54 +01:00
Referenced by commit d269e6b9: Fix 'object_fracture_cell' error setting selection & matrix multiply Referenced by commit 3469a7b5: Fix syntax error in07ec6458
Referenced by commitd269e6b9
, Fix 'object_fracture_cell' error setting selection & matrix multiply Referenced by commit3469a7b5
, Fix syntax error in07ec6458
Referenced by issue #61901, Update Crackit addon for Blender 2.8
|
@ -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:
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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) ##########
|
||||
|
|
Loading…
Reference in New Issue