~diresu/blender/blender-command-port

« back to all changes in this revision

Viewing changes to release/scripts/import_dxf.py

  • Committer: Dietrich Bollmann
  • Date: 2009-07-26 14:27:44 UTC
  • mfrom: (184.1.1008)
  • Revision ID: dietrich@formgames.org-20090726142744-75hivjratygfz7q3
Update to state of blender repository from 2009-07-26 revision 21911 (launchpad: 1192).

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
Tooltip: 'Import for DWG/DXF geometry data.'
8
8
"""
9
9
__author__ = 'Kitsu(Ed Blake) & migius(Remigiusz Fiedler)'
10
 
__version__ = '1.12 - 2009.05.27 by migius'
 
10
__version__ = '1.12 - 2009.06.16 by migius'
11
11
__url__ = ["http://blenderartists.org/forum/showthread.php?t=84319",
12
12
         "http://wiki.blender.org/index.php/Scripts/Manual/Import/DXF-3D"]
13
13
__email__ = ["migius(at)4d-vectors.de","Kitsune_e(at)yahoo.com"]
100
100
 -- better support for long dxf-layer-names 
101
101
 -- add configuration file.ini handles multiple material setups
102
102
 -- added f_layerFilter
103
 
 -- to-check: obj/mat/group/_mapping-idea from ideasman42:
 
103
 -- to-check: obj/mat/group/_mapping-idea from ideasman42
104
104
 -- curves: added "fill/non-fill" option for closed curves: CIRCLEs,ELLIPSEs,POLYLINEs
105
105
 -- "normalize Z" option to correct non-planar figures
106
106
 -- LINEs need "width" in 3d-space incl vGroups
108
108
 -- add better support for color_index BYLAYER=256, BYBLOCK=0 
109
109
 -- bug: "oneMesh" produces irregularly errors
110
110
 -- bug: Registry recall from hd_cache ?? only win32 bug??
111
 
 -- support DXF-definitions of scene, lights and cameras
 
111
 -- support DXF-definitions of autoshade: scene, lights and cameras
112
112
 -- support ortho mode for VIEWs and VPORTs as cameras 
113
113
 
 
114
 v1.12 - 2009.06.16 by migius
 
115
 d7 fix for ignored BLOCKs (e.g. *X) which are members of other BLOCKs
114
116
 v1.12 - 2009.05.27 by migius
115
 
 d6 todo: bugfix negative scaled INSERTs - isLeftHand(Matrix) check
 
117
 d6 bugfix negative scaled INSERTs - isLeftHand(Matrix) check
116
118
 v1.12 - 2009.05.26 by migius
117
119
 d5 changed to the new 2.49 method Vector.cross()
118
120
 d5 bugfix WORLDY(1,1,0) to (0,1,0)
161
163
 a4 added to analyzeTool: report about VIEWs, VPORTs, unused/xref BLOCKs
162
164
 a4 bugfix: individual support for 2D/3DPOLYLINE/POLYMESH
163
165
 a4 added to UI: (*wip)BLOCK-(F): name filtering for BLOCKs
164
 
 a4 added to UI: BLOCK-(n): filter anoname/hatch BLOCKs *X...
 
166
 a4 added to UI: BLOCK-(n): filter noname/hatch BLOCKs *X...
165
167
 a2 g_scale_as is no more GUI_A-variable
166
168
 a2 bugfix "material": negative sign color_index
167
169
 a2 added support for BLOCKs defined with origin !=(0,0,0)
4520
4522
                                        item2str = [item2.name, item2.layer]
4521
4523
                                        childList.append(item2str)
4522
4524
                        try: usedblocks[item.name] = [used, childList]
4523
 
                        except KeyError: print 'Cannot map "%s" - "%s" as Block!' %(item.name, item)
 
4525
                        except KeyError: print 'Cannot find "%s" Block!' %(item.name)
4524
4526
        #print 'deb:getBlocksmap: usedblocks=' , usedblocks #-------------
4525
4527
        #print 'deb:getBlocksmap:  layersmap=' , layersmap #-------------
4526
4528
 
4528
4530
                if type(item) != list and item.type == 'insert':
4529
4531
                        if not layersmap or (not layersmap[item.layer].frozen or layFrozen_on): #if insert_layer is not frozen
4530
4532
                                try: usedblocks[item.name][0] = True 
4531
 
                                except: pass
 
4533
                                except KeyError: print 'Cannot find "%s" Block!' %(item.name)
4532
4534
                                
4533
4535
        key_list = usedblocks.keys()
4534
4536
        key_list.reverse()
4536
4538
                if usedblocks[key][0]: #if parent used, then set used also all child blocks
4537
4539
                        for child in usedblocks[key][1]:
4538
4540
                                if not layersmap or (layersmap and not layersmap[child[1]].frozen): #if insert_layer is not frozen
4539
 
                                        usedblocks[child[0]][0] = True # marked as used BLOCK
 
4541
                                        try: usedblocks[child[0]][0] = True # marked as used BLOCK
 
4542
                                        except KeyError: print 'Cannot find "%s" Block!' %(child[0])
4540
4543
 
4541
4544
        usedblocks = [i for i in usedblocks.keys() if usedblocks[i][0]]
4542
4545
        #print 'deb:getBlocksmap: usedblocks=' , usedblocks #-------------