Python API: add bpy.context.property, for property under the mouse cursor
This can be useful for example to add custom operators to the property context menu. Pull Request: https://projects.blender.org/blender/blender/pulls/107280
This commit is contained in:
committed by
Brecht Van Lommel
parent
ea937b304d
commit
6ba0346797
@@ -1202,6 +1202,7 @@ context_type_map = {
|
||||
"particle_settings": ("ParticleSettings", False),
|
||||
"particle_system": ("ParticleSystem", False),
|
||||
"particle_system_editable": ("ParticleSystem", False),
|
||||
"property": ("(:class:`bpy.types.ID`, :class:`string`, :class:`int`)", False),
|
||||
"pointcloud": ("PointCloud", False),
|
||||
"pose_bone": ("PoseBone", False),
|
||||
"pose_object": ("Object", False),
|
||||
@@ -1347,7 +1348,11 @@ def pycontext2sphinx(basepath):
|
||||
raise SystemExit(
|
||||
"Error: context key %r not found in context_type_map; update %s" %
|
||||
(member, __file__)) from None
|
||||
fw(" :type: %s :class:`bpy.types.%s`\n\n" % ("sequence of " if is_seq else "", member_type))
|
||||
|
||||
if member_type.isidentifier():
|
||||
member_type = ":class:`bpy.types.%s`" % member_type
|
||||
fw(" :type: %s %s\n\n" % ("sequence of " if is_seq else "", member_type))
|
||||
write_example_ref(" ", fw, "bpy.context." + member)
|
||||
|
||||
# Generate type-map:
|
||||
# for member in sorted(unique_context_strings):
|
||||
|
||||
Reference in New Issue
Block a user