Created
August 15, 2014 18:08
-
-
Save pcote/01c9703e72abdbaccca2 to your computer and use it in GitHub Desktop.
Makes a dictionary of names with respect to submodules for Operators Within Blender
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
import _bpy | |
from collections import defaultdict | |
def make_operator_dict(): | |
submod_op_pairs = [entry.split("_OT_") for entry in _bpy.ops.dir()] | |
submod_op_pairs = [(k.lower(), v) for k,v in submod_op_pairs] | |
op_dict = defaultdict(list) | |
for key, val in submod_op_pairs: | |
op_dict[key].append(val) | |
return op_dict | |
if __name__ =='__main__': | |
op_dict = make_operator_dict() | |
for key in op_dict: | |
print("\n\n%s...... %d operators" % (key, len(op_dict[key]))) | |
print(op_dict[key]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment