import bpy
def get_property_name(data, property) -> str:
''' Get the name of a property.
data (AnyType) - Data from which to take property.
property (str) - Identifier of property in data.
return (str) - The name of the property.
'''
return data.rna_type.properties[property].name if hasattr(data, property) else ''
name = get_property_name(bpy.context.object.rigid_body, 'friction')
print(name)
Karan
- 2.7k
- 6
- 25