Commit: 2f4712841a387e4baca15f6d43f608fc706ab74e Author: Peter Kim Date: Sat Aug 7 18:36:55 2021 +0900 Branches: xr-controller-support https://developer.blender.org/rB2f4712841a387e4baca15f6d43f608fc706ab74e
Merge branch 'master' into xr-controller-support =================================================================== A build_files/windows/doc_py.cmd A build_files/windows/find_sphinx.cmd M build_files/windows/parse_arguments.cmd M build_files/windows/reset_variables.cmd M build_files/windows/show_help.cmd A extern/nanosvg/README.blender R100 source/blender/io/gpencil/nanosvg/nanosvg.h extern/nanosvg/nanosvg.h A extern/nanosvg/patches/NanoSVG.diff M intern/cycles/render/session.cpp M intern/cycles/render/session.h M make.bat M release/scripts/presets/keyconfig/keymap_data/blender_default.py M release/scripts/startup/bl_ui/space_filebrowser.py M source/blender/blenkernel/BKE_context.h M source/blender/blenkernel/intern/context.c M source/blender/blenkernel/intern/workspace.c M source/blender/blenlib/BLI_range.h M source/blender/blenloader/intern/versioning_300.c M source/blender/blenloader/intern/writefile.c M source/blender/depsgraph/intern/builder/deg_builder_relations.cc M source/blender/draw/intern/draw_cache_impl_gpencil.c M source/blender/editors/animation/anim_draw.c M source/blender/editors/animation/keyframes_keylist.c M source/blender/editors/armature/pose_lib_2.c M source/blender/editors/armature/pose_slide.c M source/blender/editors/asset/ED_asset_handle.h M source/blender/editors/asset/ED_asset_temp_id_consumer.h M source/blender/editors/asset/intern/asset_handle.cc M source/blender/editors/asset/intern/asset_ops.cc M source/blender/editors/asset/intern/asset_temp_id_consumer.cc M source/blender/editors/gpencil/gpencil_primitive.c M source/blender/editors/include/ED_keyframes_keylist.h M source/blender/editors/interface/interface_template_asset_view.cc M source/blender/editors/screen/screen_context.c M source/blender/editors/screen/screen_ops.c M source/blender/editors/space_action/action_select.c M source/blender/editors/space_file/file_draw.c M source/blender/editors/space_file/filelist.c M source/blender/editors/space_file/filelist.h M source/blender/editors/space_file/filesel.c M source/blender/editors/space_file/space_file.c M source/blender/editors/transform/transform.c M source/blender/editors/transform/transform.h M source/blender/editors/transform/transform_convert.c M source/blender/editors/transform/transform_generics.c M source/blender/editors/transform/transform_snap.c M source/blender/io/alembic/intern/abc_reader_nurbs.cc M source/blender/io/gpencil/CMakeLists.txt M source/blender/io/gpencil/intern/gpencil_io_import_svg.cc M source/blender/makesdna/DNA_asset_types.h M source/blender/makesdna/DNA_space_types.h M source/blender/makesdna/DNA_workspace_types.h M source/blender/makesrna/intern/rna_asset.c M source/blender/makesrna/intern/rna_space.c M source/blender/makesrna/intern/rna_workspace.c M source/blender/python/intern/bpy_rna_operator.c =================================================================== diff --git a/build_files/windows/doc_py.cmd b/build_files/windows/doc_py.cmd new file mode 100644 index 00000000000..d33a0289083 --- /dev/null +++ b/build_files/windows/doc_py.cmd @@ -0,0 +1,34 @@ +set SOURCEDIR=%BLENDER_DIR%/doc/python_api/sphinx-in +set BUILDDIR=%BLENDER_DIR%/doc/python_api/sphinx-out +if "%BF_LANG%" == "" set BF_LANG=en +set SPHINXOPTS=-j auto -D language=%BF_LANG% + +call "%~dp0\find_sphinx.cmd" + +if EXIST "%SPHINX_BIN%" ( + goto detect_sphinx_done +) + +echo unable to locate sphinx-build, run "set sphinx_BIN=full_path_to_sphinx-build.exe" +exit /b 1 + +:detect_sphinx_done + +call "%~dp0\find_blender.cmd" + +if EXIST "%BLENDER_BIN%" ( + goto detect_blender_done +) + +echo unable to locate blender, run "set BLENDER_BIN=full_path_to_blender.exe" +exit /b 1 + +:detect_blender_done + +%BLENDER_BIN% ^ + --background -noaudio --factory-startup ^ + --python %BLENDER_DIR%/doc/python_api/sphinx_doc_gen.py + +"%SPHINX_BIN%" -b html %SPHINXOPTS% %O% %SOURCEDIR% %BUILDDIR% + +:EOF diff --git a/build_files/windows/find_sphinx.cmd b/build_files/windows/find_sphinx.cmd new file mode 100644 index 00000000000..24238e96768 --- /dev/null +++ b/build_files/windows/find_sphinx.cmd @@ -0,0 +1,23 @@ +REM First see if there is an environment variable set +if EXIST "%SPHINX_BIN%" ( + goto detect_sphinx_done +) + +REM Then see if inkscape is available in the path +for %%X in (sphinx-build.exe) do (set SPHINX_BIN=%%~$PATH:X) +if EXIST "%SPHINX_BIN%" ( + goto detect_sphinx_done +) + +echo.The 'sphinx-build' command was not found. Make sure you have Sphinx +echo.installed, then set the SPHINX_BIN environment variable to point +echo.to the full path of the 'sphinx-build' executable. Alternatively you +echo.may add the Sphinx directory to PATH. +echo. +echo.If you don't have Sphinx installed, grab it from +echo.http://sphinx-doc.org/ + +REM If still not found clear the variable +set SPHINX_BIN= + +:detect_sphinx_done diff --git a/build_files/windows/parse_arguments.cmd b/build_files/windows/parse_arguments.cmd index c71093f2394..c63f062dfef 100644 --- a/build_files/windows/parse_arguments.cmd +++ b/build_files/windows/parse_arguments.cmd @@ -113,6 +113,9 @@ if NOT "%1" == "" ( ) else if "%1" == "icons_geom" ( set ICONS_GEOM=1 goto EOF + ) else if "%1" == "doc_py" ( + set DOC_PY=1 + goto EOF ) else ( echo Command "%1" unknown, aborting! goto ERR diff --git a/build_files/windows/reset_variables.cmd b/build_files/windows/reset_variables.cmd index 590d4ca246a..8ba7b4d3307 100644 --- a/build_files/windows/reset_variables.cmd +++ b/build_files/windows/reset_variables.cmd @@ -32,4 +32,5 @@ set FORMAT= set TEST= set BUILD_WITH_SCCACHE= set ICONS= -set ICONS_GEOM= \ No newline at end of file +set ICONS_GEOM= +set DOC_PY= diff --git a/build_files/windows/show_help.cmd b/build_files/windows/show_help.cmd index ee5e9d9dbbd..d914ecab2b8 100644 --- a/build_files/windows/show_help.cmd +++ b/build_files/windows/show_help.cmd @@ -31,6 +31,10 @@ echo - 2019 ^(build with visual studio 2019^) echo - 2019pre ^(build with visual studio 2019 pre-release^) echo - 2019b ^(build with visual studio 2019 Build Tools^) +echo. +echo Documentation Targets ^(Not associated with building^) +echo - doc_py ^(Generate sphinx python api docs^) + echo. echo Experimental options echo - with_opengl_tests ^(enable both the render and draw opengl test suites^) diff --git a/extern/nanosvg/README.blender b/extern/nanosvg/README.blender new file mode 100644 index 00000000000..701b5100ca5 --- /dev/null +++ b/extern/nanosvg/README.blender @@ -0,0 +1,7 @@ +Project: NanoSVG +URL: https://github.com/memononen/nanosvg +License: zlib +Upstream version: +Local modifications: Added some functionality to manage grease pencil layers + +Added a fix to SVG import arc and float errors (https://developer.blender.org/rB11dc674c78b49fc4e0b7c134c375b6c8b8eacbcc) diff --git a/source/blender/io/gpencil/nanosvg/nanosvg.h b/extern/nanosvg/nanosvg.h similarity index 100% rename from source/blender/io/gpencil/nanosvg/nanosvg.h rename to extern/nanosvg/nanosvg.h diff --git a/extern/nanosvg/patches/NanoSVG.diff b/extern/nanosvg/patches/NanoSVG.diff new file mode 100644 index 00000000000..68dbb18573b --- /dev/null +++ b/extern/nanosvg/patches/NanoSVG.diff @@ -0,0 +1,86 @@ +diff --git a/c:/tmp/nanosvg_original.h b/c:/tmp/nanosvg_modif.h +index 24a01a86d3d..eca0d07e79d 100644 +--- a/c:/tmp/nanosvg_original.h ++++ b/c:/tmp/nanosvg_modif.h +@@ -24,7 +24,8 @@ + * + * Bounding box calculation based on http://blog.hackers-cafe.net/2009/06/how-to-calculate-bezier-curves-bounding.html + * +- */ ++ * This is a modified version for Blender used by importers. ++ **/ + + #ifndef NANOSVG_H + #define NANOSVG_H +@@ -148,6 +149,8 @@ extern "C" { + typedef struct NSVGshape + { + char id[64]; // Optional 'id' attr of the shape or its group ++ /* Blender: Parent ID used for layer creation. */ ++ char id_parent[64]; + NSVGpaint fill; // Fill paint + NSVGpaint stroke; // Stroke paint + float opacity; // Opacity of the shape. +@@ -370,6 +373,7 @@ int nsvg__parseXML(char* input, + /* Simple SVG parser. */ + + #define NSVG_MAX_ATTR 128 ++#define NSVG_MAX_BREADCRUMB 5 + + enum NSVGgradientUnits + { +@@ -471,6 +475,10 @@ typedef struct NSVGparser + float dpi; + char pathFlag; + char defsFlag; ++ /** Blender breadcrumb for layers. */ ++ char breadcrumb[NSVG_MAX_BREADCRUMB][64]; ++ /** Blender number of elements in breadcrumb. */ ++ int breadcrumb_len; + } NSVGparser; + + static void nsvg__xformIdentity(float* t) +@@ -980,6 +988,14 @@ static void nsvg__addShape(NSVGparser* p) + memset(shape, 0, sizeof(NSVGshape)); + + memcpy(shape->id, attr->id, sizeof shape->id); ++ /* Copy parent id from breadcrumb. */ ++ if (p->breadcrumb_len > 0) { ++ memcpy(shape->id_parent, p->breadcrumb[0], sizeof shape->id_parent); ++ } ++ else { ++ memcpy(shape->id_parent, attr->id, sizeof shape->id_parent); ++ } ++ + scale = nsvg__getAverageScale(attr->xform); + shape->strokeWidth = attr->strokeWidth * scale; + shape->strokeDashOffset = attr->strokeDashOffset * scale; +@@ -2814,6 +2830,14 @@ static void nsvg__startElement(void* ud, const char* el, const char** attr) + if (strcmp(el, "g") == 0) { + nsvg__pushAttr(p); + nsvg__parseAttribs(p, attr); ++ ++ /* Save the breadcrumb of groups. */ ++ if (p->breadcrumb_len < NSVG_MAX_BREADCRUMB) { ++ NSVGattrib *attr_id = nsvg__getAttr(p); ++ memcpy( ++ p->breadcrumb[p->breadcrumb_len], attr_id->id, sizeof(p->breadcrumb[p->breadcrumb_len])); ++ p->breadcrumb_len++; ++ } + } + else if (strcmp(el, "path") == 0) { + if (p->pathFlag) // Do not allow nested paths. +@@ -2874,7 +2898,12 @@ static void nsvg__endElement(void* ud, const char* el) + NSVGparser* p = (NSVGparser*)ud; + + if (strcmp(el, "g") == 0) { +- nsvg__popAttr(p); ++ /* Remove the breadcrumb level. */ ++ if (p->breadcrumb_len > 0) { ++ p->breadcrumb[p->breadcrumb_len - 1][0] = '\0'; ++ p->breadcrumb_len--; ++ } ++ nsvg__popAttr(p); + } + else if (strcmp(el, "path") == 0) { + p->pathFlag = 0; diff --git a/intern/cycles/render/session.cpp b/intern/cycles/render/session.cpp index 19d4a66353d..1a08d8f52d6 100644 --- a/intern/cycles/render/session.cpp +++ b/intern/cycles/render/session.cpp @@ -57,23 +57,26 @@ Session::Session(const SessionParams ¶ms_) stats(), profiler() { - device_use_gl = ((params.device.type != DEVICE_CPU) && !params.background); + device_use_gl_ = ((params.device.type != DEVICE_CPU) && !params.background); TaskScheduler::init(params.threads); - session_thread = NULL; + session_thread_ = NULL; scene = NULL; - reset_time = 0.0; - last_update_time = 0.0; + reset_time_ = 0.0; + last_update_time_ = 0.0; - delayed_reset.do_reset = false; - delayed_reset.samples = 0; + delayed_reset_.do_reset = false; + delayed_reset_.samples = 0; - display_outdated = false; - gpu_draw_ready = false; - gpu_need_display_buffer_update = false; - pause = false; + display_outdated_ = false; + gpu_draw_ready_ = false; + gpu_need_display_buffer_update_ = false; + + pause_ = false; + cancel_ = false; + new_work_added_ = false; buffers = NULL; display = NULL; @@ -127,25 +130,26 @@ Session::~Session() void Session::start() { - if (!session_thread) { - session_thread = new thread(function_bind(&Session::run, this)); + if (!session_thread_) { + session_thread_ = new thread(function_bind(&Session::run, this)); } } void Session::cancel() { - if (session_thread) { + if (session_thread_) { /* wait for session thread to end */ progress.set_cancel("Exiting"); - gpu_need_display_buffer_update = false; - gpu_need_display_buffer_update_cond.notify_all(); + gpu_need_display_buffer_update_ = false; + gpu_need_display_buffer_update_cond_.notify_all(); { - thread_scoped_lock pause_lock(pause_mutex); - pause = false; + thread_scoped_lock pause_lock(pause_mutex_); + pause_ = false; + cancel_ = true; } - pause_cond.notify_all(); + pause_cond_.notify_all(); wait(); } @@ -153,9 +157,9 @@ void Session::cancel() bool Session::ready_to_reset() { - double dt = time_dt() - reset_time; + double dt = time_dt() - reset_time_; - if (!display_outdated) + if (!display_outdated_) return (dt > params.reset_timeout); else return (dt > params.cancel_timeout); @@ -165,48 +169,48 @@ bool Session::ready_to_reset() void Session::reset_gpu(BufferParams &buffer_params, int samples) { - thread_scoped_lock pause_lock(pause_mutex); + thread_scoped_lock pause_lock(pause_mutex_); /* block for buffer access and reset immediately. we can't do this * in the thread, because we need to allocate an OpenGL buffer, and * that only works in the main thread */ - thread_scoped_lock display_lock(display_mutex); - thread_scoped_lock buffers_lock(buffers_mutex); + thread_scoped_lock display_lock(display_mutex_); + thread_scoped_lock buffers_lock(buffers_mutex_); - display_outdated = true; - reset_time = time_dt(); + display_outdated_ = true; + reset_time_ = time_dt(); reset_(buffer_params, samples @@ Diff output truncated at 10240 characters. @@ _______________________________________________ Bf-blender-cvs mailing list [email protected] List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
