[Bf-blender-cvs] [da631b7] soc-2016-multiview: Merge branch 'master' into soc-2016-multiview
Commit: da631b72f986355d0bfe68d547fe8aff8d486a82 Author: Tianwei Shen Date: Wed Sep 7 11:15:07 2016 +0800 Branches: soc-2016-multiview https://developer.blender.org/rBda631b72f986355d0bfe68d547fe8aff8d486a82 Merge branch 'master' into soc-2016-multiview fix versioning_270.c conflict. Move secondary_clip version below 2.78 === === diff --cc source/blender/blenloader/intern/versioning_270.c index 58f96e9,dfaa59c..4519c46 --- a/source/blender/blenloader/intern/versioning_270.c +++ b/source/blender/blenloader/intern/versioning_270.c @@@ -1421,4 -1392,4 +1394,33 @@@ void blo_do_versions_270(FileData *fd, } } } ++ ++ { ++ /* initialize regiondata for each SpaceClip, due to the newly brought RegionSpaceClip */ ++ if (!DNA_struct_elem_find(fd->filesdna, "SpaceClip", "MovieClip", "*secondary_clip")) { ++ for (bScreen *screen = main->screen.first; screen != NULL; screen = screen->id.next) { ++ for (ScrArea *sa = screen->areabase.first; sa != NULL; sa = sa->next) { ++ for (SpaceLink *sl = sa->spacedata.first; sl != NULL; sl = sl->next) { ++ if (sl->spacetype == SPACE_CLIP) { ++ ListBase *regionbase = (sl == sa->spacedata.first) ? >regionbase : >regionbase; ++ for (ARegion *ar = regionbase->first; ar != NULL; ar = ar->next) { ++ if (ar->regiontype == RGN_TYPE_WINDOW) { ++ SpaceClip *sc = (SpaceClip *)sl; ++ RegionSpaceClip *rsc = MEM_callocN(sizeof(RegionSpaceClip), "region data for clip"); ++ ++ rsc->xof = sc->xof; ++ rsc->yof = sc->yof; ++ rsc->xlockof = sc->xlockof; ++ rsc->ylockof = sc->ylockof; ++ rsc->zoom = sc->zoom; ++ rsc->flag = RSC_MAIN_CLIP; ++ ar->regiondata = rsc; ++ } ++ } ++ } ++ } ++ } ++ } ++ } ++ } } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [18d49a8] blender2.8: Gawain: add immBeginAtMost
Commit: 18d49a8283f2490b0751798685770533cc814d29 Author: Mike Erwin Date: Tue Sep 6 16:56:08 2016 -0400 Branches: blender2.8 https://developer.blender.org/rB18d49a8283f2490b0751798685770533cc814d29 Gawain: add immBeginAtMost immBegin requires us to know how many vertices will be drawn. Most times this is fine, but sometimes it can be tricky. Do we make the effort to count everything in one pass, then draw it in a second? immBeginAtMost makes this simple. Example: I'll draw at most 100 vertices. Supply only 6 verts and it draws only 6. Any unused space is reclaimed and given to the next immBegin. === M source/blender/gpu/GPU_immediate.h M source/blender/gpu/intern/gpu_immediate.c === diff --git a/source/blender/gpu/GPU_immediate.h b/source/blender/gpu/GPU_immediate.h index 6bcfdc7..ffd0a6d 100644 --- a/source/blender/gpu/GPU_immediate.h +++ b/source/blender/gpu/GPU_immediate.h @@ -63,7 +63,8 @@ VertexFormat* immVertexFormat(void); // returns a cleared vertex format, ready f void immBindProgram(GLuint program); void immUnbindProgram(void); -void immBegin(GLenum primitive, unsigned vertex_ct); +void immBegin(GLenum primitive, unsigned vertex_ct); // must supply exactly vertex_ct vertices +void immBeginAtMost(GLenum primitive, unsigned max_vertex_ct); // can supply fewer vertices void immEnd(void); void immAttrib1f(unsigned attrib_id, float x); diff --git a/source/blender/gpu/intern/gpu_immediate.c b/source/blender/gpu/intern/gpu_immediate.c index 88a1479..98568d1 100644 --- a/source/blender/gpu/intern/gpu_immediate.c +++ b/source/blender/gpu/intern/gpu_immediate.c @@ -242,6 +242,7 @@ typedef struct { unsigned buffer_offset; unsigned buffer_bytes_mapped; unsigned vertex_ct; + bool strict_vertex_ct; GLenum primitive; VertexFormat vertex_format; @@ -285,7 +286,8 @@ void immInit() #endif imm.primitive = PRIM_NONE; - + imm.strict_vertex_ct = true; + glBindBuffer(GL_ARRAY_BUFFER, 0); glBindVertexArray(0); initialized = true; @@ -334,36 +336,38 @@ void immUnbindProgram() imm.bound_program = 0; } -void immBegin(GLenum primitive, unsigned vertex_ct) +static bool vertex_count_makes_sense_for_primitive(unsigned vertex_ct, GLenum primitive) { -#if TRUST_NO_ONE - assert(initialized); - assert(imm.primitive == PRIM_NONE); // make sure we haven't already begun - // does vertex_ct make sense for this primitive type? - assert(vertex_ct > 0); + if (vertex_ct == 0) + return false; + switch (primitive) { case GL_POINTS: - break; + return true; case GL_LINES: - assert(vertex_ct % 2 == 0); - break; + return vertex_ct % 2 == 0; case GL_LINE_STRIP: case GL_LINE_LOOP: - assert(vertex_ct > 2); // otherwise why bother? - break; + return vertex_ct > 2; // otherwise why bother? case GL_TRIANGLES: - assert(vertex_ct % 3 == 0); - break; + return vertex_ct % 3 == 0; #ifdef WITH_GL_PROFILE_COMPAT case GL_QUADS: - assert(vertex_ct % 4 == 0); - break; + return vertex_ct % 4 == 0; #endif default: - assert(false); + return false; } + } + +void immBegin(GLenum primitive, unsigned vertex_ct) + { +#if TRUST_NO_ONE + assert(initialized); + assert(imm.primitive == PRIM_NONE); // make sure we haven't already begun + assert(vertex_count_makes_sense_for_primitive(vertex_ct, primitive)); #endif imm.primitive = primitive; @@ -417,17 +421,43 @@ void immBegin(GLenum primitive, unsigned vertex_ct) imm.vertex_data = imm.buffer_data; } +void immBeginAtMost(GLenum primitive, unsigned vertex_ct) + { + imm.strict_vertex_ct = false; + immBegin(primitive, vertex_ct); + } + void immEnd() { #if TRUST_NO_ONE assert(imm.primitive != PRIM_NONE); // make sure we're between a Begin/End pair - assert(imm.vertex_idx == imm.vertex_ct); // with all vertices defined #endif + unsigned buffer_bytes_used; + if (imm.strict_vertex_ct) + { +#if TRUST_NO_ONE + assert(imm.vertex_idx == imm.vertex_ct); // with all vertices defined +#endif + buffer_bytes_used = imm.buffer_bytes_mapped; + } + else + { +#if TRUST_NO_ONE + assert(imm.vertex_idx <=
[Bf-blender-cvs] [d0e7c7a] master: Add XK_ISO_Left_Tab to ghost's known X11 keydefines...
Commit: d0e7c7a032d7377d2cef85db35c23329e1ff1862 Author: Bastien Montagne Date: Tue Sep 6 22:32:17 2016 +0200 Branches: master https://developer.blender.org/rBd0e7c7a032d7377d2cef85db35c23329e1ff1862 Add XK_ISO_Left_Tab to ghost's known X11 keydefines... === M intern/ghost/intern/GHOST_SystemX11.cpp === diff --git a/intern/ghost/intern/GHOST_SystemX11.cpp b/intern/ghost/intern/GHOST_SystemX11.cpp index 87604bc..9a2dcfc 100644 --- a/intern/ghost/intern/GHOST_SystemX11.cpp +++ b/intern/ghost/intern/GHOST_SystemX11.cpp @@ -1606,6 +1606,7 @@ convertXKey(KeySym key) switch (key) { GXMAP(type, XK_BackSpace,GHOST_kKeyBackSpace); GXMAP(type, XK_Tab, GHOST_kKeyTab); + GXMAP(type, XK_ISO_Left_Tab, GHOST_kKeyTab); GXMAP(type, XK_Return, GHOST_kKeyEnter); GXMAP(type, XK_Escape, GHOST_kKeyEsc); GXMAP(type, XK_space,GHOST_kKeySpace); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [031c5ba] blender2.8: Gawain: fix GL_POINTS in immediate mode
Commit: 031c5bad87693f263d2ee69192fb6f7512a5f6dc Author: Mike Erwin Date: Tue Sep 6 15:45:10 2016 -0400 Branches: blender2.8 https://developer.blender.org/rB031c5bad87693f263d2ee69192fb6f7512a5f6dc Gawain: fix GL_POINTS in immediate mode Was using GL_NONE to mean "no primitive" but GL_NONE and GL_POINTS are both defined as 0x. Introducing PRIM_NONE = 0xF which does not clash with any primitive types. === M source/blender/gpu/intern/gpu_immediate.c === diff --git a/source/blender/gpu/intern/gpu_immediate.c b/source/blender/gpu/intern/gpu_immediate.c index 7d32ba3..88a1479 100644 --- a/source/blender/gpu/intern/gpu_immediate.c +++ b/source/blender/gpu/intern/gpu_immediate.c @@ -36,6 +36,8 @@ #define glBindVertexArray glBindVertexArrayAPPLE #endif +#define PRIM_NONE 0xF + void clear_VertexFormat(VertexFormat* format) { for (unsigned a = 0; a < format->attrib_ct; ++a) @@ -282,7 +284,7 @@ void immInit() glBufferParameteriAPPLE(GL_ARRAY_BUFFER, GL_BUFFER_FLUSHING_UNMAP_APPLE, GL_FALSE); #endif - imm.primitive = GL_NONE; + imm.primitive = PRIM_NONE; glBindBuffer(GL_ARRAY_BUFFER, 0); glBindVertexArray(0); @@ -293,7 +295,7 @@ void immDestroy() { #if TRUST_NO_ONE assert(initialized); - assert(imm.primitive == GL_NONE); // make sure we're not between a Begin/End pair + assert(imm.primitive == PRIM_NONE); // make sure we're not between a Begin/End pair #endif clear_VertexFormat(_format); @@ -336,7 +338,7 @@ void immBegin(GLenum primitive, unsigned vertex_ct) { #if TRUST_NO_ONE assert(initialized); - assert(imm.primitive == GL_NONE); // make sure we haven't already begun + assert(imm.primitive == PRIM_NONE); // make sure we haven't already begun // does vertex_ct make sense for this primitive type? assert(vertex_ct > 0); @@ -418,7 +420,7 @@ void immBegin(GLenum primitive, unsigned vertex_ct) void immEnd() { #if TRUST_NO_ONE - assert(imm.primitive != GL_NONE); // make sure we're between a Begin/End pair + assert(imm.primitive != PRIM_NONE); // make sure we're between a Begin/End pair assert(imm.vertex_idx == imm.vertex_ct); // with all vertices defined #endif @@ -489,7 +491,7 @@ void immEnd() // prep for next immBegin imm.buffer_offset += imm.buffer_bytes_mapped; - imm.primitive = GL_NONE; + imm.primitive = PRIM_NONE; // further optional cleanup imm.buffer_bytes_mapped = 0; @@ -517,7 +519,7 @@ void immAttrib1f(unsigned attrib_id, float x) assert(attrib->comp_type == GL_FLOAT); assert(attrib->comp_ct == 1); assert(imm.vertex_idx < imm.vertex_ct); - assert(imm.primitive != GL_NONE); // make sure we're between a Begin/End pair + assert(imm.primitive != PRIM_NONE); // make sure we're between a Begin/End pair #endif setAttribValueBit(attrib_id); @@ -537,7 +539,7 @@ void immAttrib2f(unsigned attrib_id, float x, float y) assert(attrib->comp_type == GL_FLOAT); assert(attrib->comp_ct == 2); assert(imm.vertex_idx < imm.vertex_ct); - assert(imm.primitive != GL_NONE); // make sure we're between a Begin/End pair + assert(imm.primitive != PRIM_NONE); // make sure we're between a Begin/End pair #endif setAttribValueBit(attrib_id); @@ -558,7 +560,7 @@ void immAttrib3f(unsigned attrib_id, float x, float y, float z) assert(attrib->comp_type == GL_FLOAT); assert(attrib->comp_ct == 3); assert(imm.vertex_idx < imm.vertex_ct); - assert(imm.primitive != GL_NONE); // make sure we're between a Begin/End pair + assert(imm.primitive != PRIM_NONE); // make sure we're between a Begin/End pair #endif setAttribValueBit(attrib_id); @@ -580,7 +582,7 @@ void immAttrib4f(unsigned attrib_id, float x, float y, float z, float w) assert(attrib->comp_type == GL_FLOAT); assert(attrib->comp_ct == 4); assert(imm.vertex_idx < imm.vertex_ct); - assert(imm.primitive != GL_NONE); // make sure we're between a Begin/End pair + assert(imm.primitive != PRIM_NONE); // make sure we're between a Begin/End pair #endif setAttribValueBit(attrib_id); @@ -613,7 +615,7 @@ void immAttrib3ub(unsigned attrib_id, unsigned char r, unsigned char g, unsigned assert(attrib->comp_type == GL_UNSIGNED_BYTE); assert(attrib->comp_ct == 3); assert(imm.vertex_idx < imm.vertex_ct); - assert(imm.primitive != GL_NONE); // make sure we're between a Begin/End pair + assert(imm.primitive != PRIM_NONE); // make sure we're between a Begin/End pair #endif setAttribValueBit(attrib_id); @@ -635,7 +637,7 @@ void immAttrib4ub(unsigned attrib_id, unsigned char r, unsigned
[Bf-blender-cvs] [f298c9e] master: Cleanup previous commit...
Commit: f298c9ea1a23c71cf82e1a21fdd8711b8a8bfd8c Author: Bastien Montagne Date: Tue Sep 6 18:01:14 2016 +0200 Branches: master https://developer.blender.org/rBf298c9ea1a23c71cf82e1a21fdd8711b8a8bfd8c Cleanup previous commit... === M intern/ghost/intern/GHOST_SystemX11.cpp === diff --git a/intern/ghost/intern/GHOST_SystemX11.cpp b/intern/ghost/intern/GHOST_SystemX11.cpp index 18edefa..87604bc 100644 --- a/intern/ghost/intern/GHOST_SystemX11.cpp +++ b/intern/ghost/intern/GHOST_SystemX11.cpp @@ -922,7 +922,6 @@ GHOST_SystemX11::processEvent(XEvent *xe) case GHOST_kKey7: case GHOST_kKey8: case GHOST_kKey9: - printf("ModKey!\n"); break; default: gkey = convertXKey(key_sym_str); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [87b3faf] master: GHOST X11 keyboard: Attempt to fix issues with modifier keys on some systems.
Commit: 87b3faf55708be229faf3a33b0c1db17bbe59da6 Author: Bastien Montagne Date: Tue Sep 6 17:54:40 2016 +0200 Branches: master https://developer.blender.org/rB87b3faf55708be229faf3a33b0c1db17bbe59da6 GHOST X11 keyboard: Attempt to fix issues with modifier keys on some systems. Could not reproduce it here, but since users having the issue claims it comes from rB16cb9391634dcc50e, let's try to use again ugly `XLookupKeysym()` for those modifier keys too... === M intern/ghost/intern/GHOST_SystemX11.cpp === diff --git a/intern/ghost/intern/GHOST_SystemX11.cpp b/intern/ghost/intern/GHOST_SystemX11.cpp index 653c0cc..18edefa 100644 --- a/intern/ghost/intern/GHOST_SystemX11.cpp +++ b/intern/ghost/intern/GHOST_SystemX11.cpp @@ -838,7 +838,7 @@ GHOST_SystemX11::processEvent(XEvent *xe) case KeyRelease: { XKeyEvent *xke = &(xe->xkey); - KeySym key_sym = XK_VoidSymbol; + KeySym key_sym; KeySym key_sym_str; char ascii; #if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING) @@ -891,16 +891,41 @@ GHOST_SystemX11::processEvent(XEvent *xe) if ((xke->keycode >= 10 && xke->keycode < 20) && ((xke->state & number_hack_forbidden_kmods_mask) == 0)) { key_sym = XLookupKeysym(xke, ShiftMask); if (!((key_sym >= XK_0) && (key_sym <= XK_9))) { - key_sym = XK_VoidSymbol; + key_sym = XLookupKeysym(xke, 0); } } + else { + key_sym = XLookupKeysym(xke, 0); + } if (!XLookupString(xke, , 1, _sym_str, NULL)) { ascii = '\0'; } - if ((gkey = convertXKey(key_sym)) == GHOST_kKeyUnknown) { - gkey = convertXKey(key_sym_str); + /* Only allow a very limited set of keys from XLookupKeysym, all others we take from XLookupString... */ + gkey = convertXKey(key_sym); + switch (gkey) { + case GHOST_kKeyRightAlt: + case GHOST_kKeyLeftAlt: + case GHOST_kKeyRightShift: + case GHOST_kKeyLeftShift: + case GHOST_kKeyRightControl: + case GHOST_kKeyLeftControl: + case GHOST_kKeyOS: + case GHOST_kKey0: + case GHOST_kKey1: + case GHOST_kKey2: + case GHOST_kKey3: + case GHOST_kKey4: + case GHOST_kKey5: + case GHOST_kKey6: + case GHOST_kKey7: + case GHOST_kKey8: + case GHOST_kKey9: + printf("ModKey!\n"); + break; + default: + gkey = convertXKey(key_sym_str); } #else /* In keyboards like latin ones, ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [049ed1f] master: [cmake/cpack] allow override of package name
Commit: 049ed1f4e7b0b50ab0f47bb698e9ad632ca5542f Author: lazydodo Date: Tue Sep 6 07:21:23 2016 -0600 Branches: master https://developer.blender.org/rB049ed1f4e7b0b50ab0f47bb698e9ad632ca5542f [cmake/cpack] allow override of package name Cpack generates a standard filename with git information in it, which might not always be wanted for release builds, this patch adds an option to override that default filename. Reviewers: sergey, juicyfruit Reviewed By: juicyfruit Differential Revision: https://developer.blender.org/D2199 ammended to fix: wrong variable name in main CMakeLists.txt === M CMakeLists.txt === diff --git a/CMakeLists.txt b/CMakeLists.txt index 5f7d59a..352712e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -220,8 +220,8 @@ if(${CMAKE_VERSION} VERSION_LESS 2.8.8) endif() set(BUILDINFO_OVERRIDE_DATE "" CACHE STRING "Use instead of the current date for reproducable builds (empty string disables this option)") set(BUILDINFO_OVERRIDE_TIME "" CACHE STRING "Use instead of the current time for reproducable builds (empty string disables this option)") -set(PACKAGENAME_OVERRIDE "" CACHE STRING "Use instead of the standard packagename (empty string disables this option)") -mark_as_advanced(PACKAGENAME_OVERRIDE) +set(CPACK_OVERRIDE_PACKAGENAME "" CACHE STRING "Use instead of the standard packagename (empty string disables this option)") +mark_as_advanced(CPACK_OVERRIDE_PACKAGENAME) mark_as_advanced(BUILDINFO_OVERRIDE_DATE) mark_as_advanced(BUILDINFO_OVERRIDE_TIME) ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [c02f9bc] master: Revert "Depsgraph: Prioritize evaluation of the new scheduled nodes"
Commit: c02f9bc5697cae47da81b9e54e9a3794fefbe499 Author: Sergey Sharybin Date: Tue Sep 6 16:43:26 2016 +0200 Branches: master https://developer.blender.org/rBc02f9bc5697cae47da81b9e54e9a3794fefbe499 Revert "Depsgraph: Prioritize evaluation of the new scheduled nodes" This reverts commit 9444cd56db1a4e43d03fa8c735cd893b2e74b913. This commit caused some flickering in the bones when swapping IK to Fk. While it's unclear why such change caused any regressions, let's revert it to unlock the studio. === M source/blender/depsgraph/intern/eval/deg_eval.cc === diff --git a/source/blender/depsgraph/intern/eval/deg_eval.cc b/source/blender/depsgraph/intern/eval/deg_eval.cc index f8cca53..c3fd202 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval.cc +++ b/source/blender/depsgraph/intern/eval/deg_eval.cc @@ -304,7 +304,7 @@ static void schedule_node(TaskPool *pool, Depsgraph *graph, unsigned int layers, deg_task_run_func, node, false, - TASK_PRIORITY_HIGH, + TASK_PRIORITY_LOW, thread_id); } } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [abd54f1] master: [cmake/cpack] allow override of package name
Commit: abd54f1ed2a5706a394e31ef00f89dee19d55e87 Author: lazydodo Date: Tue Sep 6 07:21:23 2016 -0600 Branches: master https://developer.blender.org/rBabd54f1ed2a5706a394e31ef00f89dee19d55e87 [cmake/cpack] allow override of package name Cpack generates a standard filename with git information in it, which might not always be wanted for release builds, this patch adds an option to override that default filename. Reviewers: sergey, juicyfruit Reviewed By: juicyfruit Differential Revision: https://developer.blender.org/D2199 === M CMakeLists.txt M build_files/cmake/packaging.cmake === diff --git a/CMakeLists.txt b/CMakeLists.txt index 709f824..5f7d59a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -220,6 +220,8 @@ if(${CMAKE_VERSION} VERSION_LESS 2.8.8) endif() set(BUILDINFO_OVERRIDE_DATE "" CACHE STRING "Use instead of the current date for reproducable builds (empty string disables this option)") set(BUILDINFO_OVERRIDE_TIME "" CACHE STRING "Use instead of the current time for reproducable builds (empty string disables this option)") +set(PACKAGENAME_OVERRIDE "" CACHE STRING "Use instead of the standard packagename (empty string disables this option)") +mark_as_advanced(PACKAGENAME_OVERRIDE) mark_as_advanced(BUILDINFO_OVERRIDE_DATE) mark_as_advanced(BUILDINFO_OVERRIDE_TIME) diff --git a/build_files/cmake/packaging.cmake b/build_files/cmake/packaging.cmake index bc1d64f..1563331 100644 --- a/build_files/cmake/packaging.cmake +++ b/build_files/cmake/packaging.cmake @@ -48,7 +48,11 @@ else(MSVC) set(PACKAGE_ARCH ${CMAKE_SYSTEM_PROCESSOR}) endif() -set(CPACK_PACKAGE_FILE_NAME ${PROJECT_NAME_LOWER}-${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}-git${CPACK_DATE}.${BUILD_REV}-${PACKAGE_ARCH}) +if (CPACK_OVERRIDE_PACKAGENAME) + set(CPACK_PACKAGE_FILE_NAME ${CPACK_OVERRIDE_PACKAGENAME}-${PACKAGE_ARCH}) +else() + set(CPACK_PACKAGE_FILE_NAME ${PROJECT_NAME_LOWER}-${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}-git${CPACK_DATE}.${BUILD_REV}-${PACKAGE_ARCH}) +endif() if(CMAKE_SYSTEM_NAME MATCHES "Linux") # RPM packages ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [f4f6e6f] asset-engine: AmberAIO: Fix asyncio loop handling.
Commit: f4f6e6f525f39922f7982b27c404d3dc974e8987 Author: Bastien Montagne Date: Tue Sep 6 14:12:08 2016 +0200 Branches: asset-engine https://developer.blender.org/rBf4f6e6f525f39922f7982b27c404d3dc974e8987 AmberAIO: Fix asyncio loop handling. Finally found the right way to do this (at least, I think! :P). === M release/scripts/startup/bl_operators/amber_asyncio.py === diff --git a/release/scripts/startup/bl_operators/amber_asyncio.py b/release/scripts/startup/bl_operators/amber_asyncio.py index 14fdb38..d4821db 100644 --- a/release/scripts/startup/bl_operators/amber_asyncio.py +++ b/release/scripts/startup/bl_operators/amber_asyncio.py @@ -148,13 +148,17 @@ class AmberJob: @staticmethod def async_looper(func): +"""Defines a simple wrapper around the function that executes it before stepping a bit asyncio loop.""" def wrapper(*args, **kwargs): loop = asyncio.get_event_loop() -print("kickstop") -loop.stop() print("proceed") func(*args, **kwargs) -print("kickstart") +print("kickstep") +# That's the trick - since asyncio loop is not the main loop, we cannot call run_forever, or we would +# never get back our thread (not until something in asyncio loop itself calls stop(), at least). +# So we schedule ourselves the stop call, effectively leading to 'stepping' asyncio loop. +# This relies on the fact that main loop (aka Blender) calls an @AmberJob.async_looper func often enough! +loop.call_soon(loop.stop) loop.run_forever() return wrapper ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [aa7b74a] asset-engine: Merge branch 'master' into asset-engine
Commit: aa7b74acf1af4613779c40689dcb13244b50d551 Author: Bastien Montagne Date: Mon Sep 5 15:10:03 2016 +0200 Branches: asset-engine https://developer.blender.org/rBaa7b74acf1af4613779c40689dcb13244b50d551 Merge branch 'master' into asset-engine === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [3ba2133] asset-engine: Merge branch 'master' into asset-engine
Commit: 3ba2133e52fa2af64355b26b6140c4f0d24399f6 Author: Bastien Montagne Date: Tue Sep 6 12:27:28 2016 +0200 Branches: asset-engine https://developer.blender.org/rB3ba2133e52fa2af64355b26b6140c4f0d24399f6 Merge branch 'master' into asset-engine === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [0da8bae] asset-engine: Claude: Fix asyncio handling!
Commit: 0da8bae85ac41a949048437f0f53ea705584a43f Author: Bastien Montagne Date: Tue Sep 6 14:38:51 2016 +0200 Branches: asset-engine https://developer.blender.org/rB0da8bae85ac41a949048437f0f53ea705584a43f Claude: Fix asyncio handling! Turns out using worker thread to run asyncio loop is not working with pillar, this code is totally not blender-independent and hence cannot safely work in another thread. So instead using same technique as in AmberAIO - 'stepping' of asyncio loop, instead of blindly run_forever() and hoping loop will stop some day... Note that we may rather call e.g. loop.run_later(1e-5, loop.stop), to actually give a bit more time to the loop... Time will say what's best option here. === M release/scripts/startup/bl_operators/claude/__init__.py === diff --git a/release/scripts/startup/bl_operators/claude/__init__.py b/release/scripts/startup/bl_operators/claude/__init__.py index 17ab18c..20f486d 100644 --- a/release/scripts/startup/bl_operators/claude/__init__.py +++ b/release/scripts/startup/bl_operators/claude/__init__.py @@ -79,41 +79,37 @@ REQUIRED_ROLES_FOR_CLAUDE = {'subscriber', 'demo'} # Claude Jobs. class ClaudeJob: @staticmethod -async def check_loop(loop, evt_cancel): -"""Async function merely endlessly checking 'cancel' flag is not set, and stopping the loop in case it is...""" -while True: -if evt_cancel.is_set(): -print("CAAANNCCCLE!") -loop.stop() -return -await asyncio.sleep(1e-6) - -@classmethod -def run_loop(cls, loop, evt_cancel): -"""Function called in worker thread, sets the loop for current thread, and runs it.""" -asyncio.set_event_loop(loop) -asyncio.ensure_future(cls.check_loop(loop, evt_cancel)) -loop.run_forever() -loop.close() +def async_looper(func): +def wrapper(self, *args, **kwargs): +loop = self.loop +assert(not self.loop.is_running()) +print("proceed") +ret = func(self, *args, **kwargs) +if not self.evt_cancel.is_set(): +print("kickstep") +# This forces loop to only do 'one step', and return (hopefully!) very soon. +loop.call_soon(loop.stop) +loop.run_forever() +else: +print("canceled") +return ret +return wrapper def cancel(self): +print("Cancelling ", self) self.evt_cancel.set() -self.running_loop.cancel() -futures.wait((self.running_loop,)) - -def __init__(self, executor, job_id): -self.executor = executor +assert(not self.loop.is_running()) +def __init__(self, job_id): self.job_id = job_id self.status = {'VALID'} self.progress = 0.0 -self.loop = asyncio.new_event_loop() -#~ self.loop.set_default_executor(executor) self.evt_cancel = threading.Event() -self.running_loop = self.executor.submit(self.run_loop, self.loop, self.evt_cancel) +self.loop = asyncio.get_event_loop() def __del__(self): +print("deleting ", self) self.cancel() class ClaudeJobCheckCredentials(ClaudeJob): @@ -124,7 +120,9 @@ class ClaudeJobCheckCredentials(ClaudeJob): Returns None if the user cannot be found, or if the user is not a Cloud subscriber. """ try: +print("Awaiting pillar.check_pillar_credentials...") user_id = await pillar.check_pillar_credentials(REQUIRED_ROLES_FOR_CLAUDE) +print("Done pillar.check_pillar_credentials...") except pillar.NotSubscribedToCloudError: print('Not subsribed.') return None @@ -137,7 +135,9 @@ class ClaudeJobCheckCredentials(ClaudeJob): return user_id try: +print("awaiting pillar.refresh_pillar_credentials...") user_id = await pillar.refresh_pillar_credentials(required_roles) +print("Done pillar.refresh_pillar_credentials...") except pillar.NotSubscribedToCloudError: print('Not subsribed.') return None @@ -151,22 +151,21 @@ class ClaudeJobCheckCredentials(ClaudeJob): return None +@ClaudeJob.async_looper def start(self): -self.check_task = asyncio.run_coroutine_threadsafe(self.check(), self.loop) +self.check_task = asyncio.ensure_future(self.check()) self.progress = 0.0 self.status = {'VALID', 'RUNNING'} +@ClaudeJob.async_looper def update(self): -if self.evt_cancel.is_set(): -self.cancel() -return - self.status = {'VALID', 'RUNNING'} user_id = ... +print("Updating
[Bf-blender-cvs] [655ccef] asset-engine: Merge branch 'master' into asset-engine
Commit: 655ccef0959dcd70602e5306e30123243b925f37 Author: Bastien Montagne Date: Wed Aug 31 20:59:49 2016 +0200 Branches: asset-engine https://developer.blender.org/rB655ccef0959dcd70602e5306e30123243b925f37 Merge branch 'master' into asset-engine === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [b40d1c1] master: Fix T41883: Strip keyframes not respected for scenes rendered by other scenes
Commit: b40d1c1903207f1c5ba1b7cb3050b4a836c2171d Author: Sergey Sharybin Date: Tue Sep 6 14:07:07 2016 +0200 Branches: master https://developer.blender.org/rBb40d1c1903207f1c5ba1b7cb3050b4a836c2171d Fix T41883: Strip keyframes not respected for scenes rendered by other scenes === M source/blender/editors/sound/sound_ops.c === diff --git a/source/blender/editors/sound/sound_ops.c b/source/blender/editors/sound/sound_ops.c index ac3fc76..52c39e5 100644 --- a/source/blender/editors/sound/sound_ops.c +++ b/source/blender/editors/sound/sound_ops.c @@ -217,32 +217,56 @@ static void SOUND_OT_open_mono(wmOperatorType *ot) /* *** */ -static int sound_update_animation_flags_exec(bContext *C, wmOperator *UNUSED(op)) +static void sound_update_animation_flags(Scene *scene); + +static int sound_update_animation_flags_cb(Sequence *seq, void *user_data) { - Sequence *seq; - Scene *scene = CTX_data_scene(C); struct FCurve *fcu; + Scene *scene = (Scene *)user_data; bool driven; - SEQ_BEGIN(scene->ed, seq) - { - fcu = id_data_find_fcurve(>id, seq, _Sequence, "volume", 0, ); - if (fcu || driven) - seq->flag |= SEQ_AUDIO_VOLUME_ANIMATED; - else - seq->flag &= ~SEQ_AUDIO_VOLUME_ANIMATED; + fcu = id_data_find_fcurve(>id, seq, _Sequence, "volume", 0, ); + if (fcu || driven) + seq->flag |= SEQ_AUDIO_VOLUME_ANIMATED; + else + seq->flag &= ~SEQ_AUDIO_VOLUME_ANIMATED; - fcu = id_data_find_fcurve(>id, seq, _Sequence, "pitch", 0, ); - if (fcu || driven) - seq->flag |= SEQ_AUDIO_PITCH_ANIMATED; - else - seq->flag &= ~SEQ_AUDIO_PITCH_ANIMATED; + fcu = id_data_find_fcurve(>id, seq, _Sequence, "pitch", 0, ); + if (fcu || driven) + seq->flag |= SEQ_AUDIO_PITCH_ANIMATED; + else + seq->flag &= ~SEQ_AUDIO_PITCH_ANIMATED; - fcu = id_data_find_fcurve(>id, seq, _Sequence, "pan", 0, ); - if (fcu || driven) - seq->flag |= SEQ_AUDIO_PAN_ANIMATED; - else - seq->flag &= ~SEQ_AUDIO_PAN_ANIMATED; + fcu = id_data_find_fcurve(>id, seq, _Sequence, "pan", 0, ); + if (fcu || driven) + seq->flag |= SEQ_AUDIO_PAN_ANIMATED; + else + seq->flag &= ~SEQ_AUDIO_PAN_ANIMATED; + + if (seq->type == SEQ_TYPE_SCENE) { + /* TODO(sergey): For now we do manual recursion into the scene strips, +* but perhaps it should be covered by recursive_apply? +*/ + sound_update_animation_flags(seq->scene); + } + + return 0; +} + +static void sound_update_animation_flags(Scene *scene) +{ + struct FCurve *fcu; + bool driven; + Sequence *seq; + + if (scene->id.tag & LIB_TAG_DOIT) { + return; + } + scene->id.tag |= LIB_TAG_DOIT; + + SEQ_BEGIN(scene->ed, seq) + { + BKE_sequencer_recursive_apply(seq, sound_update_animation_flags_cb, scene); } SEQ_END @@ -251,7 +275,12 @@ static int sound_update_animation_flags_exec(bContext *C, wmOperator *UNUSED(op) scene->audio.flag |= AUDIO_VOLUME_ANIMATED; else scene->audio.flag &= ~AUDIO_VOLUME_ANIMATED; +} +static int sound_update_animation_flags_exec(bContext *C, wmOperator *UNUSED(op)) +{ + BKE_main_id_tag_idcode(CTX_data_main(C), ID_SCE, LIB_TAG_DOIT, false); + sound_update_animation_flags(CTX_data_scene(C)); return OPERATOR_FINISHED; } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [e3e8ce0] master: Add script which scales splash screen down
Commit: e3e8ce08a6adeab415885c8da2a629a205bfe6ae Author: Sergey Sharybin Date: Tue Sep 6 12:27:58 2016 +0200 Branches: master https://developer.blender.org/rBe3e8ce08a6adeab415885c8da2a629a205bfe6ae Add script which scales splash screen down Based on reading documentation around. This particular version is based on the ImageMagic documentation which could be found there: http://www.imagemagick.org/Usage/filter/ http://www.imagemagick.org/Usage/filter/nicolas/ Current filter is based on measuring mean error with the current splash screen and choosing combination of parameters which gives minimal mean error. === A release/datafiles/splash_scale.sh === diff --git a/release/datafiles/splash_scale.sh b/release/datafiles/splash_scale.sh new file mode 100755 index 000..8a3f2c6 --- /dev/null +++ b/release/datafiles/splash_scale.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# Use this script to generate splash.png from splash_2x.png. +# Supposed to give best quality image. +# +# Based on ImageMagic documentation, which is interesting +# to read anyway: +# +# http://www.imagemagick.org/Usage/filter +# http://www.imagemagick.org/Usage/filter/nicolas/ + +convert \ + splash_2x.png \ + -colorspace RGB \ + -filter Cosine \ + -resize 50% \ + -colorspace sRGB \ + splash.png ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs