Age | Commit message (Collapse) | Author |
|
For the JPG preview, the only thing that was changed in the image
format was the format itself. However, the colorspace code now also
checks the bitdepth through BKE_image_format_is_byte, so the depth
needs to be explicitly set to 8-bit for the JPG preview output.
|
|
Using varargs had the disadvantages, replace with a macro which has
some advantages.
- Arguments are type checked.
- Less verbose.
- Unintended NULL arguments would silently terminate joining paths.
- Passing in a NULL argument warns with GCC.
|
|
|
|
Contributed by linhsu0723.
Differential Revision: https://developer.blender.org/D15979
|
|
|
|
To use function style cast '(unsigned char)x' can't be replaced by
'unsigned char(x)'.
|
|
Also use a larger buffer to account for the unlikely case of the
buffer not being big enough for the appended directories.
|
|
When saving, the default file name is "untitled" regardless of
selected language. This can be translated, like many graphical
applications do.
This applies to:
- blend file
- alembic file
- collada file
- obj file
- usd file
- rendered image
- grease pencil export
- subtitles export
- other Python exports through ExportHelper
Reviewed By: mont29
Differential Revision: https://developer.blender.org/D15868
|
|
|
|
|
|
|
|
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.
|
|
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
|
|
Use const pointers to ImageSaveOptions and ImageFormatData for API
parameters where appropriate.
Differential Revision: https://developer.blender.org/D15400
|
|
Also move mis-placed doc-string.
|
|
Ensure that the Image maintains the proper file path after saving all
the individual tiles.
The image_save_post function is unaware that the filepath it receives
is only for a single tile, not the entire Image, and happily keeps
setting ima->filepath to the concrete filepath for each tile.
There were 2 problems with the code that attempted to correct the
Image filepath back to the UDIM virtual form:
- It would trample the "relative" directory that might have been set
- It would do the wrong thing if no tiles could be saved at all
The design is now as follows: Example of trying to save to a new PathB
| | all tiles ok | any tile not ok|
| -------------------------------- | ---------------- | ---------------|
| ima->filepath is currently empty | set to new PathB | keep empty |
| ima->filepath is currently PathA | set to new PathB | keep PathA |
Differential Revision: https://developer.blender.org/D15384
|
|
|
|
Mostly duplicate includes, also use nullptr, and using default
member initializers.
|
|
Also simplify logic because (source == IMA_SRC_VIEWER) and
ELEM(type, IMA_TYPE_R_RESULT, IMA_TYPE_COMPOSITE) are the same
thing.
|
|
This is a place where the API function and operator should differ, for the API
manually setting the filepath and then saving should work. For the UI there is
no filepath visible, so it should open Save As even if there was a filepath set
for example from before changing an image type to Generated.
|
|
In such cases we should not automatically change the color space.
|
|
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.
|
|
|
|
|
|
* 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
|
|
For non-stereo cases this is automatically handled by IMB_saveiff, no reason for
stereo to do this separately.
Ref D14899
|
|
Store ImageSaveOptions directly in operator custom data instead of copying
to/from a copy on the stack.
Ref D14899
|
|
The logic here is tightly coupled to the other image saving code.
Ref D14899
|
|
|
|
Reserve "filename" when only the name component is used.
|
|
- Deprecated headers
- Else after return
- Inconsistent parameter names (I used the most recently modified)
- Raw string literals
|
|
The Output Properties > Output panel now has a Color Management subpanel to
override scene settings. When set to Override instead of Follow Scene, there
are settings to:
* For OpenEXR, choose a (linear) colorspace for RGBA passes
* For other file formats, use different display/view/look/exposure/gamma
These settings affect animation render output, image save of renders and the
compositor file output node. Additionally, the image save operator and
compositor file output nodes also support overriding color management.
Includes some layout changes to the relevant panels to accomdate the new
settings and to improve consistency. Ideally subpanels would be used to better
organize these settings, however nodes and operators don't currently support
creating subpanels.
Differential Revision: https://developer.blender.org/D14402
|
|
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
|
|
|
|
|
|
|
|
These share a lot of logic with regular image saving and should be unified
more in the future.
|
|
|