diff options
author | Willian Padovani Germano <wpgermano@gmail.com> | 2005-04-21 23:44:52 +0400 |
---|---|---|
committer | Willian Padovani Germano <wpgermano@gmail.com> | 2005-04-21 23:44:52 +0400 |
commit | 589ce4a005ce16c5a628cd51819e20623a23c891 (patch) | |
tree | 111a9dc91ad3f1843694d47aaf8eb66c1358820d /release/scripts/bpymodules | |
parent | c5214c15716715cd513e1d2b61433784eb64b617 (diff) |
BPython:
- based on a request by Campbell (he also provided a patch for scene.Layer) access to layers was improved a little, keeping the old method (ob.Layers is a bitmask) and adding the nicer one (ob.layers is a list of ints). Done for objects and scenes. House-cleaning: .Layer was renamed to .Layers (actually just using strncmp instead of strcmp, so both work, same done for Window.ViewLayers).
- finally committing patch by Ken Hughes to let .clearScriptLinks() accept a parameter (list of strings) to clear only specified texts.
- doc updates and fixes (JMS reported a problem in nmesh.transform() example code).
Thanks all who contributed.
Diffstat (limited to 'release/scripts/bpymodules')
-rw-r--r-- | release/scripts/bpymodules/BPyRegistry.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/release/scripts/bpymodules/BPyRegistry.py b/release/scripts/bpymodules/BPyRegistry.py index 33e438be79e..de73cb19a8c 100644 --- a/release/scripts/bpymodules/BPyRegistry.py +++ b/release/scripts/bpymodules/BPyRegistry.py @@ -43,7 +43,7 @@ from Blender import Registry, sys as bsys _EXT = '.cfg' # file extension for saved config data # limits: -MAX_ITEMS_NUM = 50 # max number of keys per dict and itens per list and tuple +MAX_ITEMS_NUM = 60 # max number of keys per dict and itens per list and tuple MAX_STR_LEN = 300 # max string length (remember this is just for config data) _CFG_DIR = '' @@ -61,10 +61,12 @@ if bsys.dirsep == '\\': _KEYS = [k for k in Registry.Keys() if k[0] != '_'] +_ITEMS_NUM = 0 + def _sanitize(o): "Check recursively that all objects are valid, set invalid ones to None" - global MAX_ITEMS_NUM, MAX_STR_LEN + global MAX_ITEMS_NUM, MAX_STR_LEN, _ITEMS_NUM valid_types = [int, float, bool, long, type] valid_checked_types = [str, unicode] @@ -75,12 +77,16 @@ def _sanitize(o): if t == dict: keys = o.keys() - if len(keys) > MAX_ITEMS_NUM: + len_keys = len(keys) + _ITEMS_NUM += len_keys + if _ITEMS_NUM > MAX_ITEMS_NUM: return None for k in keys: o[k] = _sanitize(o[k]) elif t in [list, tuple]: - if len(o) > MAX_ITEMS_NUM: + len_seq = len(o) + _ITEMS_NUM += len_seq + if _ITEMS_NUM > MAX_ITEMS_NUM: return None result = [] for i in o: result.append(_sanitize(i)) |