io_import_dxf: Fix switch scene #104552
@ -16,7 +16,7 @@ except:
|
|||||||
bl_info = {
|
bl_info = {
|
||||||
"name": "Import AutoCAD DXF Format (.dxf)",
|
"name": "Import AutoCAD DXF Format (.dxf)",
|
||||||
"author": "Lukas Treyer, Manfred Moitzi (support + dxfgrabber library), Vladimir Elistratov, Bastien Montagne, Remigiusz Fiedler (AKA migius)",
|
"author": "Lukas Treyer, Manfred Moitzi (support + dxfgrabber library), Vladimir Elistratov, Bastien Montagne, Remigiusz Fiedler (AKA migius)",
|
||||||
"version": (0, 9, 6),
|
"version": (0, 9, 7),
|
||||||
"blender": (2, 80, 0),
|
"blender": (2, 80, 0),
|
||||||
"location": "File > Import > AutoCAD DXF",
|
"location": "File > Import > AutoCAD DXF",
|
||||||
"description": "Import files in the Autocad DXF format (.dxf)",
|
"description": "Import files in the Autocad DXF format (.dxf)",
|
||||||
|
@ -949,7 +949,7 @@ class Do:
|
|||||||
|
|
||||||
# create the block
|
# create the block
|
||||||
if len(block_group.objects) == 0 or name not in self.known_blocks.keys():
|
if len(block_group.objects) == 0 or name not in self.known_blocks.keys():
|
||||||
bpy.context.screen.scene = block_scene
|
bpy.context.window.scene = block_scene
|
||||||
block_inserts = [en for en in entity if is_.insert(en.dxftype)]
|
block_inserts = [en for en in entity if is_.insert(en.dxftype)]
|
||||||
bc = (en for en in entity if is_.combined_entity(en))
|
bc = (en for en in entity if is_.combined_entity(en))
|
||||||
bs = (en for en in entity if is_.separated_entity(en) and not is_.insert(en.dxftype))
|
bs = (en for en in entity if is_.separated_entity(en) and not is_.insert(en.dxftype))
|
||||||
@ -985,7 +985,7 @@ class Do:
|
|||||||
else:
|
else:
|
||||||
bbox = self.known_blocks[name][2]
|
bbox = self.known_blocks[name][2]
|
||||||
|
|
||||||
bpy.context.screen.scene = scene
|
bpy.context.window.scene = scene
|
||||||
o = bbox.copy()
|
o = bbox.copy()
|
||||||
# o.empty_display_size = 0.3
|
# o.empty_display_size = 0.3
|
||||||
o.instance_type = "COLLECTION"
|
o.instance_type = "COLLECTION"
|
||||||
@ -1379,7 +1379,7 @@ class Do:
|
|||||||
return o
|
return o
|
||||||
|
|
||||||
def _recenter(self, scene, name):
|
def _recenter(self, scene, name):
|
||||||
bpy.context.screen.scene = scene
|
bpy.context.window.scene = scene
|
||||||
bpy.context.view_layer.update()
|
bpy.context.view_layer.update()
|
||||||
bpy.ops.object.select_all(action='DESELECT')
|
bpy.ops.object.select_all(action='DESELECT')
|
||||||
|
|
||||||
@ -1621,7 +1621,7 @@ class Do:
|
|||||||
elif self.pScene is not None: # assume Proj
|
elif self.pScene is not None: # assume Proj
|
||||||
scene['SRID'] = re.findall(r"\+init=(.+)\s", self.pScene.srs)[0]
|
scene['SRID'] = re.findall(r"\+init=(.+)\s", self.pScene.srs)[0]
|
||||||
|
|
||||||
#bpy.context.screen.scene = scene
|
#bpy.context.window.scene = scene
|
||||||
|
|
||||||
return self.errors
|
return self.errors
|
||||||
# trying to import dimensions:
|
# trying to import dimensions:
|
||||||
|
Loading…
Reference in New Issue
Block a user