2 from keyingsets_utils import *
4 class BUILTIN_KSI_hello(bpy.types.KeyingSetInfo):
5 bl_label = "Hello World KeyingSet"
7 # poll - test for whether Keying Set can be used at all
8 def poll(ksi, context):
9 return (context.active_object) or (context.selected_objects)
11 # iterator - go over all relevant data, calling generate()
12 def iterator(ksi, context, ks):
13 for ob in context.selected_objects:
14 ksi.generate(context, ks, ob)
16 # generator - populate Keying Set with property paths to use
17 def generate(ksi, context, ks, data):
18 id_block = data.id_data
20 ks.paths.add(id_block, "location")
23 ks.paths.add(id_block, "layers", i, group_method='NAMED', group_name="5x Hello Layers")
25 ks.paths.add(id_block, "show_x_ray", group_method='NONE')
28 bpy.types.register(BUILTIN_KSI_hello)