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
2022-07-15Cleanup: add utlity function to compute render resolutionBrecht Van Lommel
Instead of duplicating logic many times.
2022-07-15Cleanup: Use const pointers for ImageSaveOptions and ImageFormatDataJesse Yurkovich
Use const pointers to ImageSaveOptions and ImageFormatData for API parameters where appropriate. Differential Revision: https://developer.blender.org/D15400
2022-07-01Fix T99315: Unit plane track deform compositor node leads to unnecessary blurSergey Sharybin
2022-06-30Fix numerical issues with plane track compositor node with empty inputSergey Sharybin
No changes in the interface, but avoids spam in the console about inability to find a solution for homography transform from singularity.
2022-06-09Cleanup: spelling in comments & variablesCampbell Barton
2022-05-13Color Management: various improvements and fixes for image savingBrecht Van Lommel
* Respect the image file color space setitng for saving in various cases where it was previously ignored. Previously it would often use the sRGB or Linear color space even when not selected. * For the Save As operator, add a Color Space option in the file browser to choose the color space of the file. Previously this was chosen automatically, now it's possible to e.g. resave a Linear image as Linear ACES. * When changing the file format, the colorspace is automatically changed to an appropriate color space for the file format. This already happened before, but there was no visibility or control in the operator settings for this. * Don't change color space when using the Save operator to save over the same file. * Fix missing color space conversion for 16 bit PNGs, where it assumed wrongly assumed ibuf->rect would be used for saving. Add BKE_image_format_is_byte to more accurately test this. Fixes T74610 Ref T68926 Differential Revision: https://developer.blender.org/D14899
2022-05-12Cleanup: remove redundant float to byte conversion for stereo image savingBrecht Van Lommel
For non-stereo cases this is automatically handled by IMB_saveiff, no reason for stereo to do this separately. Ref D14899
2022-05-11Cleanup: use 'num' / 'size' suffix instead of 'sz'Campbell Barton
GPU code used `sz` as an abbreviation for size, as well as a few other places. Use size where this represents a size in bytes, see: T85728.
2022-05-04Nodes: Add general Combine/Separate Color nodesHallam Roberts
Inspired by D12936 and D12929, this patch adds general purpose "Combine Color" and "Separate Color" nodes to Geometry, Compositor, Shader and Texture nodes. - Within Geometry Nodes, it replaces the existing "Combine RGB" and "Separate RGB" nodes. - Within Compositor Nodes, it replaces the existing "Combine RGBA/HSVA/YCbCrA/YUVA" and "Separate RGBA/HSVA/YCbCrA/YUVA" nodes. - Within Texture Nodes, it replaces the existing "Combine RGBA" and "Separate RGBA" nodes. - Within Shader Nodes, it replaces the existing "Combine RGB/HSV" and "Separate RGB/HSV" nodes. Python addons have not been updated to the new nodes yet. **New shader code** In node_color.h, color.h and gpu_shader_material_color_util.glsl, missing methods hsl_to_rgb and rgb_to_hsl are added by directly converting existing C code. They always produce the same result. **Old code** As requested by T96219, old nodes still exist but are not displayed in the add menu. This means Python scripts can still create them as usual. Otherwise, versioning replaces the old nodes with the new nodes when opening .blend files. Differential Revision: https://developer.blender.org/D14034
2022-04-01Fix compositor memory leak after recent color management changesBrecht Van Lommel
2022-03-31Cleanup: spelling, trailing space for comment-blocksCampbell Barton
2022-03-22Cleanup: refactor passing of color management settings for image saveBrecht Van Lommel
Make a copy of ImageFormatData that contains the effective color management settings, and pass that along to the various functions. This will make it possible to add more complex logic later. For compositing nodes, passing along view and display settings through many functions made it harder to add additional settings, so just get those from the scene now. Differential Revision: https://developer.blender.org/D14401
2022-03-22Cleanup: add proper IMB_openexr.h instead of including file from intern/Brecht Van Lommel
2022-03-21Cleanup: add image_format.cc for functions related to ImageFormatDataBrecht Van Lommel
Also fixes missing code to read/write/free/copy color management settings in various places. This can't be set through the UI currently, but still should be handled consistently.
2022-03-19Revert "Compositor: Support backdrop offset for the Viewer node"Brecht Van Lommel
This reverts commit 33409f9f1cd42e899f2706fe7878e5e89b50d617, as it breaks panning in the image editor. Fixes T96543
2022-03-17Compositor: Support backdrop offset for the Viewer nodeHabib Gahbiche
This is only part of the experimental "Full Frame" mode (disabled by default). See T88150. Currently the viewer node uses buffer paddings to display image offset in the backdrop as a temporal solution implemented for {D12466}. This solution is inefficient memory and performance-wise. Another issue is that the paddings are part the image when saved. This patch instead sets the offset in the Viewer node image as variables and makes the backdrop take it into account when drawing the image or any related gizmo. Reviewed By: jbakker Differential Revision: https://developer.blender.org/D12750
2022-03-16Cleanup: incorrect comments, use C commentsCampbell Barton
2022-02-22Merge branch 'blender-v3.1-release'Campbell Barton
2022-02-22Cleanup: clang-formatCampbell Barton
2022-02-21Merge branch 'blender-v3.1-release'Habib Gahbiche
2022-02-21Fix T95413: Blur node size input crashHabib Gahbiche
Bug was introduced in D12167. Reading input size from an input socket is not possible in tiled compositor before execution is initialized. A similar change was done for the base class, see BlurBaseOperation::init_data(). Reviewed by: Jeroen Bakker Differential Revision: https://developer.blender.org/D14067
2022-02-18Merge branch 'blender-v3.1-release'Jeroen Bakker
2022-02-18Fix T95809: Compositor Node not directly updated in image editor.Jeroen Bakker
Image wasn't tagged to be dirty.
2022-02-14Merge branch 'blender-v3.1-release'Jeroen Bakker
2022-02-14Fix T95699: Compostior backdrop not updated.Jeroen Bakker
The Viewer marked the gpu texture to be out of date. But it should have used the mark_full_update as the gpu textures are only used by the render/draw engines. The image/node editor uses the image engine that have its own GPU textures.
2022-02-11File headers: add missing copyright, add MIT to SPDX licensesCampbell Barton
2022-02-11File headers: SPDX License migrationCampbell Barton
Use a shorter/simpler license convention, stops the header taking so much space. Follow the SPDX license specification: https://spdx.org/licenses - C/C++/objc/objc++ - Python - Shell Scripts - CMake, GNUmakefile While most of the source tree has been included - `./extern/` was left out. - `./intern/cycles` & `./intern/atomic` are also excluded because they use different header conventions. doc/license/SPDX-license-identifiers.txt has been added to list SPDX all used identifiers. See P2788 for the script that automated these edits. Reviewed By: brecht, mont29, sergey Ref D14069
2022-02-10Merge branch 'blender-v3.1-release'Sergey Sharybin
2022-02-10Fix strict warning initializing texture result in compositorSergey Sharybin
From a strict language point of view the code required a braces around `trgba` initialization. But it is easier to rely on the fact that fields which are not specified are zero-initialized.
2022-02-09Cleanup: use consistent copyright location, move descriptionsCampbell Barton
Order copyright immediately after the license block, this was done almost everywhere with a few exceptions. Remove authors from a few files (we had already removed "Contributors" section however with old patches being applied this gets added back in). Also move descriptive text into the doxygen comment block under \file. In some cases remove the text as it was accidentally copied.
2022-01-28Remove compilation warnings TexResult.Jeroen Bakker
2022-01-25Cleanup: Correct location of node function declarationsHans Goudey
Currently there are many function declarations in `BKE_node.h` that don't actually have implementations in blenkernel. This commit moves the declarations to `NOD_composite.h`, `NOD_texture.h`, and `NOD_shader.h` instead. This helps to clarify the purpose of the different modules. Differential Revision: https://developer.blender.org/D13869
2022-01-12DNA: Add space clip editor defaultsSimon Lenz
This is my attempt of adding defaults for the space clip editor struct (in line with https://developer.blender.org/T80164). It adds the default allocation for `SpaceClip` and `node_composite_movieclip.cc`. This also solves the error below (for C++ files using the DNA_default_alloc), which was put forward by Sergey Sharybin. Differential Revision: https://developer.blender.org/D13367 Reviewed by: Julian Eisel
2022-01-12Revert "BLI: Refactor vector types & functions to use templates"Clément Foucault
Includes unwanted changes This reverts commit 46e049d0ce2bce2f53ddc41a0dbbea2969d00a5d.
2022-01-12BLI: Refactor vector types & functions to use templatesClment Foucault
This patch implements the vector types (i.e:`float2`) by making heavy usage of templating. All vector functions are now outside of the vector classes (inside the `blender::math` namespace) and are not vector size dependent for the most part. In the ongoing effort to make shaders less GL centric, we are aiming to share more code between GLSL and C++ to avoid code duplication. ####Motivations: - We are aiming to share UBO and SSBO structures between GLSL and C++. This means we will use many of the existing vector types and others we currently don't have (uintX, intX). All these variations were asking for many more code duplication. - Deduplicate existing code which is duplicated for each vector size. - We also want to share small functions. Which means that vector functions should be static and not in the class namespace. - Reduce friction to use these types in new projects due to their incompleteness. - The current state of the `BLI_(float|double|mpq)(2|3|4).hh` is a bit of a let down. Most clases are incomplete, out of sync with each others with different codestyles, and some functions that should be static are not (i.e: `float3::reflect()`). ####Upsides: - Still support `.x, .y, .z, .w` for readability. - Compact, readable and easilly extendable. - All of the vector functions are available for all the vectors types and can be restricted to certain types. Also template specialization let us define exception for special class (like mpq). - With optimization ON, the compiler unroll the loops and performance is the same. ####Downsides: - Might impact debugability. Though I would arge that the bugs are rarelly caused by the vector class itself (since the operations are quite trivial) but by the type conversions. - Might impact compile time. I did not saw a significant impact since the usage is not really widespread. - Functions needs to be rewritten to support arbitrary vector length. For instance, one can't call `len_squared_v3v3` in `math::length_squared()` and call it a day. - Type cast does not work with the template version of the `math::` vector functions. Meaning you need to manually cast `float *` and `(float *)[3]` to `float3` for the function calls. i.e: `math::distance_squared(float3(nearest.co), positions[i]);` - Some parts might loose in readability: `float3::dot(v1.normalized(), v2.normalized())` becoming `math::dot(math::normalize(v1), math::normalize(v2))` But I propose, when appropriate, to use `using namespace blender::math;` on function local or file scope to increase readability. `dot(normalize(v1), normalize(v2))` ####Consideration: - Include back `.length()` method. It is quite handy and is more C++ oriented. - I considered the GLM library as a candidate for replacement. It felt like too much for what we need and would be difficult to extend / modify to our needs. - I used Macros to reduce code in operators declaration and potential copy paste bugs. This could reduce debugability and could be reverted. - This touches `delaunay_2d.cc` and the intersection code. I would like to know @howardt opinion on the matter. - The `noexcept` on the copy constructor of `mpq(2|3)` is being removed. But according to @JacquesLucke it is not a real problem for now. I would like to give a huge thanks to @JacquesLucke who helped during this and pushed me to reduce the duplication further. Reviewed By: brecht, sergey, JacquesLucke Differential Revision: https://developer.blender.org/D13791
2022-01-12Revert "BLI: Refactor vector types & functions to use templates"Clément Foucault
Reverted because the commit removes a lot of commits. This reverts commit a2c1c368af48644fa8995ecbe7138cc0d7900c30.
2022-01-12BLI: Refactor vector types & functions to use templatesClément Foucault
This patch implements the vector types (i.e:float2) by making heavy usage of templating. All vector functions are now outside of the vector classes (inside the blender::math namespace) and are not vector size dependent for the most part. In the ongoing effort to make shaders less GL centric, we are aiming to share more code between GLSL and C++ to avoid code duplication. Motivations: - We are aiming to share UBO and SSBO structures between GLSL and C++. This means we will use many of the existing vector types and others we currently don't have (uintX, intX). All these variations were asking for many more code duplication. - Deduplicate existing code which is duplicated for each vector size. - We also want to share small functions. Which means that vector functions should be static and not in the class namespace. - Reduce friction to use these types in new projects due to their incompleteness. - The current state of the BLI_(float|double|mpq)(2|3|4).hh is a bit of a let down. Most clases are incomplete, out of sync with each others with different codestyles, and some functions that should be static are not (i.e: float3::reflect()). Upsides: - Still support .x, .y, .z, .w for readability. - Compact, readable and easilly extendable. - All of the vector functions are available for all the vectors types and can be restricted to certain types. Also template specialization let us define exception for special class (like mpq). - With optimization ON, the compiler unroll the loops and performance is the same. Downsides: - Might impact debugability. Though I would arge that the bugs are rarelly caused by the vector class itself (since the operations are quite trivial) but by the type conversions. - Might impact compile time. I did not saw a significant impact since the usage is not really widespread. - Functions needs to be rewritten to support arbitrary vector length. For instance, one can't call len_squared_v3v3 in math::length_squared() and call it a day. - Type cast does not work with the template version of the math:: vector functions. Meaning you need to manually cast float * and (float *)[3] to float3 for the function calls. i.e: math::distance_squared(float3(nearest.co), positions[i]); - Some parts might loose in readability: float3::dot(v1.normalized(), v2.normalized()) becoming math::dot(math::normalize(v1), math::normalize(v2)) But I propose, when appropriate, to use using namespace blender::math; on function local or file scope to increase readability. dot(normalize(v1), normalize(v2)) Consideration: - Include back .length() method. It is quite handy and is more C++ oriented. - I considered the GLM library as a candidate for replacement. It felt like too much for what we need and would be difficult to extend / modify to our needs. - I used Macros to reduce code in operators declaration and potential copy paste bugs. This could reduce debugability and could be reverted. - This touches delaunay_2d.cc and the intersection code. I would like to know @Howard Trickey (howardt) opinion on the matter. - The noexcept on the copy constructor of mpq(2|3) is being removed. But according to @Jacques Lucke (JacquesLucke) it is not a real problem for now. I would like to give a huge thanks to @Jacques Lucke (JacquesLucke) who helped during this and pushed me to reduce the duplication further. Reviewed By: brecht, sergey, JacquesLucke Differential Revision: http://developer.blender.org/D13791
2022-01-12Cleanup: remove redundant const qualifiers for POD typesCampbell Barton
2022-01-11Cleanup: Deduplicate `finv_test` functionAaron Carlisle
2022-01-10Compositing Convert color space nodeJeroen Bakker
Compositor node to convert between color spaces. Conversion is skipped when converting between the same color spaces or to or from data spaces. Implementation done for tiled and full frame compositor. Reviewed By: Blendify, jbakker Differential Revision: https://developer.blender.org/D12481
2022-01-10Cleanup: note that compositor vector blur shares logic with zbuf.cCampbell Barton
Note that some functions have been copied between these files. De-duplication isn't trivial as there are differences in some functions.
2022-01-07Cleanup: remove redundant const qualifiers for POD typesCampbell Barton
MSVC used to warn about const mismatch for arguments passed by value. Remove these as newer versions of MSVC no longer show this warning.
2022-01-04Fix T90830: Crop node cropping is one pixel shortManuel Castilla
Currently the crop higher limits are inclusive too which contradicts the documentation as it says that if Left and Right are both 50, it will result in a zero-sized image. And the result is one pixel out of the crop gizmo, which is another hint that this is not intended. In "Full Frame" experimental mode it's two pixels short because of a misuse of `BLI_rcti_isect_pt` as it considers max limits inclusive. Reviewed By: jbakker Maniphest Tasks: T90830 Differential Revision: https://developer.blender.org/D12786
2021-12-25Cleanup: use new c++ guarded allocator APIAaron Carlisle
API added in rBa3ad5abf2fe85d623f9e78fefc34e27bdc14632e
2021-12-09Cleanup: move public doc-strings into headers for 'compositor'Campbell Barton
Ref T92709
2021-12-08Cleanup: Silence clang-tidy warnings.Jeroen Bakker
2021-11-29Merge branch 'blender-v3.0-release'Jacques Lucke
2021-11-29Fix T93310: crash due to broken image pathsJacques Lucke
The crash was caused by allocating an uninitialized amount of memory. This fix initializes a bunch of variables that could cause the error. It should be possible to also fix this in the function that actually uses the uninitialized memory, but that could cause unknown consequences that are a bit too risky for 3.0. Just initializing some variables should be safe though. For more details see D13369. Differential Revision: https://developer.blender.org/D13369
2021-11-19Cleanup: typos in commentsPhilipp Oeser
2021-11-02Images: refactor how failed image load attempts are rememberedJacques Lucke
Previously, `ImageTile->ok` and `ImageUser->ok` were used to indicate whether an image failed to load. There were three possible values which (probably) had the following meanings: * `0`: There was an error while loading the image. Don't try to load again. * `1`: Default value. Try to load the image. * `2`: The image was loaded successfully. This image-wide flag did not make sense unfortunately, because loading may work for some frames of an image sequence but not for others. Remember than an image data block can also contain a movie. The purpose of the `->ok` flag was to serve as an optimization to avoid trying to load a file over and over again when there is an error (e.g. the file does not exist or is invalid). To get the optimization back, the patch is changing `MovieCache` so that it can also cache failed load attempts. As a consequence, `ibuf` is allowed to be `NULL` in a few more places. I added the appropriate null checks. This also solves issues when image sequences are used with the Image Texture node in Geometry nodes (also see D12827). Differential Revision: https://developer.blender.org/D12957