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:
authorMitchell Stokes <mogurijin@gmail.com>2010-08-28 06:07:55 +0400
committerMitchell Stokes <mogurijin@gmail.com>2010-08-28 06:07:55 +0400
commit5c23537daa5c669b672528b0ed2bcaef2038f766 (patch)
treed8dafae80815cdd6d05e23ededc87df0098b2eb3 /source/gameengine/Converter/KX_BlenderSceneConverter.h
parent5729b991fa06734a7a7d58b4ff0f2feab5db8bca (diff)
Committing patch [#23278] (by me)
This patch allows a user to pass binary data to LibLoad() to load a blend file from memory instead of a file path. I don't know how useful this will be for others, but I've used it so far for: * Decrypting .blend files and loading them without having to store the .blend on the hard drive * Pulling .blend data out of an archive and loading it (again skipping the hard drive) So, it seems the biggest use for this is skipping a bit of file IO (and possibly some security problems). Example usage: import bge with f as open('myfile.blend', 'rb'): data = f.read() bge.logic.LibLoad('Name', 'Scene', data)
Diffstat (limited to 'source/gameengine/Converter/KX_BlenderSceneConverter.h')
-rw-r--r--source/gameengine/Converter/KX_BlenderSceneConverter.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/source/gameengine/Converter/KX_BlenderSceneConverter.h b/source/gameengine/Converter/KX_BlenderSceneConverter.h
index 23d506c98ff..20f3f863563 100644
--- a/source/gameengine/Converter/KX_BlenderSceneConverter.h
+++ b/source/gameengine/Converter/KX_BlenderSceneConverter.h
@@ -142,7 +142,9 @@ public:
struct Main* GetMainDynamicPath(const char *path);
vector<struct Main*> &GetMainDynamic();
- bool LinkBlendFile(const char *path, char *group, KX_Scene *scene_merge, char **err_str);
+ bool LinkBlendFileMemory(void *data, int length, const char *path, char *group, KX_Scene *scene_merge, char **err_str);
+ bool LinkBlendFilePath(const char *path, char *group, KX_Scene *scene_merge, char **err_str);
+ bool LinkBlendFile(struct BlendHandle *bpy_openlib, const char *path, char *group, KX_Scene *scene_merge, char **err_str);
bool MergeScene(KX_Scene *to, KX_Scene *from);
RAS_MeshObject *ConvertMeshSpecial(KX_Scene* kx_scene, Main *maggie, const char *name);
bool FreeBlendFile(struct Main *maggie);