[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [13288] trunk/blender/release/scripts/ import_dxf.py: update with many improvements:

Remigiusz Fiedler migius at 4d-vectors.de
Fri Jan 18 18:03:43 CET 2008


Revision: 13288
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=13288
Author:   migius
Date:     2008-01-18 18:03:43 +0100 (Fri, 18 Jan 2008)

Log Message:
-----------
update with many improvements:
 v1.0.12: 2008.01.17 by migius
 a8 lately used INI-dir/filename persistently stored in Registry
 a8 lately used DXF-dir/filename persistently stored in Registry
 a7 fix missing layersmap{} for dxf-files without "section:layer"
 a6 added support for XREF external referenced BLOCKs
 a6 check for bug in AutoCAD2002:DXFr12export: ELLIPSE->POLYLINE_ARC fault angles
 a6 support VIEWs and VPORTs as cameras: ortho and perspective mode
 a6 save resources through ignoring unused BLOCKs (not-inserted or on frozen/blocked layers)
 a6 added try_finally: f.close() for all IO-files
 a6 added handling for TypeError raise
 a5 bugfix f_getOCS for (0,0,z!=1.0) (ellipse in Kai's dxf)
 a4 added to analyzeTool: report about VIEWs, VPORTs, unused/xref BLOCKs
 a4 bugfix: individual support for 2D/3DPOLYLINE/POLYMESH
 a4 added to UI: (*wip)BLOCK-(F): name filtering for BLOCKs
 a4 added to UI: BLOCK-(n): filter anoname/hatch BLOCKs *X...
 a2 g_scale_as is no more GUI_A-variable
 a2 bugfix "material": negative sign color_index
 a2 added support for BLOCKs defined with origin !=(0,0,0)
 a1 added 'global.reLocation-vector' option

 v1.0.11: 2007.11.24 by migius
 c8 added 'curve_resolution_U' option 
 c8 added context_sensitivity for some UI-buttons
 c8 bugfix ELLIPSE rotation, added closed_variant and caps
 c7 rebuild UI: new layout, grouping and meta-buttons
 c6 rewritten support for ELLIPSE mesh & curve representation
 c6 restore selector-buttons for DXF-drawTypes: LINE & Co
 c6 change header of INI/INF-files: # at begin
 c6 apply scale(1,1,1) after glob.Scale for all mesh objects, not for curve objects.
 c5 fixing 'material_on' option

Modified Paths:
--------------
    trunk/blender/release/scripts/import_dxf.py

Modified: trunk/blender/release/scripts/import_dxf.py
===================================================================
--- trunk/blender/release/scripts/import_dxf.py	2008-01-18 15:10:17 UTC (rev 13287)
+++ trunk/blender/release/scripts/import_dxf.py	2008-01-18 17:03:43 UTC (rev 13288)
@@ -7,72 +7,98 @@
 Tooltip: 'Import for DXF geometry data (Drawing eXchange Format).'
 """
 __author__ = 'Kitsu(Ed Blake) & migius(Remigiusz Fiedler)'
-__version__ = '1.0.11 - 2007.11.17 by migius'
+__version__ = '1.0.12 - 2008.01.17 by migius'
 __url__ = ["http://blenderartists.org/forum/showthread.php?t=84319",
 	 "http://wiki.blender.org/index.php/Scripts/Manual/Import/DXF-3D"]
 __email__ = ["Kitsune_e(at)yahoo.com", "migius(at)4d-vectors.de"]
 __bpydoc__ = """\
-This script imports DXF objects (2d/3d) into Blender.
+This script imports objects from DXF (2d/3d) into Blender.
 
-This script imports 2d and 3d Geometery from DXFr12 format files.
-This version is focused on import of 3d-objects.
+This script imports 2d and 3d geometery from DXFr12 format files.
+Enhanced features are:
+- configurable object filtering and geometry manipulation,
+- configurable material pre-processing,
+- DXF-data analyze and raporting.
 
-Supported DXF Objects:
+Supported DXF r12 objects:
 LINE,
 POINT,
 SOLID,
 TRACE,
 TEXT,
 INSERT (=block),
-MINSERT (=arrays of blocks),
+MINSERT (=array of blocks),
 CIRCLE,
 ARC,
 3DFACE,
 2d-POLYLINE (=plane, incl. arc, variable-width, curve, spline),
-3d-POLYLINE (=non-plane polylines),
+3d-POLYLINE (=non-plane),
 3d-POLYMESH,
-3d-POLYFACE
+3d-POLYFACE,
+VIEW, VPORT
+XREF (External Reference).
 
-under construction, partly supported DXF>r12 Objects:
-LWPOLYLINE (LightWeight), MLINE, MTEXT, ELLIPSE
+Supported DXF>r12 objects:
+ELLIPSE,
+(wip v1.0.12 partly supported) LWPOLYLINE (LightWeight),
+(wip v1.0.12) MLINE,
+(wip v1.0.12) MTEXT
 
-Unsupported DXF Objects:
-DXF r12: DIMENSION, XREF (External Reference),
+Unsupported Objects:
+DXF r12: DIMENSION.
 DXF>r12: SPLINE, GROUP, RAY/XLINE, LEADER, 3DSOLID, BODY, REGION, dynamic BLOCK
 
-Supported Properties:
-Hierarchy: Entire DXF BLOCKs hierarchy is preserved after import into Blender
-visibility, frozen,
-COLOR, LAYER,
-thickness, width,
-(todo: grouped, XDATA)
-It is recommended to use DXF-object properties for coding Blender materials.
+Supported Geometry: 2d and 3d DXF-objects.
+Curves imported as curves or meshes optionally.
 
+Supported layout modes:
+"model space" is default,
+"paper space" as option (= "layout views")
+
+Scene definitions produced with AVE_RENDER:
+scene: selection of lights assigned to the camera,
+lights: DIRECT, OVERHEAD, SH_SPOT,
+(wip v1.0.13 import of AVE_RENDER material definitions)
+
+Hierarchy:
+Entire DXF BLOCK hierarchy is preserved after import into Blender
+(BLOCKs as groups on layer19, INSERTs as dupliGroups on target layer).
+
+Supported properties:
+visibility status,
+frozen status,
+thickness,
+width,
+color,
+layer,
+(wip v1.0.12: XDATA, grouped status)
+It is recommended to use DXF-object properties for assign Blender materials.
+
 Notes:
 - Recommend that you run 'RemoveDoubles' on each imported mesh after using this script
 - Blocks are created on layer 19 then referenced at each insert point.
-- Big DXF-files (over 1500 objects) decrease import performance. The problem is not the inefficiency of python-scripting but Blenders performance in creating new objects in his database - probably a database management problem.
+- Big DXF-files (over 1500 objects) decrease import performance.
+The problem is not the inefficiency of python-scripting but Blenders performance
+in creating new objects in his database - probably a database management problem.
 	
 TODO:  
 - the new style object visibility
 - support for real 3d-solids (ACIS)
-- (to see more, search for "-todo-" in script)
+- (to see more, search for "--todo--" in script code)
 
 """
 
 """
 History:
- v1.0 - 2007.11. by migius: "full 3d"-release
+ v1.0 - 2008.01. by migius
  planned tasks:
  -- command-line-mode/batch-mode
  -- in-place-editing for dupliGroups
- -- filtering of unused/not-inserted BLOCKs
- -- support for MLine
- -- support for Ellipse
- -- support for Mtext
- -- blender_object.ID.properties[dxf_layer_name]
+ -- support for MLINE (is exported to r12 as BLOCK*Unnamed with LINEs)
+ -- support for MTEXT (is exported to r12 as TEXT???)
+ -- blender_object.properties['dxf_layer_name']
  -- better support for long dxf-layer-names 
- -- Configuration files(.ini) should/can handle various material setups
+ -- add configuration file.ini handles multiple material setups
  -- added f_layerFilter
  -- to-check: obj/mat/group/_mapping-idea from ideasman42:
  -- curves: added "fill/non-fill" option for closed curves: CIRCLEs,ELLIPSEs,POLYLINEs
@@ -80,10 +106,42 @@
  -- "normalize Z" option to correct non-planar figures
  -- LINEs need "width" in 3d-space incl vGroups
  -- support width_force for LINEs/ELLIPSEs = "solidify"
- -- bug: dxf-files without layer-section missing layersmap{}
- -- color BYLAYER=256,BYBLOCK=0 
- -- blocknames conventions length
- v1.0.11: 2007.11.17 by migius
+ -- add better support for color_index BYLAYER=256, BYBLOCK=0 
+ -- bug: "oneMesh" produces sometimes errors
+ -- bug: Registry recall from hd_cache ?? only win32 bug??
+
+ v1.0.12: 2008.01.17 by migius
+ -- support DXF-definitions of scene, lights and cameras
+ -- support ortho mode for VIEWs and VPORTs as cameras 
+ a8 lately used INI-dir/filename persistently stored in Registry
+ a8 lately used DXF-dir/filename persistently stored in Registry
+ a7 fix missing layersmap{} for dxf-files without "section:layer"
+ a6 added support for XREF external referenced BLOCKs
+ a6 check for bug in AutoCAD2002:DXFr12export: ELLIPSE->POLYLINE_ARC fault angles
+ a6 support VIEWs and VPORTs as cameras: ortho and perspective mode
+ a6 save resources through ignoring unused BLOCKs (not-inserted or on frozen/blocked layers)
+ a6 added try_finally: f.close() for all IO-files
+ a6 added handling for TypeError raise
+ a5 bugfix f_getOCS for (0,0,z!=1.0) (ellipse in Kai's dxf)
+ a4 added to analyzeTool: report about VIEWs, VPORTs, unused/xref BLOCKs
+ a4 bugfix: individual support for 2D/3DPOLYLINE/POLYMESH
+ a4 added to UI: (*wip)BLOCK-(F): name filtering for BLOCKs
+ a4 added to UI: BLOCK-(n): filter anoname/hatch BLOCKs *X...
+ a2 g_scale_as is no more GUI_A-variable
+ a2 bugfix "material": negative sign color_index
+ a2 added support for BLOCKs defined with origin !=(0,0,0)
+ a1 added 'global.reLocation-vector' option
+
+ v1.0.11: 2007.11.24 by migius
+ c8 added 'curve_resolution_U' option 
+ c8 added context_sensitivity for some UI-buttons
+ c8 bugfix ELLIPSE rotation, added closed_variant and caps
+ c7 rebuild UI: new layout, grouping and meta-buttons
+ c6 rewritten support for ELLIPSE mesh & curve representation
+ c6 restore selector-buttons for DXF-drawTypes: LINE & Co
+ c6 change header of INI/INF-files: # at begin
+ c6 apply scale(1,1,1) after glob.Scale for all mesh objects, not for curve objects.
+ c5 fixing 'material_on' option
  c4 added "analyze DXF-file" UI-option: print LAYER/BLOCK-dependences into a textfile
  c3 human-formating of data in INI-Files
  c2 added "caps" for closed Bezier-curves
@@ -101,17 +159,19 @@
  b2 fixing material assignment by LAYER+COLOR
  b1 fixing Bezier curves representation of POLYLINEs-arc-segments
  b0 added global_scale_presets: "yard/feet/inch to meter"
+
  v1.0.10: 2007.10.18 by migius
  a6 bugfix CircleDrawCaps for OSX 
  a5 added two "curve_res" UI-buttons for Bezier curves representation
  a5 improved Bezier curves representation of circles/arcs: correct handlers
- a4 first try to fix malformed endpoints of Blender curves of imported ARCs and POLYLINE-arc segments. 
- a3 bugfix: open POLYLINEs with end_point.loc==start_point.loc
+ a4 try to fix malformed endpoints of Blender curves of ARC/POLYLINE-arc segments. 
+ a3 bugfix: open-POLYLINEs with end_point.loc==start_point.loc
  a2 bugfix: f_transform for OCS=(0,0,-1) oriented objects
- a1 added "fill_on" option to draw top and bottom sides of CIRCLEs and ELLIPSEs
+ a1 added "fill_on=caps" option to draw top and bottom sides of CIRCLEs and ELLIPSEs
  a1 rewrite f_CIRCLE.Draw: from Mesh.Primitive to Mesh
- a1 bugfix "newScene"-mode: Cylinders/Arcs were drawn at <0,0,0>location
- beta09: 2007.09.02 by migius
+ a1 bugfix "newScene"-mode: all Cylinders/Arcs were drawn at <0,0,0>location
+
+ v1.0.beta09: 2007.09.02 by migius
  g5 redesign UI: grouping of buttons
  g3 update multi-import-mode: <*.*> button
  g- added multi-import-mode: (path/*) for importing many dxf-files at once
@@ -124,7 +184,7 @@
  f- added import POLYLINE-arc-segments into Blender-BezierCurves
  f- added import POLYLINE-Bezier-curves into Blender-Curves
  d5 rewrite: Optimization Levels, added 'directDrawing'
- d4 added: f_set_thick(cntrolled by ini-parameters)
+ d4 added: f_set_thick(controlled by ini-parameters)
  d4 bugfix: face-normals in objects with minus thickness
  d4 added: placeholder'Empty'-size in f_Insert.draw
  d3 rewrite f_Text.Draw: added support for all Text's parameters
@@ -139,23 +199,24 @@
  a- added support for 2d-POLYLINE: splines, fitted curves, fitted surfaces
  a- redesign f_Drawer for block_definitions
  a- rewrite import into Blender-Curve-Object
- beta08: 2007.07.27 by migius
+
+ v1.0.beta08 - 2007.07.27 by migius: "full 3d"-release
  l- bugfix: solid_vgroups, clean:scene.objects.new()
  l- redesign UI to standard Draw.Register+FileSelector, advanced_config_option
  k- bugfix UI:fileSelect() for MacOSX os.listdir()
  k- added reset/save/load for config-data
  k- redesign keywords/drawTypes/Draw.Create_Buttons
- j- new interface using UIBlock() with own FileSelector, cause Window.FileSelector() too buggy
+ j- new UI using UIBlock() with own FileSelector, cause problem Window.FileSelector()
  i- rewritten Class:Settings for better config-parameter management
  h- bugfix: face-normals in objects with minus thickness
- h- added Vertex-Groups in polylines and solids generated Meshes, for easier material assignment
+ h- added Vertex-Groups in POLYLINE and SOLID meshes, for easy material assignment
  h- beautify code, whitespace->tabs
  h- added settings.thic_force switch for forcing thickness
- h- added one Object/Mesh for all simple-entities from the same Layer,
-	sorted in Vertex-Groups(color_name)  (fewer objects = better import performance)

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list