Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/properties_scene.py
| Context not available. | |||||
| layout.operator("sound.bake_animation") | layout.operator("sound.bake_animation") | ||||
| def get_gravity(self): | |||||
| return self.gravity * self.unit_settings.scale_length | |||||
| def set_gravity(self, value): | |||||
| self.gravity = ( | |||||
| value[0] / self.unit_settings.scale_length, | |||||
| value[1] / self.unit_settings.scale_length, | |||||
| value[2] / self.unit_settings.scale_length | |||||
| ) | |||||
| bpy.types.Scene.metric_gravity = bpy.props.FloatVectorProperty( | |||||
| name="Gravity", | |||||
| subtype="ACCELERATION", | |||||
| get=get_gravity, | |||||
| set=set_gravity | |||||
| ) | |||||
| class SCENE_PT_physics(SceneButtonsPanel, Panel): | class SCENE_PT_physics(SceneButtonsPanel, Panel): | ||||
| bl_label = "Gravity" | bl_label = "Gravity" | ||||
| Context not available. | |||||
| layout.active = scene.use_gravity | layout.active = scene.use_gravity | ||||
| layout.prop(scene, "gravity") | layout.prop(scene, "metric_gravity") | ||||
| class SCENE_PT_rigid_body_world(SceneButtonsPanel, Panel): | class SCENE_PT_rigid_body_world(SceneButtonsPanel, Panel): | ||||
| Context not available. | |||||