Browse Source

Leave Local View mode before attempting to Add Mesh objects.

pull/181/head
Joseph Davies 4 years ago
parent
commit
0b0c5242a6
Signed by untrusted user: Deledrius
GPG Key ID: 28ACC6E8D2B24B8A
  1. 17
      korman/operators/op_mesh.py

17
korman/operators/op_mesh.py

@ -140,11 +140,9 @@ class PlasmaAddLadderMeshOperator(PlasmaMeshOperator, bpy.types.Operator):
row.label("Warning: Operator does not work in local view mode", icon="ERROR")
def execute(self, context):
if context.mode == "OBJECT":
self.create_ladder_objects()
else:
self.report({"WARNING"}, "Ladder creation only valid in Object mode")
return {"CANCELLED"}
if context.space_data.local_view:
bpy.ops.view3d.localview()
self.create_ladder_objects()
return {"FINISHED"}
def create_guide_rungs(self):
@ -431,14 +429,11 @@ class PlasmaAddLinkingBookMeshOperator(PlasmaMeshOperator, bpy.types.Operator):
row.label("Warning: Operator does not work in local view mode", icon="ERROR")
def execute(self, context):
if context.mode == "OBJECT":
self.create_linkingbook_objects()
else:
self.report({"WARNING"}, "Linking Book creation only valid in Object mode")
return {"CANCELLED"}
if context.space_data.local_view:
bpy.ops.view3d.localview()
self.create_linkingbook_objects()
return {"FINISHED"}
def create_linkingbook_objects(self):
bpyscene = bpy.context.scene
cursor_shift = mathutils.Matrix.Translation(bpy.context.scene.cursor_location)

Loading…
Cancel
Save