Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/blender/blenloader/intern/versioning_270.c11
-rw-r--r--source/blender/makesrna/intern/rna_object.c5
2 files changed, 16 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/versioning_270.c b/source/blender/blenloader/intern/versioning_270.c
index 72f9897730a..b5199e123c6 100644
--- a/source/blender/blenloader/intern/versioning_270.c
+++ b/source/blender/blenloader/intern/versioning_270.c
@@ -909,6 +909,15 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
#undef LA_YF_PHOTON
}
+ {
+ Object *ob;
+ for (ob = main->object.first; ob; ob = ob->id.next) {
+ if (ob->body_type == OB_BODY_TYPE_CHARACTER && (ob->gameflag & OB_BOUNDS) && ob->collision_boundtype == OB_BOUND_TRIANGLE_MESH) {
+ ob->boundtype = ob->collision_boundtype = OB_BOUND_BOX;
+ }
+ }
+ }
+
}
{
@@ -925,4 +934,6 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
}
+
+
}
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c
index f36b2a9c81d..8e031b6324d 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -1036,6 +1036,11 @@ static void rna_GameObjectSettings_physics_type_set(PointerRNA *ptr, int value)
ob->gameflag |= OB_COLLISION | OB_CHARACTER;
ob->gameflag &= ~(OB_SENSOR | OB_OCCLUDER | OB_DYNAMIC | OB_RIGID_BODY | OB_SOFT_BODY | OB_ACTOR |
OB_ANISOTROPIC_FRICTION | OB_DO_FH | OB_ROT_FH | OB_COLLISION_RESPONSE | OB_NAVMESH);
+ /* When we switch to character physics and the collision bounds is set to triangle mesh
+ we have to change collision bounds because triangle mesh is not supported by Characters*/
+ if ((ob->gameflag & OB_BOUNDS) && ob->collision_boundtype == OB_BOUND_TRIANGLE_MESH) {
+ ob->boundtype = ob->collision_boundtype = OB_BOUND_BOX;
+ }
break;
case OB_BODY_TYPE_STATIC:
ob->gameflag |= OB_COLLISION;