diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 1fcbb95156b..c22cdb21899 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -11155,24 +11155,22 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } /* put compatibility code here until next subversion bump */ - { + if (main->versionfile < 255 || (main->versionfile == 255 && main->subversionfile < 1)) { Brush *br; + ParticleSettings *part; + bScreen *sc; + Object *ob; + for(br= main->brush.first; br; br= br->id.next) { if(br->ob_mode==0) br->ob_mode= OB_MODE_ALL_PAINT; } - - } - { - ParticleSettings *part; + for(part = main->particle.first; part; part = part->id.next) { if(part->boids) part->boids->pitch = 1.0f; } - } - { - bScreen *sc; for (sc= main->screen.first; sc; sc= sc->id.next) { ScrArea *sa; for (sa= sc->areabase.first; sa; sa= sa->next) { @@ -11198,8 +11196,22 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } } } + + /* fix rotation actuators for objects so they use real angles (radians) + * since before blender went opensource this strange scalar was used: (1 / 0.02) * 2 * math.pi/360 */ + for(ob= main->object.first; ob; ob= ob->id.next) { + bActuator *act= ob->actuators.first; + while(act) { + if (act->type==ACT_OBJECT) { + /* multiply velocity with 50 in old files */ + bObjectActuator *oa= act->data; + mul_v3_fl(oa->drot, 0.8726646259971648f); + } + act= act->next; + } + } } - + /* WATCH IT!!!: pointers from libdata have not been converted yet here! */ /* WATCH IT 2!: Userdef struct init has to be in editors/interface/resources.c! */ diff --git a/source/blender/makesdna/DNA_actuator_types.h b/source/blender/makesdna/DNA_actuator_types.h index 76bb9a5f96f..077c62943e0 100644 --- a/source/blender/makesdna/DNA_actuator_types.h +++ b/source/blender/makesdna/DNA_actuator_types.h @@ -112,7 +112,7 @@ typedef struct bObjectActuator { short damping; float forceloc[3], forcerot[3]; float pad[3], pad1[3]; - float dloc[3], drot[3]; + float dloc[3], drot[3]; /* angle in radians */ float linearvelocity[3], angularvelocity[3]; struct Object *reference; } bObjectActuator; diff --git a/source/gameengine/Converter/KX_ConvertActuators.cpp b/source/gameengine/Converter/KX_ConvertActuators.cpp index d9d3d7c185d..2bd992037c5 100644 --- a/source/gameengine/Converter/KX_ConvertActuators.cpp +++ b/source/gameengine/Converter/KX_ConvertActuators.cpp @@ -32,8 +32,6 @@ #pragma warning (disable : 4786) #endif //WIN32 -#define BLENDER_HACK_DTIME 0.02 - #include "MEM_guardedalloc.h" #include "KX_BlenderSceneConverter.h" @@ -151,13 +149,6 @@ void BL_ConvertActuators(char* maggiename, KX_BLENDERTRUNC(obact->angularvelocity[2])); short damping = obact->damping; - drotvec /= BLENDER_HACK_DTIME; - //drotvec /= BLENDER_HACK_DTIME; - drotvec *= MT_2_PI/360.0; - //dlocvec /= BLENDER_HACK_DTIME; - //linvelvec /= BLENDER_HACK_DTIME; - //angvelvec /= BLENDER_HACK_DTIME; - /* Blender uses a bit vector internally for the local-flags. In */ /* KX, we have four bools. The compiler should be smart enough */ /* to do the right thing. We need to explicitly convert here! */