Age | Commit message (Collapse) | Author |
|
This evaluator is used in order to evaluate subdivision at render time, allowing for
faster renders of meshes with a subdivision surface modifier placed at the last
position in the modifier list.
When evaluating the subsurf modifier, we detect whether we can delegate evaluation
to the draw code. If so, the subdivision is first evaluated on the GPU using our own
custom evaluator (only the coarse data needs to be initially sent to the GPU), then,
buffers for the final `MeshBufferCache` are filled on the GPU using a set of
compute shaders. However, some buffers are still filled on the CPU side, if doing so
on the GPU is impractical (e.g. the line adjacency buffer used for x-ray, whose
logic is hardly GPU compatible).
This is done at the mesh buffer extraction level so that the result can be readily used
in the various OpenGL engines, without having to write custom geometry or tesselation
shaders.
We use our own subdivision evaluation shaders, instead of OpenSubDiv's vanilla one, in
order to control the data layout, and interpolation. For example, we store vertex colors
as compressed 16-bit integers, while OpenSubDiv's default evaluator only work for float
types.
In order to still access the modified geometry on the CPU side, for use in modifiers
or transform operators, a dedicated wrapper type is added `MESH_WRAPPER_TYPE_SUBD`.
Subdivision will be lazily evaluated via `BKE_object_get_evaluated_mesh` which will
create such a wrapper if possible. If the final subdivision surface is not needed on
the CPU side, `BKE_object_get_evaluated_mesh_no_subsurf` should be used.
Enabling or disabling GPU subdivision can be done through the user preferences (under
Viewport -> Subdivision).
See patch description for benchmarks.
Reviewed By: campbellbarton, jbakker, fclem, brecht, #eevee_viewport
Differential Revision: https://developer.blender.org/D12406
|
|
Outliner would frame the armature object instead of the bone if the bone
was on a hidden armature layer.
Similar to issues reported in e.g. T58068 and T80464, this is due to the
fact that `BKE_pose_channel_active` always checks for the armature layer
(and returns NULL if a bone is not on a visible armature layer).
Now propose to make this layer check **optional** (and e.g. from the
Outliner be more permissive). This also introduces
`BKE_pose_channel_active_if_layer_visible` which just wraps
`BKE_pose_channel_active` with the check being ON.
Maniphest Tasks: T92930
Differential Revision: https://developer.blender.org/D13154
|
|
bda9e4238a07a72c26598ea9025e00f6ca896750 changed smooth-view
not to redraw when there were no changes made.
Redrawing is needed for repositioning the cursor.
Subscribe to changes to the 3d cursor to ensure all view ports
are updated (not just the current one).
|
|
Float precision issues cause the `ED_view3d_win_to_3d_on_plane` to return
a value even when the view ray is parallel to the plane.
A more general solution might be desired in this case, as other areas that
use `ED_view3d_win_to_3d_on_plane` might have the same problem.
For now, just work around the problem for the snap cursor.
|
|
There is an apparent compiler bug here, tweak the code to avoid it. This did
not affect official builds as we were still using Xcode 12.
|
|
Ref T92709
|
|
`ED_view3d_win_to_3d_on_plane` does not use the `clip_start` and
`clip_end` values of the scene, so the `do_clip` option can be misleading
especially in the orthographic view where the `clip_start` is negative.
For now, don't use the `do_clip` option in orthographic view.
|
|
`g_data_intern.state_default.gzgrp_type` is a very specific member and
cannot be set to default.
|
|
This is very old and is unlikely to be useful in the near future.
|
|
The default snap behavior to perform on tools and cursors is to the
final geometry and not edited geometry.
In snapping to edited geometry, there are some specific behaviors that
are not convenient in some cases. For example the general occlusion
test of X-Ray geometries during dragdrop.
This fix also resolves a regression for tools like measure and placement
that were also ignoring the snap to face in x-ray mode.
Differential Revision: https://developer.blender.org/D13410
|
|
|
|
Don't use Cycles for rendering thumbnails, fall back to Solid shading.
Differential Revision: https://developer.blender.org/D13406
|
|
Bug introduced in {rBaa0ac0035a0d}.
The invalid depth fallback was changed to `FLT_MAX` in order to match the
annotation and gpencil operations.
This broke the `Interactive Light Track` operator which invalidates the
operation if the depth value is `1.0f`.
The chosen solution was to change the value tested in the annotation and
gpencil operations.
|
|
|
|
Was not taking into account curve points at all.
Maniphest Tasks: T93198
Differential Revision: https://developer.blender.org/D13281
|
|
|
|
The old code did not work when there were multiple ids with
the same name (which can happen when ids are linked in).
The solution is to use the session ids instead. Those are different
even when two ids have the same name.
Differential Revision: https://developer.blender.org/D11116
|
|
multiple snap points""""
This reverts commit b8bf40ed4bf618a6bc908e39278cfbfd385e0d4b.
|
|
'Snap Source'""""
This reverts commit 701f2dfd5bc61c0f37603880fa21abfe8b1d9620.
|
|
Source'"""
This reverts commit 25fa6c74b977ac983a34b9adf5ab2f20fe2f4932.
|
|
points"""
This reverts commit c7f9a782aafcdd08868504584b2621afcf1356c2.
|
|
This reverts commit 77df32548b9f377a834b54d0b740a6a51bb2f0a5.
|
|
This reverts commit 805181bffae647a24e939c651da72a08c5c2b7cb.
|
|
This reverts commit f19bd637e2c38b8b967944a88609a190b5179439.
|
|
This reverts commit cb3ba68ec4470a170905a2dc9ea64b8fa1f8ace3.
|
|
|
|
This patch implements part of what was stated in {T66484}, with respect to `Base Point`.
## Introduction
The snapping feature of the transform tools has a variety of applications:
- Organization of nodes.
- Positioning of frames in precise time units.
- Retopology with snap to face
- Creation of armatures with bone positioning through the snap to volume
- Precise positioning of 3D or 2D objects in the surrounding geometry (CAD modeling)
The goal of this document is to make it more powerful for precision modeling and still supporting the old use cases without extra complexity.
The main topic addressed here is the introduction of a **interactive mode for setting a snap source** (See terminology).
## Terminology
* **Snap Source**: 3d coordinate * we want to snap from. (Currently defined by the `Snap With` options: `Closest`, `Center`, `Median` and `Active`).
* **Snap Target**: 3d coordinate* we want to snap to. (Vertices, Edges, Faces, Grid...)
## Interactive Mode for Editing a Snap Source
Currently the fixed snap point can only be obtained through the `Snap With` options. So it's a little tricky for the user to define a snap source point having so much geometry on an object.
Because of this, the user needs to resort to impractical solutions to get a point in the geometry.
See example of an impractical use:
{F11714181, layout=left, width=960, alt="The user used the cursor (which can be snapped) to choose the snap origin point."}
The user used the cursor (which can be snapped) to choose the snap source point.
While it is possible to work around this current limitation, it is important to reduce the number of steps and allow the user to set a snap source point through an optional interactive mode during a transformation.
The proposed solution is to be able to move the current snap source point through a modal modifier activated with a key (eg. B).
The snap source point can thus "snap" to the elements in the scene (vertex, mid-edge, Lamp, …) during this mode.
{F9122814, layout=left, width=960, alt="Base Point Snap, example of transform operation via the shortcut (not the tool). After pressing g and the snap base change shortcut (e.g., shift + ctrl) the user set the base point. The base point is then visible until the end of the operation. The z axis constrains the final position."}
## Implementation Details
- The feature will only be available in 3D View.
- The feature will only be available for `Move`, `Rotate` and `Scale` transform modes.
- The snap source editing will be enabled with a single click on the modifier key (B).
- Having a snap point indicated, the new snap origin point will be confirmed with the same buttons that confirms the transformation (but the transformation will not be concluded).
- The snap source editing can be canceled with the same key that activated it (B).
- If the transformation is done with "release_confirm" (common for gizmos), the new feature cannot be enabled.
- During the transformation, when enabling the feature, if the snap option is turned off in the scene, the snap will be forced on throughout the rest of the transformation (unless interactive mode is canceled).
- During a transformation, if no snap target is set for an element in the scene (Vertex, Grid...), the snap targets to geometry Vertex, Edge, Face, Center of Edge and Perpendicular of Edge will be set automatically.
- Snap cannot be turned off during the snap source editing.
- Constraint or similar modification features will not be available during the snap source editing.
- Text input will not be available during the snap source editing.
- When adding multiple snap points (A) the new prone snap source point will be indicated with an "X" drawing.
{F11817267}
Maniphest Tasks: T66484
Differential Revision: https://developer.blender.org/D9415
|
|
Allow the use of floating-point values for font point sizes, which
allows greater precision and flexibility for text output.
See D8960 for more information, details, and justification.
Differential Revision: https://developer.blender.org/D8960
Reviewed by Campbell Barton
|
|
|
|
|
|
This combination was being repeated in some places.
|
|
* Rename the 'copy' functions to make it clear they belong to the same
'group' and are to be used together.
* Fix `flag` parameter of `BKE_copybuffer_paste` being a short instead
of an int.
* Improve documentation.
|
|
|
|
|
|
|
|
Apply a local-workaround instead of adding support for this use-case
since pre-selection isn't the intended purpose of gizmos.
This also resolves a glitch where poly-build and loop cut would
briefly show loop-cut or poly-build pre-selection after transforming.
See gizmo_preselect_poll_for_draw note for more details.
|
|
|
|
The active object was being set as the edited object even though it was
not in edit mode.
|
|
The snap cursor tagged overlapping regions to redrawn even though the
cursor itself is not drawn.
|
|
|
|
|
|
|
|
|
|
Error introduced in rB69d6222481b4 and partially fixed in rB24310441ddc8.
When gizmo was turned on but the scene has more than one 3D viewport, one of them the snap cursor did not appear.
|
|
|
|
Drop-boxes should act on the context determined through the exact cursor
location. There should be no need to override that, basically by the
nature of how drop-boxes work.
So Campbell and I agreed on removing this.
If we wanted to support it, we'd have to restore the operator context
when drawing drop-boxes, see
https://developer.blender.org/T92501#1247581.
|
|
Operations such as erasing with occlusion and drawing on the surface
require reading the depth buffer.
However, this is being done with minimal efficiency.
Currently, to read the depth corresponding to each point of the new stroke,
a ReadPixel is called to send a message to the GPU and read the depth of
the corresponding pixel in the VRAM.
The communication between GPU and CPU is known to be a slow operation so
it is good to be avoided.
Therefore, save the entire depth buffer in a cache to be read directly
from the RAM.
(Also the `ED_view3d_autodist_depth` and `ED_view3d_autodist_depth_seg` have
been removed since they are no longer used).
Reviewed By: antoniov, fclem
Differential Revision: https://developer.blender.org/D10894
|
|
The snap cursor continued to appear even when the workspace is changed for example.
So add the region to check in the cursor pool.
|
|
Wrong values were passed for use_offset and pivot_point in
2bcf93bbbeb9e32f680c37a1e0054ff16cb00ef0
Maniphest Tasks: T92663
Ref D13056
|
|
Snapping to an axis aligned view with a 45 degree rotation would
set the view orthographic without setting it back to perspective
when orbiting the view as you would expect with auto-perspective.
Now orthographic is only set for views with rotation of 0, 90, 180, -90.
Notes:
- Partially reverts logic from cebd025e02f1147c48cd658816ad835f94128a4a
at the time RegionView3D.view_axis_roll had not been added,
so only setting the orthographic with one particular rotation
was a bigger limitation than it is now.
- Auto-perspective could be supported when snapping the viewport to
diagonal angles, however that's a larger project.
|