misc py/rna changes
- running a script from a file now uses the PyRun_File(FILE *, ...) rather then PyRun_String("exec(open(r'/somepath.py').read())"...), aparently FILE struct on windows could not ensured to be the same between blender and python, since we use our own python on windows now it should be ok.
- generating docs works again (operator update for py style syntax broke them)
- python operator doc strings was being overwritten
- added rna property attribute "default" to get the default value of a property, not working on arrays currently because variable length arrays are not supported.
This commit is contained in:
@@ -503,20 +503,21 @@ def rna2epy(target_path):
|
||||
def op2epy(target_path):
|
||||
out = open(target_path, 'w')
|
||||
|
||||
operators = dir(bpy.ops)
|
||||
operators.remove('add')
|
||||
operators.remove('remove')
|
||||
operators.sort()
|
||||
op_mods = dir(bpy.ops)
|
||||
op_mods.remove('add')
|
||||
op_mods.remove('remove')
|
||||
|
||||
for op in operators:
|
||||
|
||||
if op.startswith('__'):
|
||||
for op_mod_name in sorted(op_mods):
|
||||
if op_mod_name.startswith('__'):
|
||||
continue
|
||||
|
||||
op_mod = getattr(bpy.ops, op_mod_name)
|
||||
|
||||
# rna = getattr(bpy.types, op).__rna__
|
||||
rna = bpy.ops.__rna__(op)
|
||||
|
||||
write_func(rna, '', out, 'OPERATOR')
|
||||
operators = dir(op_mod)
|
||||
for op in sorted(operators):
|
||||
# rna = getattr(bpy.types, op).__rna__
|
||||
rna = getattr(op_mod, op).get_rna()
|
||||
write_func(rna, '', out, 'OPERATOR')
|
||||
|
||||
out.write('\n')
|
||||
out.close()
|
||||
|
||||
Reference in New Issue
Block a user