Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSybren A. Stüvel <sybren@stuvel.eu>2016-09-09 13:14:48 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2016-09-14 11:22:01 +0300
commit369e7413402091a1e22c05b743454a0a72351ec6 (patch)
treea7058a7d2caf234a821f7bebd1b365ae4da25eea
parent48b8c9a930afa282294ceb2b810fb22ea7a084e8 (diff)
io_blend_utils: added BlendFileBlock.dna_type_name property
Just to make it easier to get to the name of the DNA type from other Python scripts.
-rw-r--r--io_blend_utils/blend/blendfile.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/io_blend_utils/blend/blendfile.py b/io_blend_utils/blend/blendfile.py
index 516524a1..2e98544a 100644
--- a/io_blend_utils/blend/blendfile.py
+++ b/io_blend_utils/blend/blendfile.py
@@ -297,7 +297,7 @@ class BlendFileBlock:
return ("<%s.%s (%s), size=%d at %s>" %
# fields=[%s]
(self.__class__.__name__,
- self.dna_type.dna_type_id.decode('ascii'),
+ self.dna_type_name,
self.code.decode(),
self.size,
# b", ".join(f.dna_name.name_only for f in self.dna_type.fields).decode('ascii'),
@@ -345,6 +345,10 @@ class BlendFileBlock:
def dna_type(self):
return self.file.structs[self.sdna_index]
+ @property
+ def dna_type_name(self):
+ return self.dna_type.dna_type_id.decode('ascii')
+
def refine_type_from_index(self, sdna_index_next):
assert(type(sdna_index_next) is int)
sdna_index_curr = self.sdna_index