Age | Commit message (Collapse) | Author |
|
This just makes the minimum changes to make the files compile.
|
|
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
|
|
Issue arises when face areas are really large combined with small UV
areas (report has a mesh ~1.5 km), then precission of shorts is
insufficient.
Now use floats instead.
This also removes this negative signed version of the total area ratio
(since with floats it is no longer used).
Thx @brecht for a lot of hand-holding!
NOTE: this is an alternative to D15805 (and quick tests show this does
not introduce the tiny performance hit as D15805 did).
Maniphest Tasks: T93084
Differential Revision: https://developer.blender.org/D15810
|
|
Contributed by luzpaz
Differential Revision: https://developer.blender.org/D15057
|
|
UV editor used wire color for drawing unselected vertices.
Add color variable to shader, so theme color can be used.
Reviewed By: jbakker
Differential Revision: https://developer.blender.org/D14373
|
|
This patch adds edge selection support for UV editing (refer T76545).
Developed as a part of GSoC 2021 project - UV Editor Improvements.
Previously, selections in the UV editor always flushed down to vertices
and this caused multiple issues such as T76343, T78757 and T26676.
This patch fixes that by adding edge selection support for all UV
operators and adding support for flushing selections between vertices
and edges. Updating UV select modes is now done using a separate
operator, which also handles select mode flushing and undo for UV
select modes. Drawing edges (in UV edge mode) is also updated to match
the edit-mesh display in the 3D viewport.
Notes on technical changes made with this patch:
* MLOOPUV_EDGESEL flag is restored (was removed in rB9fa29fe7652a).
* Support for flushing selection between vertices and edges.
* Restored the BMLoopUV.select_edge boolean in the Python API.
* New operator to update UV select modes and flushing.
* UV select mode is now part of editmesh undo.
TODOs added with this patch:
* Edge support for shortest path operator (currently uses vertex path logic).
* Change default theme color instead of reducing contrast with edge-select.
* Proper UV element selections for Reveal Hidden operator.
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D12028
|
|
Use a shorter/simpler license convention, stops the header taking so
much space.
Follow the SPDX license specification: https://spdx.org/licenses
- C/C++/objc/objc++
- Python
- Shell Scripts
- CMake, GNUmakefile
While most of the source tree has been included
- `./extern/` was left out.
- `./intern/cycles` & `./intern/atomic` are also excluded because they
use different header conventions.
doc/license/SPDX-license-identifiers.txt has been added to list SPDX all
used identifiers.
See P2788 for the script that automated these edits.
Reviewed By: brecht, mont29, sergey
Ref D14069
|
|
The evaluated mesh is a result of evaluated modifiers, and referencing
other evaluated IDs such as materials.
It can not be stored in the EditMesh structure which is intended to be
re-used by many areas. Such sharing was causing ownership errors causing
bugs like
T93855: Cycles crash with edit mode and simultaneous viewport and final render
The proposed solution is to store the evaluated edit mesh and its cage in
the object's runtime field. The motivation goes as following:
- It allows to avoid ownership problems like the ones in the linked report.
- Object level is chosen over mesh level is because the evaluated mesh
is affected by modifiers, which are on the object level.
This patch allows to have modifier stack of an object which shares mesh with
an object which is in edit mode to be properly taken into account (before
the change the modifier stack from the active object will be used for all
objects which share the mesh).
There is a change in the way how copy-on-write is handled in the edit mode to
allow proper state update when changing active scene (or having two windows
with different scenes). Previously, the copt-on-write would have been ignored
by skipping tagging CoW component. Now it is ignored from within the CoW
operation callback. This allows to update edit pointers for objects which are
not from the current depsgraph and where the edit_mesh was never assigned in
the case when the depsgraph was evaluated prior the active depsgraph.
There is no user level changes changes expected with the CoW handling changes:
should not affect on neither performance, nor memory consumption.
Tested scenarios:
- Various modifiers configurations of objects sharing mesh and be part of the
same scene.
- Steps from the reports: T93855, T82952, T77359
This also fixes T76609, T72733 and perhaps other reports.
Differential Revision: https://developer.blender.org/D13824
|
|
Using a RenderResult (or a Viewer) was never really working (think you
cant get a real ImBuff from these) -- cannot use it as a clone, stencil
or canvas [Single Image paint texture slot].
In the case of using it as a 2D paint clone image this would also crash
[due to the Image Editor drawing refactor in 2.91].
Now [in the spirit of T73182 / D11179], prevent using these where
unappropriate by using rna pointer polling functions.
Also add a security check for the 2D paint clone image crash in case a
stencil ImBuff cannot be provided for some reason, but generally old
files are now patched in do_versions_after_linking_300 (thx @brecht!).
Fixes T91625.
Maniphest Tasks: T91625
Differential Revision: https://developer.blender.org/D12609
|
|
Remove redundant code for drawing text strings that contain only ASCII.
See D12293 for much more detail.
Differential Revision: https://developer.blender.org/D12293
Reviewed by Campbell Barton
|
|
Only DNA_customdata_types.h is needed for BMEditMesh.
|
|
|
|
is hidden from the viewport
Check visibilty (as done in workbench_cache_populate) in
overlay_edit_uv_cache_populate as well.
Maniphest Tasks: T86542
Differential Revision: https://developer.blender.org/D10724
|
|
|
|
|
|
A fix for T83187 (rBf83aa830) assumed in the overlay code of the uv editor that the object was a mesh
when it did not have to be - causing a crash.
The fix makes sure that the object is a mesh.
Reviewed By: jbakker, campbellbarton
Maniphest Tasks: T85499, T85495
Differential Revision: https://developer.blender.org/D10369
|
|
This is done almost everywhere already,
use this more straightforward convention.
|
|
Caused by rBf83aa830cd00.
Since above commit, only meshes in editmode were considered for drawing
(because
BKE_view_layer_array_from_objects_in_edit_mode_unique_data_with_uvs was
used), but the option needs to work for texture paint mode as well, so
use BKE_view_layer_array_from_objects_in_mode_unique_data instead on
pass the draw_ctx->object_mode.
note: there is no good filter_fn to check if we have UVs if mesh is not
in editmode, this shouldnt cause much of a performance hit though.
Maniphest Tasks: T85396
Differential Revision: https://developer.blender.org/D10319
|
|
|
|
When uv editing objects that share the same mesh only the selection
state can get confused. The cause is that the UV editor uses a
particular order of objects and store its state in the first object of a
mesh it hasn't handled. During drawing this state is updated into the
GPU buffers. In the case of linked meshes it can happen that the GPU
buffers are updated based on the object that does not have the correct
selection state making th selection VBOs incorrect.
This patch adds a work around that uses the order that the UV editor is
also using so the GPU buffers are built with the right data.
|
|
|
|
|
|
The mask overlay wasn't part of the overlay engine. The reasoning nehind
this was that more editors used the mask overlay and most of them used
old drawing code. This patch adds the mask overlay drawing to the draw
overlay engine. This code path will only be used by the image editor
VSE, Compositor and Movie Clip editor will still use the previous
method.
During this patch some alternatives have been researched:
1. `ED_mask_draw_region`: this would lead to different code paths when
drawing in the image editor, and some hacks to retrieve the correct
framebuffer.
2. Add mask drawing to image engine: Would lead to incorrect color
management when viewing the mask.
3. Add mask drawing to image engine and overlay engine: Would lead to
duplicated code.
4. Add mask drawing to overlay engine and for combined overlay select
the correct framebuffer.
Option 4 was chosen as the exception (switching framebuffers) can be
done without hacks. The code stays clean.
|
|
Active tile could be NULL when it was on the second tile before
switching back and forth between the Image/UDIM.
In the future we might also check that the active_tile_index is always
valid.
|
|
The clone tool in the image editor can show a second texture on top
of the image. This wasn't ported and now results into alpha and depth
issues. This fix adds the clone tool drawing to the overlay engine.
Reviewed By: Clément Foucault
Differential Revision: https://developer.blender.org/D9352
|
|
Probably copy-paste error in rBd6525e8d133b.
Maniphest Tasks: T81669
Differential Revision: https://developer.blender.org/D9190
|
|
The overlay options in the image/uv editor is hidden in side panels and menus. Sometimes this panel is even hidden, while still useful.
The goal of this task is to introduce an overlay pop-over just like the overlay-popover of the 3d viewport.
Popover has
* UV Stretching (only available in the UV mode, when active object mode is a mesh and in OB_EDIT mode)
* Display As (only available in the UV mode, when active object mode is a mesh and in OB_EDIT mode)
* Show Modified (only available in the UV mode, when active object mode is a mesh and in OB_EDIT mode)
* Show UV Edges (including opacity slider; available UV, View, Paint, when active object mode is a mesh and in OB_EDIT mode)
* Udim tiles when no image is available.
Like the 3d viewport, there will be a editor toggle to enable/disable the overlays
For compatibility reasons the RNA properties are added to both the `SpaceImage.uv_editor` amd `SpaceImage.overlay`. On DNA level they are still stored in the SpaceImage. only new properties are added to the SpaceImageOverlay struct. During the next major release we could remove these options from `SpaceImage.uv_editor`. This should be noted in the Python section of release notes.
Reviewed By: Julian Eisel, Pablo Vazquez
Differential Revision: https://developer.blender.org/D8890
|
|
Assert happened as it could not create uv batches without an UVMap.
Solution is to only request those batches when the UVMaps are available.
|
|
When developing the image draw engine I wasn't aware of this option. But
now it is back.
|
|
The old image editor has an option to enable the smooth wire drawing.
This option was stored per editor and disabled by default. This patch
connects the smooth wires in the UV/Image editor to `User Prefereces ->
Viewport -> Quality -> Smooth Wire [] Overlay`.
The old option is left in place and will be removed when the old image
editor drawing code will be removed before BCon 3.
|
|
This project moves the current UV/Image editor drawing to the draw manager.
Why would we do this:
**Performance**:
Current implementation would draw each texel per time. Multiple texels could be
drawn per pixel what would overwrite the previous result. You can notice this
when working with large textures. Repeat image drawing made this visible by
drawing for a small period of time and stop drawing the rest. Now the rendering
is fast and all repeated images are drawn.
**Alpha drawing**:
Current implementation would draw directly in display space. Giving incorrect
results when displaying alpha transparent images.
This addresses {T52680}, {T74709}, {T79518}
The image editor now can show emission only colors. See {D8234} for
examples.
**Current Limitations**
Using images that are larger than supported by your GPU are resized (eg larger
than 16000x16000 are resized to 8k). This leaves some blurring artifacts. It is
a low priority to add support back of displaying individual pixels of huge
images. There is a design task {T80113} with more detail.
**Implementation overview**
Introduced an Image Engine in the draw module. this engine is responsible for
drawing the texture in the main area of the UV/Image editor. The overlay engine
has a edit_uv overlay which is responsible to draw the UV's, shadows and
overlays specifically for the UV Image editor. The background + checker pattern
is drawn by the overlay_background.
The patch will allow us to share overlays between the 3d viewport and UV/Image
editor more easily. In most cases we just need to switch the `pos` with the `u`
attribute in the vertex shader.
The project can be activated in the user preferences as experimental features.
In a later commit this will be reversed.
Reviewed By: Clément Foucault
Differential Revision: https://developer.blender.org/D8234
|