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
AgeCommit message (Collapse)Author
2021-02-05Fix integer types in ImBuf leading to warningsSergey Sharybin
Replace `long long` with an explicit `int64_t`. This is also what is used in the FFmpeg headers. Fixes clang diagnostics warning about wrong format used in the log. Should be no functional changes.
2021-02-05Cleanup: correct spelling in commentsCampbell Barton
2021-02-03BPY: allow `bpy.data.libraries.load()` to filter out non-asset data-blocks.Bastien Montagne
Differential Revision: https://developer.blender.org/D10237
2021-01-29Merge branch 'blender-v2.92-release'Philipp Oeser
2021-01-29Fix T84661: read jpg pixel densityPhilipp Oeser
For jpeg, an image.resolution was always based on the default 72dpi, now read the pixel density from the jpeg_decompress_struct, convert according to unit and store in IMBuf's ppm. Not 100% sure of all implications tbh., files I have checked seem to work as expected now in the context of the report. Maniphest Tasks: T84661 Differential Revision: https://developer.blender.org/D10166
2021-01-28Merge branch 'blender-v2.92-release'Campbell Barton
2021-01-28Fix jpeg200 4k cinema presetCampbell Barton
Used the wrong define, also remove local defines.
2021-01-24Cleanup: email address formattingCampbell Barton
Match git style email addresses, ignored by the spell checker.
2021-01-20Cleanup: remove extra in trailing asteriskCampbell Barton
Comment blocks not conforming to convention.
2021-01-15Use mmap() IO for reading uncompressed .blendsLukas Stockner
Instead of submitting tons of tiny IO syscalls, we can speed things up significantly by `mmap`ing the .blend file into virtual memory and directly accessing it. In my local testing, this speeds up loading the Dweebs file with all its linked files from 19sec to 10sec (on Linux). As far as I can see, this should be supported on Linux, OSX and BSD. For Windows, a second code path uses `CreateFileMapping` and `MapViewOfFile` to achieve the same result. Reviewed By: mont29, brecht Differential Revision: https://developer.blender.org/D8246
2021-01-14Fix T84167: Saving half-float EXR might result in NaN pixelsSergey Sharybin
Clamp value to the -HALF_MAX .. HALF_MAX. The non-clamped values were causing NaN and inf values saved to the file, which was the root cause of glare node giving unexpected result. The nan/inf on overflow is something mentioned in the half data type in OpenEXR header. Differential Revision: https://developer.blender.org/D10105
2021-01-12Cleanup: use exact check for fread, move out of the loopCampbell Barton
Without this, additional items could be added in the future which wouldn't be included in the check. Move the check out of the loop since this is such an unlikely situation that checking every iteration isn't needed. Also remove redundant casts.
2021-01-12Cleanup: replace 'long long' with int64_t in imbuf indexerCampbell Barton
2021-01-11ImBuf: Add error handling to IMB_indexer_openSybren A. Stüvel
Handle return value of `fread()` by printing an error and closing the file when it cannot be read from. Not only is error handing a good idea, it also prevents GCC from warning that the return value of `fread()` should not be ignored: ``` .../blender/source/blender/imbuf/intern/indexer.c: In function ‘IMB_indexer_open’: .../blender/source/blender/imbuf/intern/indexer.c:201:5: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result] 201 | fread(&idx->entries[i].frameno, sizeof(int), 1, fp); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .../blender/source/blender/imbuf/intern/indexer.c:202:5: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result] 202 | fread(&idx->entries[i].seek_pos, sizeof(unsigned long long), 1, fp); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .../blender/source/blender/imbuf/intern/indexer.c:203:5: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result] 203 | fread(&idx->entries[i].seek_pos_dts, sizeof(unsigned long long), 1, fp); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .../blender/source/blender/imbuf/intern/indexer.c:204:5: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result] 204 | fread(&idx->entries[i].pts, sizeof(unsigned long long), 1, fp); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` Differential Revision: https://developer.blender.org/D9916 Reviewed by: campbellbarton
2021-01-04Cleanup: docy comments beginning with '/**' don't end with '**/'Campbell Barton
2020-12-19Cleanup: Split SEQ_sequencer.h fileRichard Antalik
2020-12-16VSE: Improve motion-picture workflowRichard Antalik
This commit resolves problem introduced in e1665c3d3190 - it was difficult to import media at their original resolution. This is done by using original resolution as reference for scale. All crop and strip transform values and their animation is converted form old files. To make both workflows easy to use, sequencer tool settings have been created with preset for preffered scaling method. This setting is in sequencer timeline header and add image or movie strip operator properties. Two new operators have been added: `sequencer.strip_transform_fit` operator with 3 options: Scale To Fit, Scale to Fill and Stretch To Fill. Operator can fail if strip image or video is not loaded currently, this case should be either sanitized or data loaded on demand. `sequencer.strip_transform_clear` operator with 4 options: Clear position, scale, rotation and all (previous 3 options combined). Reviewed By: sergey, fsiddi Differential Revision: https://developer.blender.org/D9582
2020-12-15Asset System: Various changes to previews in preparation for Asset BrowserJulian Eisel
* Support defining (not necessarily rendering) icons in threads. Needed so the File Browser can expose file previews with an icon-id to scripts. ** For that, ported `icons.c` to C++, to be able to use scope based mutex locks (cleaner & safer code). Had to do some cleanups and minor refactoring for that. * Added support for ImBuf icons, as a decent way for icons to hold the file preview buffers. * Tag previews as "unfinished" while they render in a thread, for the File Browser to dynamically load previews as they get finished. * Better handle cases where threaded preview generation is requested, but the ID type doesn't support it (fallback to single threaded). This is for general sanity of the code (as in, safety and cleanness) * Enabled asset notifier for custom preview loading operator, was just disabled because `NC_ASSET` wasn't defined in master yet. Part of the first Asset Browser milestone. Check the #asset_browser_milestone_1 project milestone on developer.blender.org. Differential Revision: https://developer.blender.org/D9719 Reviewed by: Bastien Montagne, Brecht Van Lommel
2020-12-15Cleanup: reduce indirect DNA header inclusionCampbell Barton
Remove DNA headers, using forward declarations where possible. Also removed duplicate header, header including it's self and unnecessary inclusion of libc system headers from BKE header.
2020-12-09Cleanup: various clang tidy fixesJacques Lucke
2020-12-08Cleanup: Correct an own earlier commit to use an existing utility functionJulian Eisel
Didn't know this function existed, better to use it then to avoid verbosity.
2020-12-08Cleanup: Use guarded allocator for data-block names returned from file readingJulian Eisel
Direcly using the C library allocator functions is usually avoided in favor of our guarded allocator. It's more useful when debugging.
2020-12-07Fix DPX image output having invalid float metadataBrecht Van Lommel
Casting 0xFFFFFFFF to float does not give NaN as is needed here. Found through compiler warning which is now fixed.
2020-12-07Cleanup: partial Clang-Tidy modernize-loop-convertSybren A. Stüvel
Modernize loops by using the `for(type variable : container)` syntax. Some loops were trivial to fix, whereas others required more attention to avoid semantic changes. I couldn't address all old-style loops, so this commit doesn't enable the `modernize-loop-convert` rule. Although Clang-Tidy's auto-fixer prefers to use `auto` for the loop variable declaration, I made as many declarations as possible explicit. To me this increases local readability, as you don't need to fully understand the container in order to understand the loop variable type. No functional changes.
2020-12-04Cleanup: Clang-Tidy, modernize-use-usingSybren A. Stüvel
Replace `typedef` with `using` in C++ code. In the case of `typedef struct SomeName { ... } SomeName;` I removed the `typedef` altogether, as this is unnecessary in C++. Such cases have been rewritten to `struct SomeName { ... };` No functional changes.
2020-12-04Cleanup: Clang-Tidy, modernize-use-overrideSybren A. Stüvel
No functional changes.
2020-12-04Cleanup: Clang-Tidy, modernize-deprecated-headersSybren A. Stüvel
No functional changes.
2020-12-03Fix linker errors when building without CyclesSybren A. Stüvel
Fix linker errors by explicitly linking PugiXML when OpenImageIO is used. PugiXML has been separated from OpenImageIO (D8628). This means that any time OpenImageIO libraries are linked, the PugiXML libraries have to be linked as well. This was set up correctly for Cycles, but not for imbuf. Because of this, building without Cycles but with OIIO would produce linker errors.
2020-11-17Merge branch 'blender-v2.91-release'Jeroen Bakker
2020-11-17Fix T82042: Crash when rendering huge imagesJeroen Bakker
Crash is related to the definition of the GL_MAX_TEXTURE_SIZE. OpenGL does not clearly defined `GL_MAX_TEXTURE_SIZE` exactly means. Both on AMD and NVIDIA we have issues with huge textures that they don't get created even if they are smaller. (See {D9530} for research). This patch will try to create the texture in a smaller size when the texture creation failed. Final implementation by: Clément Foucault We should create a solution that doesn't need downscaling. For this specific case ARB_sparse_texture might help to create cleaner code, but you still have to commit the whole image what introduces several draw calls. Other improvement is to optimize the scaling; current implementation isn't optimized for performance. Reviewed By: Clément Foucault Differential Revision: https://developer.blender.org/D9524
2020-11-16Merge branch 'blender-v2.91-release' into masterPhilipp Oeser
2020-11-16Fix T82460: Color Management Curves do not update when Image/UV EditorPhilipp Oeser
is present Caused by rB4212b6528afb. 'updateGLSLCurveMapping()' compares cacheIDs and in certain scenarios, these are the same when they should not. - whenever we had multiple viewports that are colormanaged with curvemappings this worked right (cacheIDs were different) - for example, this also worked right when the ImageEditor displays a Render Result or a Compositor Viewer - but it worked wrong when the Image Editor displays any other Image (or no Image at all) - it also worked right if there were multiple Image Editors [and one of them displays a Render Result e.g] Now why is this so? For comparison, the curve mapping's pointer/address is used. - update_glsl_display_processor frees the curve_mapping, see BKE_curvemapping_free(global_glsl_state.curve_mapping) - similar, update_glsl_display_processor creates a new curvemapping, see BKE_curvemapping_copy(view_settings->curve_mapping) - now for the situation that a viewport with curvemapping and a viewport without curvemapping is present and you make changes to the curvemapping the following happens: -- curve_mapping_settings->cache_id is set once [to the memory address of curvemapping before change] -- change happens -- viewport 1 frees curvemapping -- viewport 2 duplicates using BKE_curvemapping_copy, but this one gets the same address like before the change -- this means we have different data on the same address with the same cacheID... Solution: to really make the cache ID unique we can combine the pointer with its 'changed_timestamp' [which increases on every change]. Reviewers: jbakker Maniphest Tasks: T82460 Differential Revision: https://developer.blender.org/D9559
2020-11-13Cleanup: use IMB_FTYPE_NONE instead of 0 for imbuf format comparisonCampbell Barton
Image format code checked the file type against an enum except for zero which is used when the format can't be detected. Also add doc-strings to some of the image file type callbacks.
2020-11-13Merge branch 'blender-v2.91-release'Campbell Barton
2020-11-13Fix memory leak writing PNG when opening the file failsCampbell Barton
2020-11-13Cleanup: remove unnecessary ImFileType.ftype callbackCampbell Barton
This callback made some sense before moving the file-type information from a bit-flag to an enum: e142ae77cadf04103fbc643f21cf60891862f6a8 Since then, we can compare the type value directly. Also replace loops over file types with IMB_file_type_from_{ibuf/ftype}.
2020-11-13Cleanup: imbuf file format callback declarationCampbell Barton
Use named members as this wasn't very readable given the number of unnamed NULL members.
2020-11-12Cleanup: clang-tidy, remove invalid commentsCampbell Barton
2020-11-12ImBuf: pass the number of bytes read to 'is_a' callbacksCampbell Barton
Previously the header was a fixed size and assumed to be zeroed. Now read in bytes up to `HEADER_SIZE`, pass the number or bytes read to the callback which must not read past those bytes.
2020-11-12Cleanup: spellingCampbell Barton
2020-11-11Fix T82602: checking image header reads past buffer boundsCampbell Barton
Use the size argument to ensure checking the header doesn't read past the buffer bounds when reading corrupt/truncated headers from image files.
2020-11-11Cleanup: pass header size to 'is_a' callbacksCampbell Barton
No functional changes, prepare for fixing out-of-bounds access when reading headers.
2020-11-11Cleanup: use 'filepath' instead of 'name' for ImBuf utilitiesCampbell Barton
2020-11-11Cleanup: use bool for imbuf save callbacksCampbell Barton
2020-11-11Cleanup: avoid boolean literals for functions that return intCampbell Barton
2020-11-11Cleanup: use define for targa header sizeCampbell Barton
2020-11-11Cleanup: remove redundant NULL checks in ImFileType.is_a callbackCampbell Barton
Most of these callbacks don't do a NULL check, so there is no need to do this for bmp/png. Also correct radiance_hdr comments.
2020-11-11Merge branch 'blender-v2.91-release'Campbell Barton
2020-11-11ImBuf: replace incorrect strstr use with memcmpCampbell Barton
Besides being incorrect as only the first two bytes should be tested, searching binary data using `strstr` can easily read past buffer bounds.
2020-11-10ImBuf: support detecting the file format from in-memory imagesCampbell Barton
Add `IMB_ispic_type_from_memory` so we can detect the file format of in-memory images. This removes `is_a_filepath` callback and uses a magic check for photo-shop files that's compatible with OIIO. Even though OIIO doesn't support packed images, we can still use the file magic for detecting the format. This change allows D9500 (a fix for unpacking images), to be implemented without a significant performance penalty, although the actual performance cost would depend heavily on the blend file. Reviewed By: dfelinto, sergey Ref D9517