~ubuntu-branches/ubuntu/saucy/blender/saucy-proposed

« back to all changes in this revision

Viewing changes to release/scripts/addons/io_export_dxf/primitive_exporters/viewborder_exporter.py

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2013-03-06 12:08:47 UTC
  • mfrom: (1.5.1) (14.1.8 experimental)
  • Revision ID: package-import@ubuntu.com-20130306120847-frjfaryb2zrotwcg
Tags: 2.66a-1ubuntu1
* Resynchronize with Debian (LP: #1076930, #1089256, #1052743, #999024,
  #1122888, #1147084)
* debian/control:
  - Lower build-depends on libavcodec-dev since we're not
    doing the libav9 transition in Ubuntu yet

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
from base_exporter import BasePrimitiveDXFExporter
 
2
 
 
3
 
 
4
class ViewBorderDXFExporter(BasePrimitiveDXFExporter):
 
5
 
 
6
    def export(self, ob, mx, mw, **common):
 
7
        """converts Lamp-Object to desired projection and representation(DXF-Entity type)
 
8
        """
 
9
        identity_matrix = mathutils.Matrix().identity()
 
10
        points = projected_co(border, identity_matrix)
 
11
        closed = 1
 
12
        points = toGlobalOrigin(points)
 
13
        c = settings['curve_as']
 
14
        if c=="LINEs": # export Curve as multiple LINEs
 
15
            for i in range(len(points)-1):
 
16
                linepoints = [points[i], points[i+1]]
 
17
                dxfLINE = DXF.Line(linepoints,paperspace=espace,color=LAYERCOLOR_DEF)
 
18
                entities.append(dxfLINE)
 
19
        else:
 
20
            fag70, flag75 = closed, 0
 
21
            dxfPOLYFACE = DXF.PolyLine([allpoints, faces], flag70=flag70, flag75=flag70, width=0.0, paperspace=espace, color=LAYERCOLOR_DEF)
 
22
            #dxfPLINE = DXF.PolyLine(points,points[0],[closed,0,0], paperspace=espace, color=LAYERCOLOR_DEF)
 
23
            d.append(dxfPLINE)
 
24