diff options
author | Alexander Gavrilov <angavrilov@gmail.com> | 2016-11-07 12:56:58 +0300 |
---|---|---|
committer | Alexander Gavrilov <angavrilov@gmail.com> | 2016-11-07 12:59:12 +0300 |
commit | c8c7414c3f6768b5cb54d56ff7999d0a0ca22bc6 (patch) | |
tree | e61cded63fe3aea523671af91d17cf000fd94f0d /release | |
parent | dd921238d9223f550d3043313c9c38d07620de5d (diff) |
Expose Bullet rotational spring settings in the UI.
Bullet spring constraint already supports rotational springs, but
they are not exposed in blender UI, likely due to a simple oversight.
Supporting them is as simple as adding a few DNA/RNA properties
with appropriate UI and passing them on to Bullet.
Reviewers: sergof
Reviewed By: sergof
Differential Revision: https://developer.blender.org/D2331
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/startup/bl_ui/properties_physics_rigidbody_constraint.py | 48 |
1 files changed, 39 insertions, 9 deletions
diff --git a/release/scripts/startup/bl_ui/properties_physics_rigidbody_constraint.py b/release/scripts/startup/bl_ui/properties_physics_rigidbody_constraint.py index 38c97746f4a..9d4f51b256b 100644 --- a/release/scripts/startup/bl_ui/properties_physics_rigidbody_constraint.py +++ b/release/scripts/startup/bl_ui/properties_physics_rigidbody_constraint.py @@ -205,30 +205,60 @@ class PHYSICS_PT_rigid_body_constraint(PHYSICS_PT_rigidbody_constraint_panel, Pa row = col.row(align=True) sub = row.row(align=True) - sub.scale_x = 0.1 - sub.prop(rbc, "use_spring_x", toggle=True, text="X") + sub.scale_x = 0.5 + sub.prop(rbc, "use_spring_x", toggle=True, text="X Axis") sub = row.row(align=True) sub.active = rbc.use_spring_x sub.prop(rbc, "spring_stiffness_x", text="Stiffness") - sub.prop(rbc, "spring_damping_x") + sub.prop(rbc, "spring_damping_x", text="Damping") row = col.row(align=True) sub = row.row(align=True) - sub.scale_x = 0.1 - sub.prop(rbc, "use_spring_y", toggle=True, text="Y") + sub.scale_x = 0.5 + sub.prop(rbc, "use_spring_y", toggle=True, text="Y Axis") sub = row.row(align=True) sub.active = rbc.use_spring_y sub.prop(rbc, "spring_stiffness_y", text="Stiffness") - sub.prop(rbc, "spring_damping_y") + sub.prop(rbc, "spring_damping_y", text="Damping") row = col.row(align=True) sub = row.row(align=True) - sub.scale_x = 0.1 - sub.prop(rbc, "use_spring_z", toggle=True, text="Z") + sub.scale_x = 0.5 + sub.prop(rbc, "use_spring_z", toggle=True, text="Z Axis") sub = row.row(align=True) sub.active = rbc.use_spring_z sub.prop(rbc, "spring_stiffness_z", text="Stiffness") - sub.prop(rbc, "spring_damping_z") + sub.prop(rbc, "spring_damping_z", text="Damping") + + col = layout.column(align=True) + + row = col.row(align=True) + sub = row.row(align=True) + sub.scale_x = 0.5 + sub.prop(rbc, "use_spring_ang_x", toggle=True, text="X Angle") + sub = row.row(align=True) + sub.active = rbc.use_spring_ang_x + sub.prop(rbc, "spring_stiffness_ang_x", text="Stiffness") + sub.prop(rbc, "spring_damping_ang_x", text="Damping") + + row = col.row(align=True) + sub = row.row(align=True) + sub.scale_x = 0.5 + sub.prop(rbc, "use_spring_ang_y", toggle=True, text="Y Angle") + sub = row.row(align=True) + sub.active = rbc.use_spring_ang_y + sub.prop(rbc, "spring_stiffness_ang_y", text="Stiffness") + sub.prop(rbc, "spring_damping_ang_y", text="Damping") + + row = col.row(align=True) + sub = row.row(align=True) + sub.scale_x = 0.5 + sub.prop(rbc, "use_spring_ang_z", toggle=True, text="Z Angle") + sub = row.row(align=True) + sub.active = rbc.use_spring_ang_z + sub.prop(rbc, "spring_stiffness_ang_z", text="Stiffness") + sub.prop(rbc, "spring_damping_ang_z", text="Damping") + if __name__ == "__main__": # only for live edit. bpy.utils.register_module(__name__) |