Age | Commit message (Collapse) | Author |
|
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
|
|
* 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
|
|
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.
|
|
|
|
Didn't know this function existed, better to use it then to avoid verbosity.
|
|
Direcly using the C library allocator functions is usually avoided in favor of
our guarded allocator. It's more useful when debugging.
|
|
Casting 0xFFFFFFFF to float does not give NaN as is needed here. Found through
compiler warning which is now fixed.
|
|
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.
|
|
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.
|
|
No functional changes.
|
|
No functional changes.
|
|
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.
|
|
|
|
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
|
|
|
|
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
|
|
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.
|
|
|
|
|
|
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}.
|
|
Use named members as this wasn't very readable given the number
of unnamed NULL members.
|
|
|
|
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.
|
|
|
|
Use the size argument to ensure checking the header doesn't read
past the buffer bounds when reading corrupt/truncated headers
from image files.
|
|
No functional changes, prepare for fixing out-of-bounds access
when reading headers.
|
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
Besides being incorrect as only the first two bytes should be tested,
searching binary data using `strstr` can easily read past buffer bounds.
|
|
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
|
|
This is already being checked in the 'is_a' callback.
|
|
|
|
|
|
Use `is_a` & `is_a_filepath` in callback names.
|
|
|
|
Replace `NULL` with `nullptr` in C++ code.
No functional changes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This patch changes behavior of strip transform and crop feature.
Purpose of this change is to allow display arbitrary portion of input
image, simplify user interface and workflow.
Offset and Crop values in old files are converted in versioning.
Offset animation is also converted. Crop animation and animation of
crop or offset enable properties is not taken into account
Changes in behavior and interface:
- If image is added to timeline it is scaled to fit inside preview area
while maintaining aspect ratio. Image is centered. This is considered
as a baseline for further transformation.
- Scale and rotation was added, so it is possible to transform image at
it's original resolution.
- Crop will not affect image transformation (does not move image).
- Values of Crop and Transform Position are in pixels, these values are
corrected if preview is fraction of project resolution.
- Transform and Mirror panel has been removed and new Transform panel
and Crop panel is moved to Adjust panel. Mirror is now part of new
Transform panel.
Technical changes:
- Preprocessing stage must work on duplicated image, because original is
cached. Previously Crop and Offset could run at once and required only
one duplication of image. This is not the case with new algorithms, so
duplication on demand is implemented. Transformation can read original
image and will output new image that is safe to modify. It should be
possible to add crop step to transform algorithm, so that Crop won't
require previous duplication though.
- Use Crop and Use Translation checkboxes were removed. Individual
values are compared to default values to check if image needs to be
processed. In case of transform this will be done also if resolution of
source.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D8393
|
|
This reverts commit 0277579b2850f0ba097741ca22eb8ae9ccd9bcea.
This commit caused build errors on Linux.
|
|
This patch changes behavior of strip transform and crop feature.
Purpose of this change is to allow display arbitrary portion of input
image, simplify user interface and workflow.
Offset and Crop values in old files are converted in versioning.
Offset animation is also converted. Crop animation and animation of
crop or offset enable properties is not taken into account
Changes in behavior and interface:
- If image is added to timeline it is scaled to fit inside preview area
while maintaining aspect ratio. Image is centered. This is considered
as a baseline for further transformation.
- Scale and rotation was added, so it is possible to transform image at
it's original resolution.
- Crop will not affect image transformation (does not move image).
- Values of Crop and Transform Position are in pixels, these values are
corrected if preview is fraction of project resolution.
- Transform and Mirror panel has been removed and new Transform panel
and Crop panel is moved to Adjust panel. Mirror is now part of new
Transform panel.
Technical changes:
- Preprocessing stage must work on duplicated image, because original is
cached. Previously Crop and Offset could run at once and required only
one duplication of image. This is not the case with new algorithms, so
duplication on demand is implemented. Transformation can read original
image and will output new image that is safe to modify. It should be
possible to add crop step to transform algorithm, so that Crop won't
require previous duplication though.
- Use Crop and Use Translation checkboxes were removed. Individual
values are compared to default values to check if image needs to be
processed. In case of transform this will be done also if resolution of
source.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D8393
|
|
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D9349
|