[Bf-blender-cvs] [9158d162198] master: Cleanup: warning
Commit: 9158d162198549d8475bca4299df6f870b82c49d Author: Campbell Barton Date: Fri May 26 14:24:39 2017 +1000 Branches: master https://developer.blender.org/rB9158d162198549d8475bca4299df6f870b82c49d Cleanup: warning === M source/blender/editors/transform/transform_conversions.c === diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 5e67f304755..04b9ae75c8f 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -828,7 +828,9 @@ static void pose_grab_with_ik_clear(Object *ob) bKinematicConstraint *data; bPoseChannel *pchan; bConstraint *con, *next; +#ifdef WITH_LEGACY_DEPSGRAPH bool need_dependency_update = false; +#endif for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) { /* clear all temporary lock flags */ @@ -843,7 +845,9 @@ static void pose_grab_with_ik_clear(Object *ob) data = con->data; if (data->flag & CONSTRAINT_IK_TEMP) { /* iTaSC needs clear for removed constraints */ +#ifdef WITH_LEGACY_DEPSGRAPH need_dependency_update = true; +#endif BIK_clear_data(ob->pose); BLI_remlink(>constraints, con); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [00212683116] master: Cycles: Cleanup: Remove semicolons from line endings in Python code
Commit: 00212683116dce1f335cafb83a42980eeb0cf406 Author: Lukas Stockner Date: Fri May 26 02:15:09 2017 +0200 Branches: master https://developer.blender.org/rB00212683116dce1f335cafb83a42980eeb0cf406 Cycles: Cleanup: Remove semicolons from line endings in Python code === M intern/cycles/blender/addon/engine.py === diff --git a/intern/cycles/blender/addon/engine.py b/intern/cycles/blender/addon/engine.py index b2694a285b1..b5149b5082e 100644 --- a/intern/cycles/blender/addon/engine.py +++ b/intern/cycles/blender/addon/engine.py @@ -240,13 +240,13 @@ def register_passes(engine, scene, srl): if crl.pass_debug_ray_bounces: engine.register_pass(scene, srl, "Debug Ray Bounces", 1, "X", 'VALUE') if crl.use_denoising and crl.denoising_store_passes: -engine.register_pass(scene, srl, "Denoising Normal", 3, "XYZ", 'VECTOR'); -engine.register_pass(scene, srl, "Denoising Normal Variance", 3, "XYZ", 'VECTOR'); -engine.register_pass(scene, srl, "Denoising Albedo", 3, "RGB", 'COLOR'); -engine.register_pass(scene, srl, "Denoising Albedo Variance", 3, "RGB", 'COLOR'); -engine.register_pass(scene, srl, "Denoising Depth", 1, "Z", 'VALUE'); -engine.register_pass(scene, srl, "Denoising Depth Variance", 1, "Z", 'VALUE'); -engine.register_pass(scene, srl, "Denoising Shadow A",3, "XYV", 'VECTOR'); -engine.register_pass(scene, srl, "Denoising Shadow B",3, "XYV", 'VECTOR'); -engine.register_pass(scene, srl, "Denoising Image", 3, "RGB", 'COLOR'); -engine.register_pass(scene, srl, "Denoising Image Variance", 3, "RGB", 'COLOR'); \ No newline at end of file +engine.register_pass(scene, srl, "Denoising Normal", 3, "XYZ", 'VECTOR') +engine.register_pass(scene, srl, "Denoising Normal Variance", 3, "XYZ", 'VECTOR') +engine.register_pass(scene, srl, "Denoising Albedo", 3, "RGB", 'COLOR') +engine.register_pass(scene, srl, "Denoising Albedo Variance", 3, "RGB", 'COLOR') +engine.register_pass(scene, srl, "Denoising Depth", 1, "Z", 'VALUE') +engine.register_pass(scene, srl, "Denoising Depth Variance", 1, "Z", 'VALUE') +engine.register_pass(scene, srl, "Denoising Shadow A",3, "XYV", 'VECTOR') +engine.register_pass(scene, srl, "Denoising Shadow B",3, "XYV", 'VECTOR') +engine.register_pass(scene, srl, "Denoising Image", 3, "RGB", 'COLOR') +engine.register_pass(scene, srl, "Denoising Image Variance", 3, "RGB", 'COLOR') ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [dc23b48101e] master: Cleanup: Typo in colormanagement (ColormnaageCacheData -> ColormanageCacheData)
Commit: dc23b48101e02c88e02d6dbda37e1354fcb4a8e1 Author: Lukas Stockner Date: Fri May 26 01:52:43 2017 +0200 Branches: master https://developer.blender.org/rBdc23b48101e02c88e02d6dbda37e1354fcb4a8e1 Cleanup: Typo in colormanagement (ColormnaageCacheData -> ColormanageCacheData) === M source/blender/imbuf/intern/colormanagement.c === diff --git a/source/blender/imbuf/intern/colormanagement.c b/source/blender/imbuf/intern/colormanagement.c index a4d5da9993a..ff19a14dbff 100644 --- a/source/blender/imbuf/intern/colormanagement.c +++ b/source/blender/imbuf/intern/colormanagement.c @@ -214,7 +214,7 @@ typedef struct ColormanageCacheKey { int display; /* display device name */ } ColormanageCacheKey; -typedef struct ColormnaageCacheData { +typedef struct ColormanageCacheData { int flag;/* view flags of cached buffer */ int look;/* Additional artistics transform */ float exposure; /* exposure value cached buffer is calculated with */ @@ -222,12 +222,12 @@ typedef struct ColormnaageCacheData { float dither;/* dither value cached buffer is calculated with */ CurveMapping *curve_mapping; /* curve mapping used for cached buffer */ int curve_mapping_timestamp; /* time stamp of curve mapping used for cached buffer */ -} ColormnaageCacheData; +} ColormanageCacheData; typedef struct ColormanageCache { struct MovieCache *moviecache; - ColormnaageCacheData *data; + ColormanageCacheData *data; } ColormanageCache; static struct MovieCache *colormanage_moviecache_get(const ImBuf *ibuf) @@ -238,7 +238,7 @@ static struct MovieCache *colormanage_moviecache_get(const ImBuf *ibuf) return ibuf->colormanage_cache->moviecache; } -static ColormnaageCacheData *colormanage_cachedata_get(const ImBuf *ibuf) +static ColormanageCacheData *colormanage_cachedata_get(const ImBuf *ibuf) { if (!ibuf->colormanage_cache) return NULL; @@ -281,7 +281,7 @@ static struct MovieCache *colormanage_moviecache_ensure(ImBuf *ibuf) return ibuf->colormanage_cache->moviecache; } -static void colormanage_cachedata_set(ImBuf *ibuf, ColormnaageCacheData *data) +static void colormanage_cachedata_set(ImBuf *ibuf, ColormanageCacheData *data) { if (!ibuf->colormanage_cache) ibuf->colormanage_cache = MEM_callocN(sizeof(ColormanageCache), "imbuf colormanage cache"); @@ -361,7 +361,7 @@ static unsigned char *colormanage_cache_get(ImBuf *ibuf, const ColormanageCacheV cache_ibuf = colormanage_cache_get_ibuf(ibuf, , cache_handle); if (cache_ibuf) { - ColormnaageCacheData *cache_data; + ColormanageCacheData *cache_data; BLI_assert(cache_ibuf->x == ibuf->x && cache_ibuf->y == ibuf->y); @@ -402,7 +402,7 @@ static void colormanage_cache_put(ImBuf *ibuf, const ColormanageCacheViewSetting { ColormanageCacheKey key; ImBuf *cache_ibuf; - ColormnaageCacheData *cache_data; + ColormanageCacheData *cache_data; int view_flag = 1 << (view_settings->view - 1); struct MovieCache *moviecache = colormanage_moviecache_ensure(ibuf); CurveMapping *curve_mapping = view_settings->curve_mapping; @@ -421,7 +421,7 @@ static void colormanage_cache_put(ImBuf *ibuf, const ColormanageCacheViewSetting cache_ibuf->flags |= IB_rect; /* store data which is needed to check whether cached buffer could be used for color managed display settings */ - cache_data = MEM_callocN(sizeof(ColormnaageCacheData), "color manage cache imbuf data"); + cache_data = MEM_callocN(sizeof(ColormanageCacheData), "color manage cache imbuf data"); cache_data->look = view_settings->look; cache_data->exposure = view_settings->exposure; cache_data->gamma = view_settings->gamma; @@ -710,7 +710,7 @@ void colormanage_cache_free(ImBuf *ibuf) } if (ibuf->colormanage_cache) { - ColormnaageCacheData *cache_data = colormanage_cachedata_get(ibuf); + ColormanageCacheData *cache_data = colormanage_cachedata_get(ibuf); struct MovieCache *moviecache = colormanage_moviecache_get(ibuf); if (cache_data) { ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [2bc008e8a90] master: Cycles: Cleanup: b_srlay is always used now, no more need to silence warning
Commit: 2bc008e8a90b5fc038d03de557174ae6a605cb8a Author: Lukas Stockner Date: Fri May 26 01:55:32 2017 +0200 Branches: master https://developer.blender.org/rB2bc008e8a90b5fc038d03de557174ae6a605cb8a Cycles: Cleanup: b_srlay is always used now, no more need to silence warning === M intern/cycles/blender/blender_sync.cpp === diff --git a/intern/cycles/blender/blender_sync.cpp b/intern/cycles/blender/blender_sync.cpp index 4065439681f..41723599874 100644 --- a/intern/cycles/blender/blender_sync.cpp +++ b/intern/cycles/blender/blender_sync.cpp @@ -601,8 +601,6 @@ array BlenderSync::sync_render_passes(BL::RenderLayer& b_rlay, b_engine.add_pass("Debug Ray Bounces", 1, "X", b_srlay.name().c_str()); Pass::add(PASS_RAY_BOUNCES, passes); } -#else - (void) b_srlay; /* Ignored. */ #endif return passes; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [3722ed13cd9] master: Cycles: Update compositor when debug or denoising passes are changed
Commit: 3722ed13cd99b08caa1fe6bbf247993f98be9f35 Author: Lukas Stockner Date: Fri May 26 02:13:21 2017 +0200 Branches: master https://developer.blender.org/rB3722ed13cd99b08caa1fe6bbf247993f98be9f35 Cycles: Update compositor when debug or denoising passes are changed === M intern/cycles/blender/addon/properties.py === diff --git a/intern/cycles/blender/addon/properties.py b/intern/cycles/blender/addon/properties.py index 51b53a43d0b..8bb25aba13c 100644 --- a/intern/cycles/blender/addon/properties.py +++ b/intern/cycles/blender/addon/properties.py @@ -1166,6 +1166,12 @@ class CyclesCurveRenderSettings(bpy.types.PropertyGroup): def unregister(cls): del bpy.types.Scene.cycles_curves +def update_render_passes(self, context): +scene = context.scene +rd = scene.render +rl = rd.layers.active +rl.update_render_passes() + class CyclesRenderLayerSettings(bpy.types.PropertyGroup): @classmethod def register(cls): @@ -1178,21 +1184,25 @@ class CyclesRenderLayerSettings(bpy.types.PropertyGroup): name="Debug BVH Traversed Nodes", description="Store Debug BVH Traversed Nodes pass", default=False, +update=update_render_passes, ) cls.pass_debug_bvh_traversed_instances = BoolProperty( name="Debug BVH Traversed Instances", description="Store Debug BVH Traversed Instances pass", default=False, +update=update_render_passes, ) cls.pass_debug_bvh_intersections = BoolProperty( name="Debug BVH Intersections", description="Store Debug BVH Intersections", default=False, +update=update_render_passes, ) cls.pass_debug_ray_bounces = BoolProperty( name="Debug Ray Bounces", description="Store Debug Ray Bounces pass", default=False, +update=update_render_passes, ) cls.use_denoising = BoolProperty( @@ -1267,6 +1277,7 @@ class CyclesRenderLayerSettings(bpy.types.PropertyGroup): name="Store denoising passes", description="Store the denoising feature passes and the noisy image", default=False, +update=update_render_passes, ) @classmethod ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [1358c394555] master: [MSVC] Fix build error. linker was searching for a mangled version of versionstr
Commit: 1358c3945552291febefc22edb554794bcc2e844 Author: lazydodo Date: Thu May 25 15:23:45 2017 -0600 Branches: master https://developer.blender.org/rB1358c3945552291febefc22edb554794bcc2e844 [MSVC] Fix build error. linker was searching for a mangled version of versionstr === M source/blender/alembic/intern/abc_archive.cc === diff --git a/source/blender/alembic/intern/abc_archive.cc b/source/blender/alembic/intern/abc_archive.cc index ff14cf15124..bd16196cb78 100644 --- a/source/blender/alembic/intern/abc_archive.cc +++ b/source/blender/alembic/intern/abc_archive.cc @@ -23,8 +23,10 @@ */ #include "abc_archive.h" - -#include "BKE_blender_version.h" +extern "C" +{ + #include "BKE_blender_version.h" +} #ifdef WIN32 # include "utfconv.h" ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [9179797811b] master: Fix blender player python installation on macOS after recent changes.
Commit: 9179797811bb3eeb7400a66839effe6925ae2940 Author: Brecht Van Lommel Date: Thu May 25 21:42:52 2017 +0200 Branches: master https://developer.blender.org/rB9179797811bb3eeb7400a66839effe6925ae2940 Fix blender player python installation on macOS after recent changes. === M source/creator/CMakeLists.txt === diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index 6d0cbb365b4..7a34f8bcb69 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -1087,16 +1087,16 @@ elseif(APPLE) # python if(WITH_PYTHON AND NOT WITH_PYTHON_FRAMEWORK) add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/python - COMMAND ${CMAKE_COMMAND} -E remove_directory "${CMAKE_CURRENT_BINARY_DIR}/python/" - COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/python/" - COMMAND ${CMAKE_COMMAND} -E chdir "${CMAKE_CURRENT_BINARY_DIR}/python/" + OUTPUT ${PYTHON_EXTRACT_DIR} + COMMAND ${CMAKE_COMMAND} -E remove_directory "${PYTHON_EXTRACT_DIR}/" + COMMAND ${CMAKE_COMMAND} -E make_directory "${PYTHON_EXTRACT_DIR}/" + COMMAND ${CMAKE_COMMAND} -E chdir "${PYTHON_EXTRACT_DIR}/" ${CMAKE_COMMAND} -E tar xzfv "${LIBDIR}/release/${PYTHON_ZIP}" DEPENDS ${LIBDIR}/release/${PYTHON_ZIP}) # copy extracted python files install_dir( - ${CMAKE_CURRENT_BINARY_DIR}/python + ${PYTHON_EXTRACT_DIR} \${PLAYER_TARGETDIR_VER} ) endif() ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [5dea6eacf5e] workspaces: Transform orientations: Make code match blender2.8 as much as possible
Commit: 5dea6eacf5e61eac2cc79b97c93b057eb02dbaaa Author: Julian Eisel Date: Thu May 25 01:22:31 2017 +0200 Branches: workspaces https://developer.blender.org/rB5dea6eacf5e61eac2cc79b97c93b057eb02dbaaa Transform orientations: Make code match blender2.8 as much as possible Basically reverts e3c12bb139250b7573b and parts of cbaaeb8d9b6c95. Decided to keep things close to blender2.8 here, D2687 can apply the needed changes separately then. It's okay if removing custom transform orientations behave a bit glitchy with workspaces, all issues should get fixed with D2687. === M source/blender/blenkernel/BKE_screen.h M source/blender/blenkernel/BKE_workspace.h M source/blender/blenkernel/intern/screen.c M source/blender/blenkernel/intern/workspace.c M source/blender/blenloader/intern/readfile.c M source/blender/blenloader/intern/writefile.c M source/blender/editors/include/ED_transform.h M source/blender/editors/transform/transform.h M source/blender/editors/transform/transform_manipulator.c M source/blender/editors/transform/transform_ops.c M source/blender/editors/transform/transform_orientations.c M source/blender/makesdna/DNA_view3d_types.h M source/blender/makesrna/intern/rna_space.c === diff --git a/source/blender/blenkernel/BKE_screen.h b/source/blender/blenkernel/BKE_screen.h index 85831e4c2e2..645a99d592f 100644 --- a/source/blender/blenkernel/BKE_screen.h +++ b/source/blender/blenkernel/BKE_screen.h @@ -42,7 +42,6 @@ struct Panel; struct Scene; struct ScrArea; struct SpaceType; -struct TransformOrientation; struct View3D; struct bContext; struct bContextDataResult; @@ -310,8 +309,8 @@ unsigned int BKE_screen_view3d_layer_all(const struct bScreen *sc) ATTR_WARN_UNU void BKE_screen_view3d_sync(struct View3D *v3d, struct Scene *scene); void BKE_screen_view3d_scene_sync(struct bScreen *sc, struct Scene *scene); -void BKE_screen_transform_orientation_remove(const struct bScreen *screen, - const struct TransformOrientation *orientation) ATTR_NONNULL(); +void BKE_screen_view3d_twmode_remove(struct View3D *v3d, const int i); +void BKE_screen_view3d_main_twmode_remove(ListBase *screen_lb, struct Scene *scene, const int i); void BKE_screen_gpu_fx_validate(struct GPUFXSettings *fx_settings); bool BKE_screen_is_fullscreen_area(const struct bScreen *screen) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); bool BKE_screen_is_used(const struct bScreen *screen) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); diff --git a/source/blender/blenkernel/BKE_workspace.h b/source/blender/blenkernel/BKE_workspace.h index 08e08168ebd..732ed341af2 100644 --- a/source/blender/blenkernel/BKE_workspace.h +++ b/source/blender/blenkernel/BKE_workspace.h @@ -30,7 +30,6 @@ struct bScreen; struct ListBase; struct Main; -struct TransformOrientation; struct WorkSpace; struct WorkSpaceDataRelation; @@ -74,10 +73,6 @@ void BKE_workspace_layout_remove( _workspace##_next = ((ID *)_workspace)->next; /* support removing workspace from list */ #define BKE_WORKSPACE_ITER_END } ((void)0) -void BKE_workspaces_transform_orientation_remove( -const struct ListBase *workspaces, -const struct TransformOrientation *orientation) ATTR_NONNULL(); - WorkSpaceLayout *BKE_workspace_layout_find( const WorkSpace *workspace, const struct bScreen *screen) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT; WorkSpaceLayout *BKE_workspace_layout_find_global( diff --git a/source/blender/blenkernel/intern/screen.c b/source/blender/blenkernel/intern/screen.c index 2082975dcd8..b1f8f574b7e 100644 --- a/source/blender/blenkernel/intern/screen.c +++ b/source/blender/blenkernel/intern/screen.c @@ -611,17 +611,33 @@ void BKE_screen_view3d_scene_sync(bScreen *sc, Scene *scene) } } -void BKE_screen_transform_orientation_remove(const bScreen *screen, const TransformOrientation *orientation) +/* XXX apply D2687 */ +void BKE_screen_view3d_twmode_remove(View3D *v3d, const int i) { - for (ScrArea *area = screen->areabase.first; area; area = area->next) { - for (SpaceLink *sl = area->spacedata.first; sl; sl = sl->next) { - if (sl->spacetype == SPACE_VIEW3D) { - View3D *v3d = (View3D *)sl; + const int selected_index = (v3d->twmode - V3D_MANIP_CUSTOM); + if (selected_index == i) { + v3d->twmode = V3D_MANIP_GLOBAL; + } + else if (selected_index > i) { + v3d->twmode--; + } +} + +/* XXX apply D2687 */ +void BKE_screen_view3d_main_twmode_remove(ListBase *screen_lb, Scene *scene, const int i) +{ + bScreen *sc; - if (v3d->custom_orientation == orientation) { - /* could also use
[Bf-blender-cvs] [2580c3cb82b] master: Fix T50112: Sequencer crash w/ missing proxy data
Commit: 2580c3cb82bd968e84b9e756f9df529bbe161d68 Author: Campbell Barton Date: Thu May 25 20:23:31 2017 +1000 Branches: master https://developer.blender.org/rB2580c3cb82bd968e84b9e756f9df529bbe161d68 Fix T50112: Sequencer crash w/ missing proxy data === M source/blender/blenloader/intern/readfile.c === diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index b909205392e..01951b0266f 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -6096,9 +6096,13 @@ static void direct_link_scene(FileData *fd, Scene *sce) seq->strip->transform = NULL; } if (seq->flag & SEQ_USE_PROXY) { - seq->strip->proxy = newdataadr( - fd, seq->strip->proxy); - seq->strip->proxy->anim = NULL; + seq->strip->proxy = newdataadr(fd, seq->strip->proxy); + if (seq->strip->proxy) { + seq->strip->proxy->anim = NULL; + } + else { + BKE_sequencer_proxy_set(seq, true); + } } else { seq->strip->proxy = NULL; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [1ddf67382be] master: Docs: Image.has_data clarification
Commit: 1ddf67382bec8838de8f569281a68275d05356cf Author: Campbell Barton Date: Thu May 25 19:54:54 2017 +1000 Branches: master https://developer.blender.org/rB1ddf67382bec8838de8f569281a68275d05356cf Docs: Image.has_data clarification Resolves T51615 === M source/blender/makesrna/intern/rna_image.c === diff --git a/source/blender/makesrna/intern/rna_image.c b/source/blender/makesrna/intern/rna_image.c index f65aa90ea71..b6e84cf8ac3 100644 --- a/source/blender/makesrna/intern/rna_image.c +++ b/source/blender/makesrna/intern/rna_image.c @@ -871,7 +871,7 @@ static void rna_def_image(BlenderRNA *brna) prop = RNA_def_property(srna, "has_data", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_Image_has_data_get", NULL); RNA_def_property_clear_flag(prop, PROP_EDITABLE); - RNA_def_property_ui_text(prop, "Has data", "True if this image has data"); + RNA_def_property_ui_text(prop, "Has Data", "True if the image data is loaded into memory"); prop = RNA_def_property(srna, "depth", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_funcs(prop, "rna_Image_depth_get", NULL, NULL); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [24e3a930f14] master: Fix T51444: Unit tests don't run on Windows
Commit: 24e3a930f14a7bfc1ea16350b4e2c9585aa0f7c3 Author: Campbell Barton Date: Thu May 25 18:56:00 2017 +1000 Branches: master https://developer.blender.org/rB24e3a930f14a7bfc1ea16350b4e2c9585aa0f7c3 Fix T51444: Unit tests don't run on Windows === M source/blender/python/intern/bpy_interface.c === diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index 55e477b0214..7b0daa91523 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -480,11 +480,20 @@ static bool python_script_exec( * object, but as written in the Python/C API Ref Manual, chapter 2, * 'FILE structs for different C libraries can be different and * incompatible'. -* So now we load the script file data to a buffer */ +* So now we load the script file data to a buffer. +* +* Note on use of 'globals()', it's important not copy the dictionary because +* tools may inspect 'sys.modules["__main__"]' for variables defined in the code +* where using a copy of 'globals()' causes code execution +* to leave the main namespace untouched. see: T51444 +* +* This leaves us with the problem of variables being included, +* currently this is worked around using 'dict.__del__' it's ugly but works. +*/ { const char *pystring = - "ns = globals().copy()\n" - "with open(__file__, 'rb') as f: exec(compile(f.read(), __file__, 'exec'), ns)"; + "with open(__file__, 'rb') as f:" + "exec(compile(f.read(), __file__, 'exec'), globals().__delitem__('f') or globals())"; fclose(fp); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs