svn merge -r36900:37028 https://svn.blender.org/svnroot/bf-blender/trunk/blender
[blender-staging.git] / source / gameengine / Converter / BL_BlenderDataConversion.cpp
index 162c5ad4d44016feaf87dfddd3be38b308da96df..62459ef871ff2f95047a52613d11d5d7fbe64d51 100644 (file)
@@ -2608,6 +2608,9 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
                bConstraint *curcon;
                conlist = get_active_constraints2(blenderobject);
 
+               if((gameobj->GetLayer()&activeLayerBitInfo)==0)
+                       continue;
+
                if (conlist) {
                        for (curcon = (bConstraint *)conlist->first; curcon; curcon=(bConstraint *)curcon->next) {
                                if (curcon->type==CONSTRAINT_TYPE_RIGIDBODYJOINT){
@@ -2621,7 +2624,7 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
                                                if (dat->tar)
                                                {
                                                        KX_GameObject *gotar=getGameOb(dat->tar->id.name+2,sumolist);
-                                                       if (gotar && gotar->GetPhysicsController())
+                                                       if (gotar && ((gotar->GetLayer()&activeLayerBitInfo)!=0) && gotar->GetPhysicsController())
                                                                physctr2 = (PHY_IPhysicsController*) gotar->GetPhysicsController()->GetUserData();
                                                }