2 from keyingsets_utils import *
5 class BUILTIN_KSI_hello(bpy.types.KeyingSetInfo):
6 bl_label = "Hello World KeyingSet"
8 # poll - test for whether Keying Set can be used at all
9 def poll(ksi, context):
10 return (context.active_object) or (context.selected_objects)
12 # iterator - go over all relevant data, calling generate()
13 def iterator(ksi, context, ks):
14 for ob in context.selected_objects:
15 ksi.generate(context, ks, ob)
17 # generator - populate Keying Set with property paths to use
18 def generate(ksi, context, ks, data):
19 id_block = data.id_data
21 ks.paths.add(id_block, "location")
24 ks.paths.add(id_block, "layers", i, group_method='NAMED', group_name="5x Hello Layers")
26 ks.paths.add(id_block, "show_x_ray", group_method='NONE')
30 bpy.utils.register_class(BUILTIN_KSI_hello)
34 bpy.utils.unregister_class(BUILTIN_KSI_hello)
37 if __name__ == '__main__':