Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/modules/rna_info.py
| Show First 20 Lines • Show All 77 Lines • ▼ Show 20 Lines | |||||
| def float_as_string(f): | def float_as_string(f): | ||||
| val_str = "%g" % f | val_str = "%g" % f | ||||
| if '.' not in val_str and '-' not in val_str: # value could be 1e-05 | if '.' not in val_str and '-' not in val_str: # value could be 1e-05 | ||||
| val_str += '.0' | val_str += '.0' | ||||
| return val_str | return val_str | ||||
| def get_py_class_from_rna(rna_type): | def get_py_class_from_rna(rna_type): | ||||
| """ Get's the Python type for a class which isn't necessarily added to ``bpy.types``. | """ Gets the Python type for a class which isn't necessarily added to ``bpy.types``. | ||||
| """ | """ | ||||
| identifier = rna_type.identifier | identifier = rna_type.identifier | ||||
| py_class = getattr(bpy.types, identifier, None) | py_class = getattr(bpy.types, identifier, None) | ||||
| if py_class is not None: | if py_class is not None: | ||||
| return py_class | return py_class | ||||
| def subclasses_recurse(cls): | def subclasses_recurse(cls): | ||||
| for c in cls.__subclasses__(): | for c in cls.__subclasses__(): | ||||
| ▲ Show 20 Lines • Show All 693 Lines • Show Last 20 Lines | |||||