diff options
author | Joerg Mueller <nexyon@gmail.com> | 2010-06-19 14:50:23 +0400 |
---|---|---|
committer | Joerg Mueller <nexyon@gmail.com> | 2010-06-19 14:50:23 +0400 |
commit | 229b7639e72c5290b3be24747fafd14c7aeaf71b (patch) | |
tree | f5d7b7c8be775e4fd21aae1786ac6ee395957a63 | |
parent | 615af47559f7c1bf0aa13011d21ed972f433613c (diff) |
Merged revision 29562 from /branches/soc-2010-nexyon.
-rw-r--r-- | release/scripts/modules/bpy_types.py | 5 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/blender.c | 5 | ||||
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 16 | ||||
-rw-r--r-- | source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp | 53 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_ObjectActuator.cpp | 4 |
5 files changed, 46 insertions, 37 deletions
diff --git a/release/scripts/modules/bpy_types.py b/release/scripts/modules/bpy_types.py index f6090d76533..b1c5429d4ba 100644 --- a/release/scripts/modules/bpy_types.py +++ b/release/scripts/modules/bpy_types.py @@ -531,6 +531,11 @@ class Text(bpy_types.ID): self.clear() self.write(string) + @property + def users_logic(self): + """Logic bricks that use this text""" + import bpy + return tuple(obj for obj in bpy.data.objects if self in [cont.text for cont in obj.game.controllers if cont.type == 'PYTHON']) import collections diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c index 046b8de2431..134d49cdf24 100644 --- a/source/blender/blenkernel/intern/blender.c +++ b/source/blender/blenkernel/intern/blender.c @@ -65,7 +65,6 @@ #include "BKE_global.h" #include "BKE_idprop.h" #include "BKE_library.h" -#include "BKE_ipo.h" #include "BKE_main.h" #include "BKE_node.h" #include "BKE_report.h" @@ -287,10 +286,6 @@ static void setup_app_data(bContext *C, BlendFileData *bfd, char *filename) //setscreen(G.curscreen); } - // XXX temporarily here - if(G.main->versionfile < 250) - do_versions_ipos_to_animato(G.main); // XXX fixme... complicated versionpatching - if(recover && bfd->filename[0] && G.relbase_valid) { /* in case of autosave or quit.blend, use original filename instead * use relbase_valid to make sure the file is saved, else we get <memory2> in the filename */ diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 3ec253f1003..cff93978eff 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -138,7 +138,7 @@ #include "BKE_sequencer.h" #include "BKE_texture.h" // for open_plugin_tex #include "BKE_utildefines.h" // SWITCH_INT DATA ENDB DNA1 O_BINARY GLOB USER TEST REND - +#include "BKE_ipo.h" #include "BKE_sound.h" //XXX #include "BIF_butspace.h" // badlevel, for do_versions, patching event codes @@ -9734,11 +9734,6 @@ static void do_versions(FileData *fd, Library *lib, Main *main) do_versions_gpencil_2_50(main, screen); } - /* old Animation System (using IPO's) needs to be converted to the new Animato system - * (NOTE: conversion code in blenkernel/intern/ipo.c for now) - */ - //do_versions_ipos_to_animato(main); - /* shader, composit and texture node trees have id.name empty, put something in * to have them show in RNA viewer and accessible otherwise. */ @@ -10930,6 +10925,14 @@ static void do_versions(FileData *fd, Library *lib, Main *main) /* don't forget to set version number in blender.c! */ } +static void do_versions_after_linking(FileData *fd, Library *lib, Main *main) +{ + /* old Animation System (using IPO's) needs to be converted to the new Animato system + */ + if(main->versionfile < 250) + do_versions_ipos_to_animato(main); +} + static void lib_link_all(FileData *fd, Main *main) { oldnewmap_sort(fd); @@ -11076,6 +11079,7 @@ BlendFileData *blo_read_file_internal(FileData *fd, const char *filename) blo_join_main(&fd->mainlist); lib_link_all(fd, bfd->main); + do_versions_after_linking(fd, NULL, bfd->main); lib_verify_nodetree(bfd->main, 1); fix_relpaths_library(fd->relabase, bfd->main); /* make all relative paths, relative to the open blend file */ diff --git a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp index c916cdeb67c..a83ec7e132f 100644 --- a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp +++ b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp @@ -84,6 +84,7 @@ extern "C" { #include "BLI_blenlib.h" #include "BLO_readfile.h" #include "DNA_scene_types.h" +#include "BKE_ipo.h" /***/ #include "AUD_C-API.h" @@ -120,7 +121,7 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, rcti *c { /* context values */ struct wmWindow *win= CTX_wm_window(C); - struct Scene *scene= CTX_data_scene(C); + struct Scene *startscene= CTX_data_scene(C); struct Main* maggie1= CTX_data_main(C); @@ -133,7 +134,7 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, rcti *c int exitrequested = KX_EXIT_REQUEST_NO_REQUEST; Main* blenderdata = maggie1; - char* startscenename = scene->id.name+2; + char* startscenename = startscene->id.name+2; char pathname[FILE_MAXDIR+FILE_MAXFILE], oldsce[FILE_MAXDIR+FILE_MAXFILE]; STR_String exitstring = ""; BlendFileData *bfd= NULL; @@ -220,12 +221,12 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, rcti *c #endif //lock frame and camera enabled - storing global values - int tmp_lay= scene->lay; - Object *tmp_camera = scene->camera; + int tmp_lay= startscene->lay; + Object *tmp_camera = startscene->camera; if (v3d->scenelock==0){ - scene->lay= v3d->lay; - scene->camera= v3d->camera; + startscene->lay= v3d->lay; + startscene->camera= v3d->camera; } // some blender stuff @@ -246,7 +247,7 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, rcti *c } if(rv3d->persp==RV3D_CAMOB) { - if(scene->gm.framing.type == SCE_GAMEFRAMING_BARS) { /* Letterbox */ + if(startscene->gm.framing.type == SCE_GAMEFRAMING_BARS) { /* Letterbox */ camzoom = 1.0f; } else { @@ -317,22 +318,22 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, rcti *c } } - Scene *blscene= bfd ? bfd->curscene : (Scene *)BLI_findstring(&blenderdata->scene, startscenename, offsetof(ID, name) + 2); + Scene *scene= bfd ? bfd->curscene : (Scene *)BLI_findstring(&blenderdata->scene, startscenename, offsetof(ID, name) + 2); - if (blscene) + if (scene) { - int startFrame = blscene->r.cfra; + int startFrame = scene->r.cfra; ketsjiengine->SetAnimRecordMode(animation_record, startFrame); // Quad buffered needs a special window. - if(blscene->gm.stereoflag == STEREO_ENABLED){ - if (blscene->gm.stereomode != RAS_IRasterizer::RAS_STEREO_QUADBUFFERED) - rasterizer->SetStereoMode((RAS_IRasterizer::StereoMode) blscene->gm.stereomode); + if(scene->gm.stereoflag == STEREO_ENABLED){ + if (scene->gm.stereomode != RAS_IRasterizer::RAS_STEREO_QUADBUFFERED) + rasterizer->SetStereoMode((RAS_IRasterizer::StereoMode) scene->gm.stereomode); - rasterizer->SetEyeSeparation(blscene->gm.eyeseparation); + rasterizer->SetEyeSeparation(scene->gm.eyeseparation); } - rasterizer->SetBackColor(blscene->gm.framing.col[0], blscene->gm.framing.col[1], blscene->gm.framing.col[2], 0.0f); + rasterizer->SetBackColor(scene->gm.framing.col[0], scene->gm.framing.col[1], scene->gm.framing.col[2], 0.0f); } if (exitrequested != KX_EXIT_REQUEST_QUIT_GAME) @@ -361,19 +362,19 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, rcti *c if(GPU_glsl_support()) useglslmat = true; - else if(blscene->gm.matmode == GAME_MAT_GLSL) + else if(scene->gm.matmode == GAME_MAT_GLSL) usemat = false; - if(usemat && (blscene->gm.matmode != GAME_MAT_TEXFACE)) + if(usemat && (scene->gm.matmode != GAME_MAT_TEXFACE)) sceneconverter->SetMaterials(true); - if(useglslmat && (blscene->gm.matmode == GAME_MAT_GLSL)) + if(useglslmat && (scene->gm.matmode == GAME_MAT_GLSL)) sceneconverter->SetGLSLMaterials(true); KX_Scene* startscene = new KX_Scene(keyboarddevice, mousedevice, networkdevice, startscenename, - blscene, + scene, canvas); #ifndef DISABLE_PYTHON @@ -383,13 +384,13 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, rcti *c #endif // DISABLE_PYTHON //initialize Dome Settings - if(blscene->gm.stereoflag == STEREO_DOME) - ketsjiengine->InitDome(blscene->gm.dome.res, blscene->gm.dome.mode, blscene->gm.dome.angle, blscene->gm.dome.resbuf, blscene->gm.dome.tilt, blscene->gm.dome.warptext); + if(scene->gm.stereoflag == STEREO_DOME) + ketsjiengine->InitDome(scene->gm.dome.res, scene->gm.dome.mode, scene->gm.dome.angle, scene->gm.dome.resbuf, scene->gm.dome.tilt, scene->gm.dome.warptext); // initialize 3D Audio Settings - AUD_set3DSetting(AUD_3DS_SPEED_OF_SOUND, blscene->audio.speed_of_sound); - AUD_set3DSetting(AUD_3DS_DOPPLER_FACTOR, blscene->audio.doppler_factor); - AUD_set3DSetting(AUD_3DS_DISTANCE_MODEL, blscene->audio.distance_model); + AUD_set3DSetting(AUD_3DS_SPEED_OF_SOUND, scene->audio.speed_of_sound); + AUD_set3DSetting(AUD_3DS_DOPPLER_FACTOR, scene->audio.doppler_factor); + AUD_set3DSetting(AUD_3DS_DISTANCE_MODEL, scene->audio.distance_model); if (sceneconverter) { @@ -505,8 +506,8 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, rcti *c } //lock frame and camera enabled - restoring global values if (v3d->scenelock==0){ - scene->lay= tmp_lay; - scene->camera= tmp_camera; + startscene->lay= tmp_lay; + startscene->camera= tmp_camera; } // set the cursor back to normal diff --git a/source/gameengine/Ketsji/KX_ObjectActuator.cpp b/source/gameengine/Ketsji/KX_ObjectActuator.cpp index df071d50aa2..0d0cac3c084 100644 --- a/source/gameengine/Ketsji/KX_ObjectActuator.cpp +++ b/source/gameengine/Ketsji/KX_ObjectActuator.cpp @@ -467,6 +467,8 @@ int KX_ObjectActuator::pyattr_set_linV(void *self_v, const KX_PYATTRIBUTE_DEF *a if (!PyVecTo(value, self->m_linear_velocity)) return PY_SET_ATTR_FAIL; + self->UpdateFuzzyFlags(); + return PY_SET_ATTR_SUCCESS; } @@ -481,6 +483,8 @@ int KX_ObjectActuator::pyattr_set_angV(void *self_v, const KX_PYATTRIBUTE_DEF *a if (!PyVecTo(value, self->m_angular_velocity)) return PY_SET_ATTR_FAIL; + self->UpdateFuzzyFlags(); + return PY_SET_ATTR_SUCCESS; } |