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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-12-13 13:46:24 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-12-13 13:46:24 +0400
commit15634fd22e28e95f9d2905a29d4cc34fdb613e7c (patch)
treebfbda8e62b863b0978b2e8741f99f86c07fa083f /release/scripts/modules/rna_xml.py
parent223cb8c94a332141ab3a97bf02c25470fa932070 (diff)
fix for sequence size mismatch when loading themes, addition of alpha channel caused themes not to load.
Diffstat (limited to 'release/scripts/modules/rna_xml.py')
-rw-r--r--release/scripts/modules/rna_xml.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/release/scripts/modules/rna_xml.py b/release/scripts/modules/rna_xml.py
index e21ccd08a35..08b60ebc6f8 100644
--- a/release/scripts/modules/rna_xml.py
+++ b/release/scripts/modules/rna_xml.py
@@ -265,7 +265,15 @@ def xml2rna(root_xml,
tp_name = 'ARRAY'
# print(" %s.%s (%s) --- %s" % (type(value).__name__, attr, tp_name, subvalue_type))
- setattr(value, attr, value_xml_coerce)
+ try:
+ setattr(value, attr, value_xml_coerce)
+ except ValueError:
+ # size mismatch
+ val = getattr(value, attr)
+ if len(val) < len(value_xml_coerce):
+ setattr(value, attr, value_xml_coerce[:len(val)])
+ else:
+ setattr(value, attr, list(value_xml_coerce) + list(val)[len(value_xml_coerce):])
# ---------------------------------------------------------------------
# Complex attributes