[Bf-blender-cvs] [8a1b38f] master: Cleanup: avoid using G.main.
Kévin Dietrich
noreply at git.blender.org
Fri Oct 28 18:48:19 CEST 2016
Commit: 8a1b38f071dea64567fa9e3dac5ad98d7b2dc6a2
Author: Kévin Dietrich
Date: Fri Oct 28 18:26:34 2016 +0200
Branches: master
https://developer.blender.org/rB8a1b38f071dea64567fa9e3dac5ad98d7b2dc6a2
Cleanup: avoid using G.main.
===================================================================
M source/blender/editors/io/io_cache.c
===================================================================
diff --git a/source/blender/editors/io/io_cache.c b/source/blender/editors/io/io_cache.c
index c5eea94..ebe8898 100644
--- a/source/blender/editors/io/io_cache.c
+++ b/source/blender/editors/io/io_cache.c
@@ -59,7 +59,9 @@ static int cachefile_open_invoke(bContext *C, wmOperator *op, const wmEvent *eve
{
if (!RNA_struct_property_is_set(op->ptr, "filepath")) {
char filepath[FILE_MAX];
- BLI_strncpy(filepath, G.main->name, sizeof(filepath));
+ Main *bmain = CTX_data_main(C);
+
+ BLI_strncpy(filepath, bmain->name, sizeof(filepath));
BLI_replace_extension(filepath, sizeof(filepath), ".abc");
RNA_string_set(op->ptr, "filepath", filepath);
}
More information about the Bf-blender-cvs
mailing list