minor update rna namer and script to automatically apply updates from blender to rna_properties.txt
This commit is contained in:
parent
f80f412701
commit
a34721d24b
@ -120,8 +120,11 @@ def get_props_from_txt(input_filename):
|
||||
#print(line)
|
||||
|
||||
# empty line or comment
|
||||
if not line.strip() or line.startswith('#'):
|
||||
if not line.strip():
|
||||
continue
|
||||
|
||||
if line.startswith("#"):
|
||||
line = line[1:]
|
||||
|
||||
# class
|
||||
[bclass, tail] = [x.strip() for x in line.split('.', 1)]
|
||||
@ -185,6 +188,7 @@ def get_props_from_py(input_filename):
|
||||
kwcheck = check_prefix(bto, btype) # keyword-check
|
||||
changed = check_if_changed(bfrom, bto) # changed?
|
||||
description = repr(description)
|
||||
description = description.replace("'", "").replace('"', "").replace("\\", "").strip()
|
||||
rna_api[index] = [comment, changed, bclass, bfrom, bto, kwcheck, btype, description]
|
||||
props_length = list(map(len,props)) # lengths
|
||||
props_length_max = list(map(max,zip(props_length_max,props_length))) # max lengths
|
||||
@ -254,11 +258,9 @@ def write_files(basename, props_list, props_length_max):
|
||||
for props in props_list:
|
||||
#txt
|
||||
|
||||
# FOR PY OUTPUT!
|
||||
'''
|
||||
# quick way we can tell if it changed
|
||||
if props[3] == props[4]: txt += "#"
|
||||
else: txt += " "
|
||||
'''
|
||||
|
||||
if props[0] != '': txt += '%s * ' % props[0] # comment
|
||||
txt += '%s.%s -> %s: %s "%s"\n' % tuple(props[2:5] + props[6:]) # skipping keyword-check
|
||||
|
File diff suppressed because it is too large
Load Diff
11
source/blender/makesrna/rna_cleanup/rna_update.sh
Executable file
11
source/blender/makesrna/rna_cleanup/rna_update.sh
Executable file
@ -0,0 +1,11 @@
|
||||
cd ../../../../
|
||||
./blender.bin --background --python ./release/scripts/modules/rna_info.py 2> source/blender/makesrna/rna_cleanup/out.txt
|
||||
cd ./source/blender/makesrna/rna_cleanup/
|
||||
./rna_cleaner.py out.txt
|
||||
./rna_cleaner.py rna_properties.txt
|
||||
./rna_cleaner_merge.py out_work.py rna_properties_work.py
|
||||
./rna_cleaner.py out_work_merged.py
|
||||
./rna_cleaner.py out_work_lost.py
|
||||
mv out_work_merged_work.txt rna_properties_new.txt
|
||||
mv out_work_lost_work.txt rna_properties_lost.txt
|
||||
echo "Updated: rna_properties_new.txt rna_properties_lost.txt"
|
Loading…
Reference in New Issue
Block a user