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>2010-08-09 10:55:20 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-08-09 10:55:20 +0400
commit8d517cff3395102367a75a854e3568a1786542c6 (patch)
tree5fc80360529da8468eac16faca8c7488aff88cbe /source/blender/makesrna/rna_cleanup/rna_cleaner.py
parent9581cf1bdd561ae99688f6915ff9c7f22ae76741 (diff)
rna refactor...
- added a script to merge 2 lists of rna renaming from/to - merged rna_booleans.txt into rna_properties.txt - made rna_cleaner.py sort by class.from by default.
Diffstat (limited to 'source/blender/makesrna/rna_cleanup/rna_cleaner.py')
-rwxr-xr-xsource/blender/makesrna/rna_cleanup/rna_cleaner.py18
1 files changed, 12 insertions, 6 deletions
diff --git a/source/blender/makesrna/rna_cleanup/rna_cleaner.py b/source/blender/makesrna/rna_cleanup/rna_cleaner.py
index a0ce76d261d..a2909923388 100755
--- a/source/blender/makesrna/rna_cleanup/rna_cleaner.py
+++ b/source/blender/makesrna/rna_cleanup/rna_cleaner.py
@@ -6,6 +6,9 @@ This script is used to help cleaning RNA api.
Typical line in the input file (elements in [] are optional).
[comment *] ToolSettings.snap_align_rotation -> use_snap_align_rotation: boolean [Align rotation with the snapping target]
+
+Geterate output format from blender run this:
+ ./blender.bin --background --python ./release/scripts/modules/rna_info.py > source/blender/makesrna/rna_cleanup/out.txt
"""
@@ -189,11 +192,14 @@ def sort(props_list, sort_priority):
"""
# order based on the i-th element in lists
- i = sort_choices.index(sort_priority)
- if i == 0:
- props_list = sorted(props_list, key=lambda p: p[i], reverse=True)
+ if sort_priority == "class.from":
+ props_list = sorted(props_list, key=lambda p: (p[2], p[3]))
else:
- props_list = sorted(props_list, key=lambda p: p[i])
+ i = sort_choices.index(sort_priority)
+ if i == 0:
+ props_list = sorted(props_list, key=lambda p: p[i], reverse=True)
+ else:
+ props_list = sorted(props_list, key=lambda p: p[i])
print ('\nSorted by %s.' % font_bold(sort_priority))
return props_list
@@ -266,8 +272,8 @@ def main():
global sort_choices, default_sort_choice
global kw_prefixes, kw
- sort_choices = ['note','changed','class','from','to','kw']
- default_sort_choice = sort_choices[0]
+ sort_choices = ['note','changed','class','from','to','kw', 'class.from']
+ default_sort_choice = sort_choices[-1]
kw_prefixes = [ 'active','apply','bl','exclude','has','invert','is','lock', \
'pressed','show','show_only','use','use_only','layers','states']
kw = ['active','hide','invert','select','layers','mute','states','use','lock']