From c8c7414c3f6768b5cb54d56ff7999d0a0ca22bc6 Mon Sep 17 00:00:00 2001 From: Alexander Gavrilov Date: Mon, 7 Nov 2016 12:56:58 +0300 Subject: 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 --- source/blender/blenloader/intern/versioning_270.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'source/blender/blenloader/intern/versioning_270.c') diff --git a/source/blender/blenloader/intern/versioning_270.c b/source/blender/blenloader/intern/versioning_270.c index 14e02c9ffb6..8e855eb56b8 100644 --- a/source/blender/blenloader/intern/versioning_270.c +++ b/source/blender/blenloader/intern/versioning_270.c @@ -53,6 +53,7 @@ #include "DNA_actuator_types.h" #include "DNA_view3d_types.h" #include "DNA_smoke_types.h" +#include "DNA_rigidbody_types.h" #include "DNA_genfile.h" @@ -1438,5 +1439,20 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main) } } } + + if (!DNA_struct_elem_find(fd->filesdna, "RigidBodyCon", "float", "spring_stiffness_ang_x")) { + Object *ob; + for (ob = main->object.first; ob; ob = ob->id.next) { + RigidBodyCon *rbc = ob->rigidbody_constraint; + if (rbc) { + rbc->spring_stiffness_ang_x = 10.0; + rbc->spring_stiffness_ang_y = 10.0; + rbc->spring_stiffness_ang_z = 10.0; + rbc->spring_damping_ang_x = 0.5; + rbc->spring_damping_ang_y = 0.5; + rbc->spring_damping_ang_z = 0.5; + } + } + } } } -- cgit v1.2.3