forked from bartvdbraak/blender
include rna parent class names in renaming list
This commit is contained in:
parent
15669532a2
commit
41531e4fb6
@ -625,18 +625,23 @@ def BuildRNAInfo():
|
|||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
import rna_info
|
import rna_info
|
||||||
struct = rna_info.BuildRNAInfo()[0]
|
struct = rna_info.BuildRNAInfo()[0]
|
||||||
data = ""
|
data = []
|
||||||
for struct_id, v in sorted(struct.items()):
|
for struct_id, v in sorted(struct.items()):
|
||||||
struct_id_str = "".join(sid for sid in struct_id if struct_id)
|
struct_id_str = v.identifier # "".join(sid for sid in struct_id if struct_id)
|
||||||
props = [(prop.identifier, prop) for prop in v.properties]
|
|
||||||
|
|
||||||
|
for base in v.get_bases():
|
||||||
|
struct_id_str = base.identifier + "|" + struct_id_str
|
||||||
|
|
||||||
|
props = [(prop.identifier, prop) for prop in v.properties]
|
||||||
for prop_id, prop in sorted(props):
|
for prop_id, prop in sorted(props):
|
||||||
# if prop.type == 'boolean':
|
# if prop.type == 'boolean':
|
||||||
# continue
|
# continue
|
||||||
data += "%s.%s -> %s: %s%s %s\n" % (struct_id_str, prop.identifier, prop.identifier, prop.type, ", (read-only)" if prop.is_readonly else "", prop.description)
|
data.append("%s.%s -> %s: %s%s %s" % (struct_id_str, prop.identifier, prop.identifier, prop.type, ", (read-only)" if prop.is_readonly else "", prop.description))
|
||||||
|
data.sort()
|
||||||
|
|
||||||
if bpy.app.background:
|
if bpy.app.background:
|
||||||
print(data)
|
import sys
|
||||||
|
sys.stderr.write("\n".join(data))
|
||||||
else:
|
else:
|
||||||
text = bpy.data.texts.new(name="api.py")
|
text = bpy.data.texts.new(name="api.py")
|
||||||
text.from_string(data)
|
text.from_string(data)
|
||||||
|
@ -9,7 +9,7 @@ Example usage:
|
|||||||
def main():
|
def main():
|
||||||
|
|
||||||
def work_line_id(line):
|
def work_line_id(line):
|
||||||
return line[2], line[3] # class/from
|
return line[2].split("|")[-1], line[3] # class/from
|
||||||
|
|
||||||
|
|
||||||
if not (sys.argv[-1].endswith(".py") and sys.argv[-2].endswith(".py")):
|
if not (sys.argv[-1].endswith(".py") and sys.argv[-2].endswith(".py")):
|
||||||
@ -32,6 +32,12 @@ def main():
|
|||||||
# print("not found", key)
|
# print("not found", key)
|
||||||
val = val_orig
|
val = val_orig
|
||||||
|
|
||||||
|
# always take the class from the base
|
||||||
|
val = list(val)
|
||||||
|
val[2] = val_orig[2]
|
||||||
|
print(val_orig[2])
|
||||||
|
val = tuple(val)
|
||||||
|
|
||||||
rna_api_new.append(val)
|
rna_api_new.append(val)
|
||||||
|
|
||||||
def write_work_file(file_path, rna_api):
|
def write_work_file(file_path, rna_api):
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user