glTF exporter: No texture export when original can't be retrieved
[blender-addons.git] / io_import_dxf / dxfgrabber / defaultchunk.py
blobe953d3ec8e35c5c580f0a8e559ede7b5449824a4
1 # SPDX-License-Identifier: MIT
2 # Copyright 2012 Manfred Moitzi
4 # Purpose: handle default chunk
5 # Created: 21.07.2012, taken from my ezdxf project
6 from __future__ import unicode_literals
7 __author__ = "mozman <mozman@gmx.at>"
9 from .tags import Tags, DXFTag
12 class DefaultChunk(object):
13 def __init__(self, tags):
14 assert isinstance(tags, Tags)
15 self.tags = tags
17 @staticmethod
18 def from_tags(tags, drawing):
19 return DefaultChunk(tags)
21 @property
22 def name(self):
23 return self.tags[1].value.lower()
26 def iterchunks(tagreader, stoptag='EOF', endofchunk='ENDSEC'):
27 while True:
28 tag = next(tagreader)
29 if tag == DXFTag(0, stoptag):
30 return
32 tags = Tags([tag])
33 append = tags.append
34 end_tag = DXFTag(0, endofchunk)
35 while tag != end_tag:
36 tag = next(tagreader)
37 append(tag)
38 yield tags