Reputation: 22332
If you look at the following line of python code:
bpy.ops.object.particle_system_add({"object":bpy.data.objects[2]})
you see that in the parameters there is something enclosed in braces. Can anyone tell me what the braces are for (generically anyway)? I haven't really seen this type of syntax in python and I can't find any documentation on it.
Any help is greatly appreciated. Thank you.
Upvotes: 1
Views: 226
Reputation: 344291
Dictionaries can be created by placing a comma-separated list of key: value pairs within braces, for example:
{'jack': 4098, 'sjoerd': 4127}
or{4098: 'jack', 4127: 'sjoerd'}
, or by thedict
constructor.
Upvotes: 6
Reputation: 16265
It's just a dictionary with a single key/value pair of "object" as the key and whatever bpy.data.objects[2] evaluates to as the value.
Upvotes: 1
Reputation: 375554
The braces create a dictionary. particle_system_add
seems to be accepting a dictionary as its argument.
Upvotes: 2