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-11-08Fix deprecation warnings about printf() on macOSSergey Sharybin
The new Xcode 14.1 brings the new Apple Clang compiler which considers sprintf unsafe and geenrates deprecation warnings suggesting to sue snprintf instead. This only happens for C++ code by default, and C code can still use sprintf without any warning. This changes does the following: - Whenever is trivial replace sprintf() with BLI_snprintf. - For all other cases use the newly introduced BLI_sprintf which is a wrapper around sprintf() but without warning. There is a discouragement note in the BLI_sprintf comment to suggest use of BLI_snprintf when the size is known. Differential Revision: https://developer.blender.org/D16410
2022-10-23Fix T101607: Changing Image source inadvertently clears file pathJesse Yurkovich
This could result in wrong behavior depending on the order in which the Image.filepath and Image.source fields are set from within Python for example. Caused by rB72ab6faf5d80
2022-10-17Cleanup: replace BLI_join_dirfile with BLI_path_joinCampbell Barton
These functions are almost identical, the main difference being BLI_join_dirfile didn't trim existing slashes when joining paths however this isn't an important difference that warrants a separate function.
2022-10-04Cleanup: replace UNUSED macro with commented args in C++ codeHans Goudey
This is the conventional way of dealing with unused arguments in C++, since it works on all compilers. Regex find and replace: `UNUSED\((\w+)\)` -> `/*$1*/`
2022-09-25Cleanup: remove redundant parenthesis (especially with macros)Campbell Barton
2022-09-25Cleanup: replace C-style casts with functional casts for numeric typesCampbell Barton
2022-09-25Cleanup: replace static_casts with functional casts for numeric typesCampbell Barton
2022-09-25Cleanup: use 'u' prefixed integer types for brevity & cast styleCampbell Barton
To use function style cast '(unsigned char)x' can't be replaced by 'unsigned char(x)'.
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-23Cleanup: use ELEM macroCampbell Barton
2022-09-17Fix T100330: Remove Render Slot not working for first slotLukas Stockner
This bug was caused by the weird ownership logic for render results. Basically, the most recent render result is owned by the Render, while all others are owned by the RenderSlots. When a new render is started, the previous Render is handed over to its slot, and the new slot is cleared. So far, so good. However, when a slot is removed and happens to be the one with the most recent render, this causes a complication. The code handles this by making another slot the most recent one, along with moving its result back to the Render, as if that had always been the most recent one. That works, unless there is no most recent render because you haven't rendered anything yet. Unfortunately, there is no way to store "there hasn't been a render yet", so the code still tries to perform this handover but can't. Previously, the code handled that case by just refusing to delete the slot. However, this blocks users from deleting this slot. But of course, if there hasn't been a render yet, the slots will not contain anything yet, so this entire maneuver is pointless. Therefore, the fix for the bug is to just skip it altogether if there is no Render instead of failing the operation. Technically, there is a weird corner case remaining, because Renders are per-scene. Therefore, if a user renders images in one scene, switches to a different scene, deletes a slot there and then switches back, in some situations the result in the deleted slot might end up in the next slot. Unfortunately this is just a limitation of the weird split ownership logic and can't just be worked around. The proper fix for this probably would be to hand over ownership of the result from the Render to the RenderSlot once the render is done, but this is quite complex. Also fixes a crash when iuser->scene is NULL.
2022-09-16Cleanup: spelling in commentsCampbell Barton
2022-09-08IDManagement: change `IDTypeInfo.owner_get` to instead return address of the ↵Bastien Montagne
owner_id pointer. Also rename the callback. That way, we can keep moving toward a more generic handling of those embedded IDs (think e.g. about copy code).
2022-08-28Cleanup: replace NULL with nullptr for C++ filesCampbell Barton
2022-08-22Merge branch 'blender-v3.3-release'Bastien Montagne
Conflicts: release/scripts/startup/bl_ui/space_userpref.py
2022-08-22I18n: disambiguate a few translationsDamien Picard
- Keying (keyframe insertion) - Roughness (particle children) - New image, collection, text (in menus) - Parents (particles) - Wrap (text) - Light (add menu) - Empty (volume add menu) - Empty (empty add menu) - Cycles (f-curve modifier) - Drag (workspace tool type) - Power (light intensity) - Power (math nodes) This last change also moves all math operations in nodes to the ID_nodetree context. It's needed only for some operations, but we can't be more granular here. Also... - Fix context extraction for interpolation mode headers in F-Curves and GPencil interpolation operator - Enable new translation: "Slot %d" in image editor - Fix an English message in the node editor: "Replace the input image's alpha channels by..." -> channel Ref. T43295 Reviewed By: mont29 Differential Revision: https://developer.blender.org/D15694
2022-08-15Fix regression: crash with uv constrain to bounds without imageChris Blackbourn
Merge confusion between cc1daa9b766d and 0d62e963b06e.
2022-08-08Merge branch 'blender-v3.3-release'Germano Cavalcante
2022-08-08Fix T100281: image save after copy not using correct filepathBrecht Van Lommel
Always use the image datablock filepath for saving. The only apparent reason use the image buffer file path is image sequences, for which the current frame filepath is now computed.
2022-08-05Merge remote-tracking branch 'origin/blender-v3.3-release'Jesse Yurkovich
2022-08-05Fix T100142: Compare correct render_slot variable during clear operationJesse Yurkovich
In {rB0ef8a6179d2a773b2570352bd0cb7eb18b666da2} the parameter name was changed to match the header declaration (slot) but it missed updating the variable name inside the function correctly in one instance. This prevents slot 0 from being cleared if the last slot to be rendered was not also 0. Differential Revision: https://developer.blender.org/D15620
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: spelling, code-blocksCampbell Barton
2022-08-04Cleanup: quiet nonnull-compare warning for GCCCampbell Barton
All callers ensure this is not NULL.
2022-08-03Merge branch 'blender-v3.3-release'Brecht Van Lommel
2022-08-03Fix T100106: image movie/sequence auto refresh affects still image performanceBrecht Van Lommel
2022-08-03Fix unreported: Add tie-break conditions for udim search with integersChris Blackbourn
When searching for closest UDIM with integer co-ordinates, several UDIMs can be equidistant. Previously, of all closest UDIMs, the one which was earliest in the list would be used. Now, "half-open interval" rules are used to break the tie. Motivated by 0fcc04e7bfe1 Differential Revision: https://developer.blender.org/D15590
2022-07-30Fix 100035: Make UDIM detection less aggressiveJesse Yurkovich
There's been a handful of reports where "obviously" not a UDIM filenames were detected as such during image open.[1] This change makes the detection less aggressive by enforcing that the 4-digit sequence be delineated on both sides by one of the following 3 characters ., -, _ This fixes the problem for such filenames as: "screenshot-1080p.png", "Image-1920x1080.png", "(1999) Photo.png", and "antiguaChestnut_X_1240Wx814H.png" [1] T97366 T98918 T99154 T100035 Differential Revision: https://developer.blender.org/D15573
2022-07-24Cleanup: Fix off-by-half-errors with udim searchChris Blackbourn
2022-07-22Cleanup: add BKE_image_find_nearest_tile_with_offsetCampbell Barton
Every caller BKE_image_find_nearest_tile was calculating the tile offset so add a version of this function that returns the offset too.
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-01Add helper function to replace buffer of a single-frame imageSergey Sharybin
Very similar to BKE_image_add_from_imbuf with the exception that no new image data-block is created, but instead the given one is modified.
2022-07-01Fix possible wrong image color space when it is created from image bufferSergey Sharybin
From quick look it doesn't seem to be leading to real issues yet as the image buffers are created with the default roles, but valid color space is needed to be ensured for an upcoming development.
2022-07-01Fix image-from-imbuf resulting in invalid image configurationSergey Sharybin
The image which source is set to file is not expected to have empty file path. If it happens it becomes very tricky to save the image on exit using the standard quit dialog. This change makes it so if the image buffer does not have file path then the new image is set to the "generated" source and it behaves as if the image was created like so and was fully painted on. Additionally, mark image as dirty, so that quitting Blender after such image was added will warn about possible data loss.
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-30Cleanup: spelling in commentsCampbell Barton
2022-06-17Cleanup: remove redundant string formattingCampbell Barton
2022-06-10Cleanup: Clang tidyHans Goudey
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-12Cleanup: discarded-qualifier warning, mixing enum/intsCampbell Barton
2022-05-12UDIM: Add support for packing inside .blend filesJesse Yurkovich
This completes support for tiled texture packing on the Blender / Cycles side of things. Most of these changes fall into one of three categories: - Updating Image handling code to pack/unpack tiled and multi-view images - Updating Cycles to handle tiled textures through BlenderImageLoader - Updating OSL to properly handle textures with multiple slots Differential Revision: https://developer.blender.org/D14395
2022-04-23Bake: add UDIM tile baking supportBrecht Van Lommel
Works for both Cycles and multires bake. Triangles are baked to multiple UDIM images if they span across them, though such UV layouts are generally discouraged as there is no filtering across UDIM tiles. The bake margin currently only works within UDIM tiles. For the extend method this is logical, for the adjacent faces method it may be useful to support copying pixels from other UDIM tiles, though this seems somewhat complicated. Fixes T95190 Ref T72390
2022-04-17Fix T97366: Misdetection of numbers as UDIMs in certain filepathsJesse Yurkovich
In some circumstances singular files with numbers in their name (like turntable-1080p.png or frame-1042.png) might be detected as a UDIM. The root cause in this particular instance was because `BKE_image_get_tile_info` believed this file to be a tiled texture and replaced the filename with a tokenized version of it. However, later on, the code inside `image_open_single` did not believe it was tiled because only 1 file was detected and our tiled textures require at least 2. This discrepancy lead to the broken filename situation. This was a regression since rB180b66ae8a1f as that introduced the tokenization changes. Differential Revision: https://developer.blender.org/D14667
2022-04-13Cleanup: avoid redundant float/int conversions in BLFCampbell Barton
Internally many offsets for BLF were integers but exposed as floats, since these are used in pixel-space, many callers were converging them back to integers. Simplify logic by using ints.
2022-04-11Cleanup: use doxy-comments and `r_` prefix return argumentsCampbell Barton
2022-04-06Fix badly broken caches handling during undo/redo.Bastien Montagne
Original rework of caches during undo/redo (see D8183) had a very bad flaw hidden in it: using the key of a ghash as source of data. While this was effectively working then (cache pointer itself being part of the key, and said cache pointers not being cleared on file write), this is a general very bad way to do things. Now that cache pointers are more and more cleared on file write (as part of clearing runtime-data to reduce false-positives when checking if an ID has changed or not), this has to be fixed properly by: * Not storing the cache pointer itself in the IDCacheKey. * In undo context, in readfile code trying to preserve caches, store the cache pointers as values of the mapping, together with the usages counter The first change potentially affects all usages of `BKE_idtype_id_foreach_cache`, but in practice this code is only used by memfile reading code (i.e. undo) currently. Related to T97015. Reviewed By: brecht Maniphest Tasks: T97015 Differential Revision: https://developer.blender.org/D14559
2022-03-28Cleanup: Reduce duplication to prepare for UDIM packingJesse Yurkovich
In preparation for supporting packing of UDIM tiled textures, this patch refactors a small portion of image.cc. The refactor should lead to less duplicate code now and when Tiled images are added in the near future. This patch is based on the prior work done for D6492 where it was requested this part be split and can be summarized as follows: - `load_sequence_single` is removed and merged with `load_image_single` - `image_load_sequence_file` is removed and merged with `image_load_image_file` Reviewed By: lukasstockner97 Differential Revision: https://developer.blender.org/D14327