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-09-24BLF: Refactor of DPIHarley Acheson
Correction of U.dpi to hold actual monitor DPI. Simplify font sizing by omitting DPI as API argument, always using 72 internally. See D15961 for more details. Differential Revision: https://developer.blender.org/D15961 Reviewed by Campbell Barton
2022-09-20UV: extend custom grid sizes to set each axis separatelyChris Blackbourn
For example, allows a custom UV grid size of 4 x 12. TODO: Fix snapping with custom UV grid sizes. Manifest Tasks: T78391 Differential Revision: https://developer.blender.org/D16000
2022-09-20Cleanup: spellingChris Blackbourn
2022-09-14ViewLayer: Lazy sync of scene data.Monique Dewanchand
When a change happens which invalidates view layers the syncing will be postponed until the first usage. This will improve importing or adding many objects in a single operation/script. `BKE_view_layer_need_resync_tag` is used to tag the view layer to be out of sync. Before accessing `BKE_view_layer_active_base_get`, `BKE_view_layer_active_object_get`, `BKE_view_layer_active_collection` or `BKE_view_layer_object_bases` the caller should call `BKE_view_layer_synced_ensure`. Having two functions ensures that partial syncing could be added as smaller patches in the future. Tagging a view layer out of sync could be replaced with a partial sync. Eventually the number of full resyncs could be reduced. After all tagging has been replaced with partial syncs the ensure_sync could be phased out. This patch has been added to discuss the details and consequences of the current approach. For clarity the call to BKE_view_layer_ensure_sync is placed close to the getters. In the future this could be placed in more strategical places to reduce the number of calls or improve performance. Finding those strategical places isn't that clear. When multiple operations are grouped in a single script you might want to always check for resync. Some areas found that can be improved. This list isn't complete. These areas aren't addressed by this patch as these changes would be hard to detect to the reviewer. The idea is to add changes to these areas as a separate patch. It might be that the initial commit would reduce performance compared to master, but will be fixed by the additional patches. **Object duplication** During object duplication the syncing is temporarily disabled. With this patch this isn't useful as when disabled the view_layer is accessed to locate bases. This can be improved by first locating the source bases, then duplicate and sync and locate the new bases. Will be solved in a separate patch for clarity reasons ({D15886}). **Object add** `BKE_object_add` not only adds a new object, but also selects and activates the new base. This requires the view_layer to be resynced. Some callers reverse the selection and activation (See `get_new_constraint_target`). We should make the selection and activation optional. This would make it possible to add multiple objects without having to resync per object. **Postpone Activate Base** Setting the basact is done in many locations. They follow a rule as after an action find the base and set the basact. Finding the base could require a resync. The idea is to store in the view_layer the object which base will be set in the basact during the next sync, reducing the times resyncing needs to happen. Reviewed By: mont29 Maniphest Tasks: T73411 Differential Revision: https://developer.blender.org/D15885
2022-09-14Adding `const Scene*` parameter in many areas.Monique Dewanchand
Related to {D15885} that requires scene parameter to be added in many places. To speed up the review process the adding of the scene parameter was added in a separate patch. Reviewed By: mont29 Maniphest Tasks: T73411 Differential Revision: https://developer.blender.org/D15930
2022-09-12Fix T100886: error saving side-by-side stereo EXR image of depth passBrecht Van Lommel
The stereo saving code that combines two image buffers into one did not work correctly when the number of channels is not equal to 4.
2022-09-10Cleanup: replace strncpy with BLI_strncpyCampbell Barton
Also replace strncpy+strcat with BLI_string_join
2022-09-06GPU: remove 'GPU_SHADER_2D_LINE_DASHED_UNIFORM_COLOR'Germano Cavalcante
The only difference between `GPU_SHADER_2D_LINE_DASHED_UNIFORM_COLOR` and `GPU_SHADER_3D_LINE_DASHED_UNIFORM_COLOR` is that in the vertex shader the 2D version uses `vec4(pos, 0.0, 1.0)` and the 3D version uses `vec4(pos, 1.0)`. But VBOs with 2D attributes work perfectly in shaders that use 3D attributes. Components not specified are filled with components from `vec4(0.0, 0.0, 0.0, 1.0)`. So there is no real benefit to having two different shader versions.
2022-09-05GPU: remove 'GPU_SHADER_2D_UNIFORM_COLOR'Germano Cavalcante
The only real difference between `GPU_SHADER_2D_UNIFORM_COLOR` and `GPU_SHADER_3D_UNIFORM_COLOR` is that in the vertex shader the 2D version uses `vec4(pos, 0.0, 1.0)` and the 3D version uses `vec4(pos, 1.0)`. But VBOs with 2D attributes work perfectly in shaders that use 3D attributes. Components not specified are filled with components from `vec4(0.0, 0.0, 0.0, 1.0)`. So there is no real benefit to having two different shader versions. This will simplify porting shaders to python as it will not be necessary to use a 3D and a 2D version of the shaders. In python the new name for '2D_UNIFORM_COLOR'' and '3D_UNIFORM_COLOR' is 'UNIFORM_COLOR', but the old names still work for backward compatibility. Differential Revision: https://developer.blender.org/D15836
2022-09-01Cleanup: Remove/replace View Layer macros.Monique Dewanchand
This patch is a cleanup required before refactoring the view layer syncing process {T73411}. * Remove FIRSTBASE. * Remove LASTBASE. * Remove BASACT. * Remove OBEDIT_FROM_WORKSPACE. * Replace OBACT with BKE_view_layer_active_object. * Replace OBEDIT_FROM_VIEW_LAYER with BKE_view_layer_edit_object. Reviewed By: mont29 Maniphest Tasks: T73411 Differential Revision: https://developer.blender.org/D15799
2022-08-27Cleanup: pass notifiers as constCampbell Barton
2022-08-23ImBuf: Optimize GPU memory by using 1 component format for grayscale imagesJeroen Bakker
This is done by checking the number of bitplanes from the image buffer. We assume that for float buffer to use the same bitplanes as it was a byte buffer. Then, the data of the image buffer is packed at the start of the `rect` or `float_rect` before upload. **Statistics - einar.v004.blend ** Note that not all grayscale textures have been stored as BW images so the amount of memory that can be reduced would be more. Without patch ``` 104 Textures - 3294.99 MB (3294.47 MB over 32x32), 37 RTs - 192.52 MB. Avg. tex dimension: 2201.88x1253.51 (2283.53x2202.13 over 32x32) 464 Buffers - 25.01 MB total 1.24 MB IBs 23.50 MB VBs. 3512.52 MB - Grand total GPU buffer + texture load ``` Patch applied ``` 104 Textures - 2917.66 MB (2917.14 MB over 32x32), 39 RTs - 215.45 MB. Avg. tex dimension: 2221.38x1252.75 (2323.28x2253.47 over 32x32) 467 Buffers - 25.01 MB total 1.24 MB IBs 23.51 MB VBs. 3158.13 MB - Grand total GPU buffer + texture load. ``` Reviewed By: fclem Differential Revision: https://developer.blender.org/D15484
2022-08-17Merge branch 'blender-v3.3-release'Campbell Barton
2022-08-17Cleanup: spelling in commentsCampbell Barton
2022-08-15GPU: replace GLEW with libepoxyChristian Rauch
With libepoxy we can choose between EGL and GLX at runtime, as well as dynamically open EGL and GLX libraries without linking to them. This will make it possible to build with Wayland, EGL, GLVND support while still running on systems that only have X11, GLX and libGL. It also paves the way for headless rendering through EGL. libepoxy is a new library dependency, and is included in the precompiled libraries. GLEW is no longer a dependency, and WITH_SYSTEM_GLEW was removed. Includes contributions by Brecht Van Lommel, Ray Molenkamp, Campbell Barton and Sergey Sharybin. Ref T76428 Differential Revision: https://developer.blender.org/D15291
2022-08-04Cleanup: Fix compile warningsJesse Yurkovich
2022-08-04Fix T97251: Store generated type information for each UDIM tileJesse Yurkovich
Various situations can lead to un-saved UDIM tiles potentially losing their contents. The most notable situation is a save and re-load of a .blend file that has "generated" UDIM tiles that haven't been written to disk yet. Normal "generated" images are reconstructed on demand in these circumstances but UDIM tiles do not retain the information required for reconstruction and empty tiles are presented to the user. This patch stores the generated type information for each tile to solve this particular issue. It also shifts the Image generation info into the 1st tile. The existing DNA fields are deprecated but RNA was modified as to not break API compat. There's two broad changes here that merit special callout: - How to distinguish between a tile that should be reconstructed vs. a tile that should remain empty because loading failed for the UDIMs - How to better handle Image Source changes The first issue is addressed as follows: - Each time a tile is filled with generated content we set a new IMA_GEN_TILE flag - Each time a tile is saved to disk we remove the IMA_GEN_TILE flag - When requesting an ibuf: If the ibuf is null, we check to see if IMA_GEN_TILE is set. If it is set, go ahead and re-create the tile. Otherwise, do nothing. The second set of changes have to do with ensuring that information is carried along as far as possible when the, sometimes destructive, act of changing an Image Source is performed. Behavior should be a bit more natural and expected now; though users will rarely, or should rarely, be modifying this property. The full table describing the behavior is in the differential. Differential Revision: https://developer.blender.org/D14885
2022-08-04Cleanup: formatCampbell Barton
2022-08-03Image: Display GPU layout in `uiTemplateImageInfo`Angus Stanton
Add IMB_gpu_get_texture_format and GPU_texture_format_description to retrieve and 'stringify' an eGPUTextureFormat. These are then used in the image info panel used in several areas across blender. New Information: {F13330937} Reviewed By: jbakker Maniphest Tasks: T99998 Differential Revision: https://developer.blender.org/D15575
2022-07-30Cleanup: Clang tidyHans Goudey
2022-07-26Cleanup: spelling in commentsCampbell Barton
2022-07-25Undo: Improve image undo performanceAlex Parker
When texture painting a lot of time is spent in ED_image_paint_tile_find. This fixes stores the PaintTiles in a blender::Map making ED_image_paint_tile_find an O(1) rather than O(n) operation. When using threading the locking should happen during read as well, still this gives a boost in performance as the read is now much faster. Reviewed By: jbakker Maniphest Tasks: T99546 Differential Revision: https://developer.blender.org/D15415
2022-07-15Render: improve render border operator in image editorBrecht Van Lommel
* Snap border to pixels just outside the drawn border, to more easily select specific pixels by drawing a border inside them. * Support cropped border renders.
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-08Cleanup: spelling in commentsCampbell Barton
Also move mis-placed doc-string.
2022-07-07Fix T99332: resize video in image editor does not update correctlyBrecht Van Lommel
Use the image user from the image editor to correctly get the frame in the operators. Based on patch by Nicolas (john-g-h-doe) with changes by me. Differential Revision: https://developer.blender.org/D15380
2022-07-07Fix: Save modified images during file closeJesse Yurkovich
Regressed in the following commit due to an inverted conditional: {rB1159b63a07fd2cbc7fc48e162d57721c9c85b3f6} Differential Revision: https://developer.blender.org/D15389
2022-06-30Cleanup: Remove scene frame macros (`CFRA` et al.)Julian Eisel
Removes the following macros for scene/render frame values: - `CFRA` - `SUBFRA` - `SFRA` - `EFRA` These macros don't add much, other than saving a few characters when typing. It's not immediately clear what they refer to, they just hide what they actually access. Just be explicit and clear about that. Plus these macros gave read and write access to the variables, so eyesores like this would be done (eyesore because it looks like assigning to a constant): ``` CFRA = some_frame_nbr; ``` Reviewed By: sergey Differential Revision: https://developer.blender.org/D15311
2022-06-22Mask Editor: Add toggle for mask spline drawingSimon Lenz
Adds an overlay option to show/hide the spline points & lines of masks in the Mask Editor. It also moves the "smooth" option up (its position left of the selection dropdown was missleading). {F11847272} This emerged from a discussion in https://developer.blender.org/D12776 Differential Revision: https://developer.blender.org/D13314
2022-06-20Mask Editor: Add mask blending factor for combined overlaySimon Lenz
This adds a new parameter to the "Combined" overlay mode of the mask editor. The "blending factor" allows users to blend the mask exterior with the original footage to visualise the content of the mask in a more intuitive way. The "Alpha" overlay is unaffected by this change. The existing "Combined" overlay is used like before (covering everything outside the mask in black), but can be blended with the slider in the mask overlay to look at the exterior. This is part of an effort to make mask editing more intuitive & easy to use: https://developer.blender.org/T93097 Differential Revision: https://developer.blender.org/D13284
2022-06-20Refactor: De-duplicate mask operator poll functionsSergey Sharybin
The poll function with same semantic was defined in both screen and mask space modules. The only reason for this seems to be that the image editor needed a mask poll function which was private to the mask module. Make the mask editing poll functions public, avoiding code duplication. Also, added a brief explanation about what the poll functions are checking for. No user-level changes are expected to happen.
2022-06-09Cleanup: use const variables & argumentsCampbell Barton
2022-06-09Cleanup: formatCampbell Barton
2022-06-08Paint: Fix Image Editor Cursor Disappearing (T90120)Joseph Eagar
This patch fixes T90120. The fundamental problem is that 2d and the old 3d paint modes share a single Paint struct, ToolSettings->imapaint. This patch is a temporary fix until the new 3d paint mode (which has its own Paint struct) is released. The patch works by listening for `NC_SCENE|ND_MODE` inside `image_listener` in `space_image.c`. It does not use `ED_space_image_paint_update` since that requires a `bMain.` Instead it calls `paint_cursor_start` (which is promoted to `ED_paint_cursor_start`). `image_paint_poll` is also promoted to an `ED_` function. Reviewed By: Campbell Barton Differential Revision: https://developer.blender.org/D14946 Ref D14946
2022-06-03Fix T98580: image flip/invert/resize don't work on active UDIM tileBrecht Van Lommel
2022-06-03Fix T98579: image save operators changing file path to absoluteBrecht Van Lommel
2022-06-03Cleanup: spelling in commentsCampbell Barton
2022-06-01Merge remote-tracking branch 'origin/blender-v3.2-release'Jesse Yurkovich
2022-06-01Fix T96984: Create new image.browse operator for uiTemplateImage layoutsJesse Yurkovich
The existing BUTTONS_OT_file_browse operator that's used for uiTemplateImage layouts fails to work correctly with UDIM textures. This is mainly due to it not realizing that it must tokenize the filepath before signaling that an update has been made. It also doesn't work correctly when executing its SHIFT-click behavior to open the image in an external application. Lastly, it doesn't set the filters to Images and Movies which is suboptimal for the user. The new operator takes the unique features of BUTTONS_OT_file_browse and creates a customized variant better suited for images. Differential Revision: https://developer.blender.org/D14824
2022-05-31Cleanup: tabs to spaces for CMake files & sort file-listsCampbell Barton
2022-05-30Fix T98444: Image.save_render not using scene output file typeBrecht Van Lommel
Also simplify logic because (source == IMA_SRC_VIEWER) and ELEM(type, IMA_TYPE_R_RESULT, IMA_TYPE_COMPOSITE) are the same thing.
2022-05-28Merge remote-tracking branch 'origin/blender-v3.2-release'Jesse Yurkovich
2022-05-28Re-fix T97366: Support single-file UDIMsJesse Yurkovich
The original fix for T97366 was too restrictive and breaks real-world cases of single-file UDIM textures. See D13297 for an example. This patch effectively reverts the original fix and instead fixes the downstream code to accept single-file ranges as necessary. Note: This means it is very important for users to make use of the "UDIM detection" option during `image.open` or drag n' drop scenarios in order to declare their intent when loading their files. Differential Revision: https://developer.blender.org/D14853
2022-05-27GPU: Remove cached full/scaled image texture.Jeroen Bakker
full scaled image isn't used anymore. It was added to use a different scale when displaying an image in the image editor. This was replaced by the image engine redesign. This change will reduce complexity of {T98375}.
2022-05-163D Texturing: Undo.Jeroen Bakker
Blender can only support a single undo system per undo step. As sculpting/vertex colors are mutual exclusive operations out approach is just to switch the undo system when painting on an image. PBVHNodes contain a list of areas that needs to be pushed to the undo system. Currently the undo code is in sculpt_paint_image. We should eventually support undo for color filtering and other nodes. we might need to place it to its own compile unit so more brushes can invoke the same code. {F13048942} Reviewed By: brecht Maniphest Tasks: T97479 Differential Revision: https://developer.blender.org/D14821
2022-05-16Python API: make Image.save and Image.save_render more consistent with operatorBrecht Van Lommel
Previously these only supported a subset of what the save operator could do, for example no multilayer or stereo saving, no proper color management. Now share code with the image save operator so it's more consistent.
2022-05-16Fix T98153: bpy.ops.image.save_as not working from Python, after recent changesBrecht Van Lommel
Make exec and invoke consistent so they both use operator properties if set.
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 code and data copying image save as operatorBrecht Van Lommel
Store ImageSaveOptions directly in operator custom data instead of copying to/from a copy on the stack. Ref D14899