[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15923] branches/blender-2.47: branches/ blender-2.47
Diego Borghetti
bdiego at gmail.com
Sat Aug 2 18:51:12 CEST 2008
Revision: 15923
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15923
Author: bdiego
Date: 2008-08-02 18:51:11 +0200 (Sat, 02 Aug 2008)
Log Message:
-----------
branches/blender-2.47
Merge from trunk:
Revision: 15916
Revision: 15896
Revision: 15132
Modified Paths:
--------------
branches/blender-2.47/release/scripts/bpymodules/colladaImEx/collada.py
branches/blender-2.47/release/scripts/bpymodules/colladaImEx/translator.py
branches/blender-2.47/release/scripts/bpymodules/colladaImEx/xmlUtils.py
branches/blender-2.47/release/scripts/import_dxf.py
branches/blender-2.47/source/blender/src/header_info.c
Modified: branches/blender-2.47/release/scripts/bpymodules/colladaImEx/collada.py
===================================================================
--- branches/blender-2.47/release/scripts/bpymodules/colladaImEx/collada.py 2008-08-02 09:44:01 UTC (rev 15922)
+++ branches/blender-2.47/release/scripts/bpymodules/colladaImEx/collada.py 2008-08-02 16:51:11 UTC (rev 15923)
@@ -1171,6 +1171,7 @@
# Get transforms
xmlUtils.RemoveWhiteSpaceNode(xmlNode)
+ xmlUtils.RemoveComments(xmlNode)
child = xmlNode.firstChild
while child != None:
name = child.localName
Modified: branches/blender-2.47/release/scripts/bpymodules/colladaImEx/translator.py
===================================================================
--- branches/blender-2.47/release/scripts/bpymodules/colladaImEx/translator.py 2008-08-02 09:44:01 UTC (rev 15922)
+++ branches/blender-2.47/release/scripts/bpymodules/colladaImEx/translator.py 2008-08-02 16:51:11 UTC (rev 15923)
@@ -3000,8 +3000,23 @@
alpha = 1 - tkey * (tcol[0]*0.21 + tcol[1]*0.71 + tcol[2]*0.08)
bMat.setAlpha(alpha)
if not (shader.transparent.texture is None): # Texture
- texture = shader.transparent.texture.texture
- if not(texture is None):
+ textureSampler = shader.transparent.texture.texture
+ print "shader"
+ print shader.transparent.texture
+ print "shader end"
+ if not(textureSampler is None):
+ #support 1.4.0:
+ texture = textureSampler;
+
+ #support 1.4.1
+ for newParam in daeEffect.profileCommon.newParams:
+ if newParam.sid == textureSampler:
+ surfaceID = newParam.sampler.source
+ for newSurface in daeEffect.profileCommon.newParams:
+ if newSurface.sid == surfaceID:
+ texture = newSurface.surface.initfrom
+
+ texture = self.document.colladaDocument.imagesLibrary.FindObject(texture)
bTexture = self.document.texturesLibrary.FindObject(texture, True)
if not bTexture is None:
bMat.setTexture(0, bTexture, Blender.Texture.TexCo.UV, Blender.Texture.MapTo.ALPHA)
@@ -3021,18 +3036,18 @@
color = shader.diffuse.color.rgba
bMat.setRGBCol(color[0],color[1], color[2])
if not (shader.diffuse.texture is None): # Texture
- textureSampler = shader.diffuse.texture.texture;
+ textureSampler = shader.diffuse.texture.texture
if not (textureSampler is None):
#support 1.4.0:
- texture = textureSampler;
+ texture = textureSampler
#support 1.4.1
for newParam in daeEffect.profileCommon.newParams:
if newParam.sid == textureSampler:
- surfaceID = newParam.sampler.source;
+ surfaceID = newParam.sampler.source
for newSurface in daeEffect.profileCommon.newParams:
if newSurface.sid == surfaceID:
- texture = newSurface.surface.initfrom;
+ texture = newSurface.surface.initfrom
texture = self.document.colladaDocument.imagesLibrary.FindObject(texture)
bTexture = self.document.texturesLibrary.FindObject(texture, True)
@@ -3457,4 +3472,4 @@
# Add this mesh in this library, under it's real name
self.objects[controllerID] = [bMesh, bMesh.name]
- return bMesh
\ No newline at end of file
+ return bMesh
Modified: branches/blender-2.47/release/scripts/bpymodules/colladaImEx/xmlUtils.py
===================================================================
--- branches/blender-2.47/release/scripts/bpymodules/colladaImEx/xmlUtils.py 2008-08-02 09:44:01 UTC (rev 15922)
+++ branches/blender-2.47/release/scripts/bpymodules/colladaImEx/xmlUtils.py 2008-08-02 16:51:11 UTC (rev 15923)
@@ -79,6 +79,12 @@
if child.nodeType == child.TEXT_NODE and child.data.strip()=='':
parent.removeChild(child)
return parent
+
+def RemoveComments(parent):
+ for child in list(parent.childNodes):
+ if child.__class__.__name__ == "Comment":
+ parent.removeChild(child)
+ return parent
##def RemoveWhiteSpace(node):
## removeList = []
@@ -172,3 +178,5 @@
return xmlNode
+
+
Modified: branches/blender-2.47/release/scripts/import_dxf.py
===================================================================
--- branches/blender-2.47/release/scripts/import_dxf.py 2008-08-02 09:44:01 UTC (rev 15922)
+++ branches/blender-2.47/release/scripts/import_dxf.py 2008-08-02 16:51:11 UTC (rev 15923)
@@ -1,5 +1,5 @@
#!BPY
-# coding: utf-8
+
"""
Name: 'Autodesk DXF (.dxf)'
Blender: 244
@@ -7,14 +7,15 @@
Tooltip: 'Import for DXF geometry data (Drawing eXchange Format).'
"""
__author__ = 'Kitsu(Ed Blake) & migius(Remigiusz Fiedler)'
-__version__ = '1.0.12 - 2008.02.08 by migius'
+__version__ = '1.0.12 - 2008.06.05 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 objects from DXF (2d/3d) into Blender.
-This script imports 2d and 3d geometery from DXFr12 format files.
+This script imports 2d and 3d geometery from DXF files.
+Supported DXF format versions: from (r2.5) r12 up to 2008.
Enhanced features are:
- configurable object filtering and geometry manipulation,
- configurable material pre-processing,
@@ -40,22 +41,23 @@
Supported DXF>r12 objects:
ELLIPSE,
-(wip v1.0.12 partly supported) LWPOLYLINE (LightWeight),
-(wip v1.0.12) MLINE,
-(wip v1.0.12) MTEXT
+LWPOLYLINE (LightWeight Polylines),
+(wip v1.0.12) SPLINE,
+(wip v1.0.13) MLINE,
+(wip v1.0.13) MTEXT
-Unsupported Objects:
+Unsupported objects:
DXF r12: DIMENSION.
-DXF>r12: SPLINE, GROUP, RAY/XLINE, LEADER, 3DSOLID, BODY, REGION, dynamic BLOCK
+DXF>r12: GROUP, RAY/XLINE, LEADER, 3DSOLID, BODY, REGION, dynamic BLOCK
-Supported Geometry: 2d and 3d DXF-objects.
-Curves imported as curves or meshes optionally.
+Supported geometry: 2d and 3d DXF-objects.
+Curves imported as Blender curves or meshes optionally.
Supported layout modes:
"model space" is default,
"paper space" as option (= "layout views")
-Scene definitions produced with AVE_RENDER:
+Supported scene definition objescts 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)
@@ -77,14 +79,10 @@
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.
+- support for DXF-files up to 160MB on systems with 1GB RAM
+- DXF-files with 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 code)
+in creating new objects in scene database - probably a database management problem.
"""
@@ -92,6 +90,7 @@
History:
v1.0 - 2008.01. by migius
planned tasks:
+ -- (to see more, search for "--todo--" in script code)
-- command-line-mode/batch-mode
-- in-place-editing for dupliGroups
-- support for MLINE (is exported to r12 as BLOCK*Unnamed with LINEs)
@@ -102,17 +101,23 @@
-- added f_layerFilter
-- to-check: obj/mat/group/_mapping-idea from ideasman42:
-- curves: added "fill/non-fill" option for closed curves: CIRCLEs,ELLIPSEs,POLYLINEs
- -- bug:? object = Object.Get(obname) -> = SCENE.getChildren(obname)
-- "normalize Z" option to correct non-planar figures
-- LINEs need "width" in 3d-space incl vGroups
-- support width_force for LINEs/ELLIPSEs = "solidify"
-- add better support for color_index BYLAYER=256, BYBLOCK=0
- -- bug: "oneMesh" produces sometimes errors
+ -- bug: "oneMesh" produces irregularly errors
-- bug: Registry recall from hd_cache ?? only win32 bug??
+ -- support DXF-definitions of scene, lights and cameras
+ -- support ortho mode for VIEWs and VPORTs as cameras
+ -- add support for SPLINEs
+ v1.0.12: 2008.06.05 by migius
+ b3 bugfix: ob.name conflict with existing meshes (different ob.name/mesh.name)
+ v1.0.12: 2008.05.24 by migius
+ b2 added support for LWPOLYLINEs
+ b2 added support for ProE in readerDXF.py
v1.0.12: 2008.02.08 by migius
- -- support DXF-definitions of scene, lights and cameras
- -- support ortho mode for VIEWs and VPORTs as cameras
+ b1 update: object = Object.Get(obname) -> f_getSceChild().getChildren()
a9 bugfix by non-existing tables views, vports, layers (Kai reported)
v1.0.12: 2008.01.17 by migius
a8 lately used INI-dir/filename persistently stored in Registry
@@ -279,9 +284,9 @@
# --------------------------------------------------------------------------
import Blender
-#import bpy
from Blender import *
#from Blender.Mathutils import Vector, Matrix
+import bpy
#import BPyMessages
from dxfReader import readDXF
@@ -313,6 +318,8 @@
WORLDY = Mathutils.Vector((1,1,0))
WORLDZ = Mathutils.Vector((0,0,1))
+oblist = [] #to be sure, it is an empty list
+
G_SCALE = 1.0 #(0.0001-1000) global scaling factor for all dxf data
G_ORIGIN_X = 0.0 #global translation-vector (x,y,z) in DXF units
G_ORIGIN_Y = 0.0
@@ -330,6 +337,10 @@
TARGET_LAYER = 3 #target blender_layer
GROUP_BYLAYER = 0 #(0/1) all entities from same layer import into one blender-group
+cur_COUNTER = 0 #counter for progress_bar
+M_OBJ = False
+BYBLOCK = 0
+BYLAYER = 256
FILENAME_MAX = 180 #max length of path+file_name string (FILE_MAXDIR + FILE_MAXFILE)
MAX_NAMELENGTH = 17 #max_effective_obnamelength in blender =21=17+(.001)
@@ -342,77 +353,8 @@
FREE = BezTriple.HandleTypes.FREE
VECT = BezTriple.HandleTypes.VECT
ALIGN = BezTriple.HandleTypes.ALIGN
-cur_COUNTER = 0 #counter for progress_bar
-"""This module provides wrapper objects for dxf entities.
-
- The wrappers expect a "dxf object" as input. The dxf object is
- an object with a type and a data attribute. Type is a lowercase
- string matching the 0 code of a dxf entity. Data is a list containing
- dxf objects or lists of [code, data] pairs.
-
- This module is not general, and is only for dxf import.
-"""
-
-# from Stani's dxf writer v1.1 (c)www.stani.be (GPL)
-#---color values
-BYBLOCK = 0
-BYLAYER = 256
-
-#---block-type flags (bit coded values, may be combined):
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list