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-12-01Add layer and pass index parameters to rna_Image_gl_loadPaul Golter
This patch adds a layer_idx and pass_idx parameter to the rna_Image_gl_load function. It exposes both to the Python API as optional parameters. This allows python scripters to specifiy which layer and pass they want to load in to an OpenGL texture. Right now image.gl_load() always takes the first layer and first pass. This is limiting when working with multilayer openEXRs. With this patch scripters can do something like this: ``` pass_idx = area.spaces.active.image_user.multilayer_pass layer_idx = area.spaces.active.image_user.multilayer_layer image.gl_load(frame=0, layer_idx=layer_idx, pass_idx=pass_idx) ``` As the parameters are optional and default to 0, it should not break existing code. Reviewed By: campbellbarton Differential Revision: https://developer.blender.org/D13435
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
2021-07-03Cleanup: consistent use of tags: NOTE/TODO/FIXME/XXXCampbell Barton
Also use doxy style function reference `#` prefix chars when referencing identifiers.
2021-01-04Fix T84191: remove python API limits for Image.scale() dimensionsPhilipp Oeser
Since the introduction in 2c23bb838979131667c922df1f01738e02e6ca16, these were set to 10000 each. This seems like an arbitrary limit (BKE_image_scale / IMB_scaleImBuf don't have limits and I couldn't spot similar size restrictions in image relating functions), now match what we do for creating images (rna_Main_images_new), use INT_MAX. Ref D9950
2020-12-24UI: Cleanup spelling of compound wordsYevgeny Makarov
Approximately 138 changes in the spelling of compound words and proper names like "Light Probe", "Shrink/Fatten", "Face Map". In many cases, hyphens were used where they aren't correct, like "re-fit". Other common changes include: - "Datablock" -> "data-block" - "Floating point" -> "floating-point" - "Ngons" -> "n-gons" These changes help give the language used in the interface a consistent, more professional feel. Differential Revision: https://developer.blender.org/D9923
2020-10-19Spelling: It's Versus ItsHarley Acheson
Corrects incorrect usage of contraction for 'it is', when possessive 'its' was required. Differential Revision: https://developer.blender.org/D9250 Reviewed by Campbell Barton
2020-09-19Cleanup: consistent TODO/FIXME formatting for namesCampbell Barton
Following the most widely used convention for including todo's in the code, that is: `TODO(name):`, `FIXME(name)` ... etc.
2020-07-30Cleanup: Split gpu_texture_image.c into BKE and IMB modulesClément Foucault
This is in order to disolve GPU_draw.h into more meaningful code blocks. All the Image related function are in `image_gpu.c`. All the MovieClip related function are in `movieclip.c`. The IMB module now has a connection with GPU. This is not strickly necessary and the code could be move to `image_gpu.c` if needed. The Image garbage collection is also ported to `image_gpu.c`.
2020-07-30RNA: Image API: Fix error in NULL check in rna_Image_gl_touchClément Foucault
This check was always returning true.
2020-07-26Cleanup: GPU: Remove glew headers part2Clément Foucault
2020-07-26Cleanup: Image: Rename redundant enum for clarityClément Foucault
2020-07-26GPUTexture: Replace GL textarget enum by Image enumClément Foucault
2020-06-23Cleanup: rename 'name' to 'filepath' for DNA typesCampbell Barton
Using 'name' for the full path of a file reads badly, especially when id.name is used in related code.
2020-03-19Cleanup: `make format` after SortedIncludes changeDalai Felinto
2020-01-29Fix T73188: RenderResult as Camera BG ImageJeroen Bakker
In blender 2.79 you could use a render result as a camera background image. This is useful during layout/compositing. During Blender 2.80 development there were 2 issues introduced that removed this feature. * to receive a render result the image required a lock. This lock wasn't passed and therefore no image was read from the result. Generating an GPUTexture from an Blender image also didn't do the locking. * the iuser->scene field wasn't set what is required for render results. This change adds an optional `ibuf` parameter to `GPU_texture_from_blender` that can be passed when available. Reviewed By: fclem, brecht Differential Revision: https://developer.blender.org/D6684
2020-01-16Fix T73133: UDIM texture count in Eevee is limited by OpenGLLukas Stockner
Based on @fclem's suggestion in D6421, this commit implements support for storing all tiles of a UDIM texture in a single 2D array texture on the GPU. Previously, Eevee was binding one OpenGL texture per tile, quickly running into hardware limits with nontrivial UDIM texture sets. Workbench meanwhile had no UDIM support at all, as reusing the per-tile approach would require splitting the mesh by tile as well as texture. With this commit, both Workbench as well as Eevee now support huge numbers of tiles, with the eventual limits being GPU memory and ultimately GL_MAX_ARRAY_TEXTURE_LAYERS, which tends to be in the 1000s on modern GPUs. Initially my plan was to have one array texture per unique size, but managing the different textures and keeping everything consistent ended up being way too complex. Therefore, we now use a simpler version that allocates a texture that is large enough to fit the largest tile and then packs all tiles into as many layers as necessary. As a result, each UDIM texture only binds two textures (one for the actual images, one for metadata) regardless of how many tiles are used. Note that this rolls back per-tile GPUTextures, meaning that we again have per-Image GPUTextures like we did before the original UDIM commit, but now with four instead of two types. Reviewed By: fclem Differential Revision: https://developer.blender.org/D6456
2019-12-12Add support for tiled images and the UDIM naming schemeLukas Stockner
This patch contains the work that I did during my week at the Code Quest - adding support for tiled images to Blender. With this patch, images now contain a list of tiles. By default, this just contains one tile, but if the source type is set to Tiled, the user can add additional tiles. When acquiring an ImBuf, the tile to be loaded is specified in the ImageUser. Therefore, code that is not yet aware of tiles will just access the default tile as usual. The filenames of the additional tiles are derived from the original filename according to the UDIM naming scheme - the filename contains an index that is calculated as (1001 + 10*<y coordinate of the tile> + <x coordinate of the tile>), where the x coordinate never goes above 9. Internally, the various tiles are stored in a cache just like sequences. When acquired for the first time, the code will try to load the corresponding file from disk. Alternatively, a new operator can be used to initialize the tile similar to the New Image operator. The following features are supported so far: - Automatic detection and loading of all tiles when opening the first tile (1001) - Saving all tiles - Adding and removing tiles - Filling tiles with generated images - Drawing all tiles in the Image Editor - Viewing a tiled grid even if no image is selected - Rendering tiled images in Eevee - Rendering tiled images in Cycles (in SVM mode) - Automatically skipping loading of unused tiles in Cycles - 2D texture painting (also across tiles) - 3D texture painting (also across tiles, only limitation: individual faces can not cross tile borders) - Assigning custom labels to individual tiles (drawn in the Image Editor instead of the ID) - Different resolutions between tiles There still are some missing features that will be added later (see T72390): - Workbench engine support - Packing/Unpacking support - Baking support - Cycles OSL support - many other Blender features that rely on images Thanks to Brecht for the review and to all who tested the intermediate versions! Differential Revision: https://developer.blender.org/D3509
2019-11-27Cleanup: Remove BIF_gl.hJeroen Bakker
BIF_gl.h included hacks like redefining glew functions and a constant. The named constant `GLA_PIXEL_OFS` has been moved to `GPU_viewport.h` Reviewed By: brecht Differential Revision: https://developer.blender.org/D5860
2019-07-07Cleanup: move enum unto BKE_packedFile.hCampbell Barton
Use enum type for functions arguments. Removed -1 check in switch statement, this isn't needed.
2019-07-07Cleanup: use BKE_packedfile prefix for function namesCampbell Barton
Avoid ambiguity with terms check & compare.
2019-06-07Fix T64625: Eevee image textures with alpha have dark edgesBrecht Van Lommel
Now texture storage of images is defined by the alpha mode of the image. The downside of this is that there can be artifacts near alpha edges where pixels with zero alpha bleed in. It also adds more code complexity since image textures are no longer all stored the same way. This changes allows us to keep using sRGB texture formats, which have edge darkening when stored with premultiplied alpha. Game engines seems to generally do the same thing, and we want to be compatible with them.
2019-06-03Cleanup: style, use braces in RNACampbell Barton
2019-05-13Cycles/Eevee: unified and improved texture image color space handlingBrecht Van Lommel
Cycles now uses the color space on the image datablock, and uses OpenColorIO to convert to scene linear as needed. Byte images do not take extra memory, they are compressed in scene linear + sRGB transfer function which in common cases is a no-op. Eevee and workbench were changed to work similar. Float images are stored as scene linear. Byte images are compressed as scene linear + sRGB and stored in a GL_SRGB8_ALPHA8 texture. From the GLSL shader side this means they are read as scene linear, simplifying the code and taking advantage of hardware support. Further, OpenGL image textures are now all stored with premultiplied alpha. Eevee texture sampling looks a little different now because interpolation happens premultiplied and in scene linear space. Overlays and grease pencil work in sRGB space so those now have an extra conversion to sRGB after reading from image textures. This is not particularly elegant but as long as engines use different conventions, one or the other needs to do conversion. This change breaks compatibility for cases where multiple image texture nodes were using the same image with different color space node settings. However it gives more predictable behavior for baking and texture painting if save, load and image editing operations have a single color space to handle. Differential Revision: https://developer.blender.org/D4807
2019-04-18Images: support packing edited images as OpenEXR or PNG.Brecht Van Lommel
This way float and multilayer images can now be packed without data loss. This removes the as_png option and always uses the appropriate file format depending on the image contents.
2019-04-17ClangFormat: apply to source, most of internCampbell Barton
Apply clang format as proposed in T53211. For details on usage and instructions for migrating branches without conflicts, see: https://wiki.blender.org/wiki/Tools/ClangFormat
2019-03-04Merge branch 'blender2.7'Brecht Van Lommel
2019-03-04Fix missing image editor redraw when reloading image through API.Brecht Van Lommel
2019-02-18doxygen: add newline after \fileCampbell Barton
While \file doesn't need an argument, it can't have another doxy command after it.
2019-02-06Cleanup: remove redundant doxygen \file argumentCampbell Barton
Move \ingroup onto same line to be more compact and make it clear the file is in the group.
2019-02-01Cleanup: remove redundant, invalid info from headersCampbell Barton
BF-admins agree to remove header information that isn't useful, to reduce noise. - BEGIN/END license blocks Developers should add non license comments as separate comment blocks. No need for separator text. - Contributors This is often invalid, outdated or misleading especially when splitting files. It's more useful to git-blame to find out who has developed the code. See P901 for script to perform these edits.
2019-02-01Cleanup: remove redundant, invalid info from headersCampbell Barton
BF-admins agree to remove header information that isn't useful, to reduce noise. - BEGIN/END license blocks Developers should add non license comments as separate comment blocks. No need for separator text. - Contributors This is often invalid, outdated or misleading especially when splitting files. It's more useful to git-blame to find out who has developed the code. See P901 for script to perform these edits.
2018-12-05Color management: Cleanup, typosSergey Sharybin
2018-08-30Merge branch 'master' into blender2.8Brecht Van Lommel
2018-08-30Fix T56610: crash saving images with python API.Brecht Van Lommel
2018-07-11Merge branch 'master' into blender2.8Bastien Montagne
2018-07-11Fix T55912: saving Viewer Node image error.Bastien Montagne
Images from viewer node needs the lock parameter...
2018-07-01Merge branch 'master' into blender2.8Campbell Barton
2018-07-01RNA: use bool for boolean RNA typesCampbell Barton
We were using int's for bool arguments in BKE, just to avoid having wrapper functions.
2018-06-29Merge branch 'master' into blender2.8Campbell Barton
2018-06-29Cleanup: trailing newlinesCampbell Barton
2018-06-12Cleanup: remove image->bindcode, always wrap in GPUTexture.Brecht Van Lommel
This simplifies code, and will hopefully make UDIM usage of GPUTexture a little easier.
2018-06-11Revert "Cleanup: remove image->bindcode, always wrap in GPUTexture."Brecht Van Lommel
This reverts commit 8242a5bc853a74da1273fc7ad4b959ac716c563c. This isn't quite ready to use yet.
2018-06-11Cleanup: remove image->bindcode, always wrap in GPUTexture.Brecht Van Lommel
2018-06-11Merge branch 'master' into blender2.8Bastien Montagne
Conflicts: source/blender/blenkernel/BKE_mesh.h source/blender/blenkernel/intern/mesh_convert.c source/blender/editors/interface/interface_eyedropper_color.c source/blender/editors/object/object_add.c source/blender/editors/space_image/image_ops.c source/blender/makesrna/intern/rna_image.c source/blender/windowmanager/intern/wm_draw.c
2018-06-11Cleanup: remove moar ugly G.main usages...Bastien Montagne
BKE_image was an ugly nest, could fix all but the ones from compositor, so moved ugly G.main there, at least we know where the Evil is that way ;)
2018-06-05Merge branch 'master' into blender2.8Bastien Montagne
Conflicts: source/blender/blenkernel/intern/blendfile.c source/blender/blenloader/intern/readfile.h source/blender/blenloader/intern/versioning_250.c source/blender/blenloader/intern/versioning_260.c source/blender/blenloader/intern/versioning_270.c source/blender/blenloader/intern/versioning_legacy.c source/blender/editors/render/render_shading.c source/blender/makesrna/intern/rna_movieclip.c source/blender/render/intern/source/pipeline.c source/blender/render/intern/source/voxeldata.c
2018-06-05Cleanup: use new accessors to blendfile path (Main.name).Bastien Montagne
2018-05-31Merge branch 'master' into blender2.8Bastien Montagne
2018-05-31Cleanup: nuke G.main out of BKE PackedFile code.Bastien Montagne
2017-09-25Merge branch 'master' into blender2.8Sergey Sharybin