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
2022-10-21Fix T101964: Edge and face snapping no locking to axisGermano Cavalcante
In rBed6c8d82b804 it was wrongly assumed that the constraint functions always apply the transformations. But that is not the case for when axes are aligned. The `mul_m3_v3(t->con.pmtx, out)` fallback is still required.
2022-10-04Cleanup: correct argument size for plane in planeProjectionCampbell Barton
2022-09-20Fix T101196: constraint plane failing in side orthographic viewsGermano Cavalcante
Caused due to an inaccuracy when the values of `in` and `out` are too close. The solution is to project the value of `in` directly onto the plane.
2022-08-26Cleanup: reduce variable scopeCampbell Barton
2022-08-23Cleanup: match names between functions & declarationsCampbell Barton
2022-06-30Transform Snap: nearest face snap mode, snapping options, refactoring.jon denning
This commit adds a new face nearest snapping mode, adds new snapping options, and (lightly) refactors code around snapping. The new face nearest snapping mode will snap transformed geometry to the nearest surface in world space. In contrast, the original face snapping mode uses projection (raycasting) to snap source to target geometry. Face snapping therefore only works with what is visible, while nearest face snapping can snap geometry to occluded parts of the scene. This new mode is critical for retopology work, where some of the target mesh might be occluded (ex: sliding an edge loop that wraps around the backside of target mesh). The nearest face snapping mode has two options: "Snap to Same Target" and "Face Nearest Steps". When the Snap to Same Object option is enabled, the selected source geometry will stay near the target that it is nearest before editing started, which prevents the source geometry from snapping to other targets. The Face Nearest Steps divides the overall transformation for each vertex into n smaller transformations, then applies those n transformations with surface snapping interlacing each step. This steps option handles transformations that cross U-shaped targets better. The new snapping options allow the artist to better control which target objects (objects to which the edited geometry is snapped) are considered when snapping. In particular, the only option for filtering target objects was a "Project onto Self", which allowed the currently edited mesh to be considered as a target. Now, the artist can choose any combination of the following to be considered as a target: the active object, any edited object that isn't active (see note below), any non- edited object. Additionally, the artist has another snapping option to exclude objects that are not selectable as potential targets. The Snapping Options dropdown has been lightly reorganized to allow for the additional options. Included in this patch: - Snap target selection is more controllable for artist with additional snapping options. - Renamed a few of the snap-related functions to better reflect what they actually do now. For example, `applySnapping` implies that this handles the snapping, while `applyProject` implies something entirely different is done there. However, better names would be `applySnappingAsGroup` and `applySnappingIndividual`, respectively, where `applySnappingIndividual` previously only does Face snapping. - Added an initial coordinate parameter to snapping functions so that the nearest target before transforming can be determined(for "Snap to Same Object"), and so the transformation can be broken into smaller steps (for "Face Nearest Steps"). - Separated the BVH Tree getter code from mesh/edit mesh to its own function to reduce code duplication. - Added icon for nearest face snapping. - The original "Project onto Self" was actually not correct! This option should be called "Project onto Active" instead, but that only matters when editing multiple meshes at the same time. This patch makes this change in the UI. Reviewed By: Campbell Barton, Germano Cavalcante Differential Revision: https://developer.blender.org/D14591
2022-03-28Fix T96728: 'Automatic Constraint' using the wrong orientationGermano Cavalcante
If the `Automatic Constraint` modifier was activated while an axis constraint was already set, the orientation used would be the default orientation of the mode and not that of the scene. This was because the `initSelectConstraint` function was not called in this case and the `Automatic Constraint` mode was enabled by other indirect means. So the solution is to call `initSelectConstraint` in either case and remove these "indirect means" of enabling `Automatic Constraint`.
2022-03-23Revert "Fix T96728: 'Automatic Constraint' using the wrong orientation"Germano Cavalcante
This reverts commit 6cc83f9079de11ddb53af5bab3e0442a234aadb2. That commit removed the feature of cancel the 'Auto Constraint' if it is enabled without drag.
2022-03-23Fix T96728: 'Automatic Constraint' using the wrong orientationGermano Cavalcante
If the `Automatic Constraint` modifier was activated while an axis constraint was already set, the orientation used would be the default orientation of the mode and not that of the scene. This was because the `initSelectConstraint` function was not called in this case and the `Automatic Constraint` mode was enabled by other indirect means So the solution is to call `initSelectConstraint` in either case and remove these "indirect means" of enabling `Automatic Constraint`.
2022-03-01Cleanup: ED_view3d_win_to_delta & ED_view3d_calc_zfac usageCampbell Barton
- Rename ED_view3d_win_to_delta `mval` argument to `xy_delta` as it as it was misleading since this is an screen-space offset not a region relative cursor position (typical use of the name `mval`). Also rename the variable passed to this function which also used the term `mval` in many places. - Re-order the output argument of ED_view3d_win_to_delta last. use an r_ prefix for return arguments. - Document how the `zfac` argument is intended to be used. - Split ED_view3d_calc_zfac into two functions as the `r_flip` argument was only used in some special cases.
2022-02-11File headers: SPDX License migrationCampbell Barton
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
2021-12-08Cleanup: move public doc-strings into headers for 'editors'Campbell Barton
Ref T92709
2021-11-11Fix T92867: Gimbal rotation broken when used for multiple objectsCampbell Barton
Support gimbal orientation for objects & bones.
2021-10-08VSE: Implement the bounding box (xform) tool in the seq preview windowSebastian Parborg
Make the "xform" tool/gizmo available for strip transformations in the sequencer preview window. Because of the amount of hacks needed to make the gizmo work nicely with multiple strips at the same time, it was decided to only show the translate gizmo when multiple strips are selected. This is because the transforms with multiple strips would appear buggy because of our lack of shearing support in the transform system. There is also currently no way to properly sync the gizmo drawing with the transform when using multiple strips. Reviewed By: Richard Antalik, Campbell Barton Differential Revision: http://developer.blender.org/D12729
2021-10-04Cleanup: pass arguments as constCampbell Barton
2021-06-30Cleanup: use const arguments for accessor functionsCampbell Barton
2021-06-29Cleanup: use 'const' arguments in transform calculationCampbell Barton
Use const arguments to simplify further optimizations. Transforming elements shouldn't need to change their containers data-structures. ElementResize for grease pencil stroke thickness was modifying TransInfo.num & TransInfo.values_final. Now copies are operated on to preserve const correctness although it's worth investigating if this can be avoided altogether.
2021-05-24Fix (unreported): Automatic transform contraint not being disabledGermano Cavalcante
It does not make sense to maintain automatic constraint selection when you manually set the constraint.
2021-05-24Cleanup: Rename transform enum itemsGermano Cavalcante
Make them more descriptive.
2021-05-20Cleanup: Use enum to indicate the current orientationGermano Cavalcante
Improves readability.
2021-03-04Cleanup: use const arraysCampbell Barton
2021-03-03Cleanup: make formatJacques Lucke
2021-02-27Fix T85886: Rotate Tool and Adjust Last Operation - angles invertedGermano Cavalcante
The constraint was not set when redoing. This commit also removes `postInputRotation`. I really couldn't see a use for it.
2021-02-08Cleanup: Unify, move and rename transform flagsGermano Cavalcante
Flags unified: T_CURSOR -> CTX_CURSOR T_TEXTURE -> CTX_TEXTURE Flags moved: T_CAMERA -> CTX_CAMERA T_POSE -> CTX_POSE_BONE T_OBJECT -> CTX_OBJECT T_TEXTURE -> CTX_TEXTURE_SPACE Flag renamed: CTX_EDGE -> CTX_EDGE_DATA
2021-02-04Merge branch 'blender-v2.92-release'Germano Cavalcante
2021-02-04Fix for 3D view transform: flipped rotation direction for numeric inputGermano Cavalcante
The rotation direction was flipped recently. This meant that rotation on a single axis gave negative results compared with previous Blender releases. This partially reverts a9b53daf23ba8b6cb4c930e06154ffd35522b00d. Differential Revision: https://developer.blender.org/D10299
2021-02-04Cleanup: replace '_imp' function suffix with '_impl'Campbell Barton
Use the more common abbreviation for `implementation`.
2021-02-03Merge branch 'blender-v2.92-release'Germano Cavalcante
# Conflicts: # source/blender/editors/transform/transform_constraints.c
2021-02-03Fix T85340: Gizmo rotation inverted (in some perspective angles)Germano Cavalcante
This is an old bug (strange not to have been reported before). To define the direction of rotation, the View Vector is used. However, only the projection matrix was being considered, but in perspective mode, the position of the pivot also matters.
2021-02-03Cleanup: Move and rename 'getViewVector' utilityGermano Cavalcante
This function is only being used by the constraint code.
2021-01-31Fix T83092: Direction of rotation with View orientation changed in 2.91Germano Cavalcante
This solution replaces {rBf9e994d0f463}. That commit created an inverted orientation matrix but the 'Align to Transform Orientation' operator doesn't work well with inverted matrices. This new solution makes the rotate operator use the negative vector of the axis.
2021-01-31Fix error in recent commitGermano Cavalcante
Unused argument in rB216ebe0b7392d6
2021-01-31Revert "Cleanup: remove unused argument"Germano Cavalcante
This reverts commit 780857f8e8139613711cba041f5f0af9799804ec. The `axismtx` argument was supposed to be used.
2021-01-31Cleanup: use doxygen for transform_constraintsCampbell Barton
2021-01-31Cleanup: remove unused argumentCampbell Barton
2021-01-30Fix T83092: Direction of rotation with View orientation changed in 2.91Germano Cavalcante
This solution replaces {rBf9e994d0f463}. That commit created an inverted orientation matrix but the 'Align to Transform Orientation' operator doesn't work well with inverted matrices. This new solution makes the rotate operator use the negative vector of the axis.
2021-01-20Fix T81429: move tool's axis constraints not drawn completely when using ↵Germano Cavalcante
local orientation In fact, the drawing was that of the local contraint axis (which is summarized so as not to fill the screen with too much information). Use the local contraint axis only when more than one object is selected.
2021-01-20Revert "Transform: Use orientation of active object with Auto Constraint"Germano Cavalcante
This reverts commit 54f248fa87afd4836fb7154056cd0e8d920401f1. And fixes T84259. Apparently the ideal behavior was the previous one.
2020-12-04Cleanup: Deduplicate constraint event codeGermano Cavalcante
2020-11-06Cleanup: clang-formatCampbell Barton
2020-11-04Transform: Disable snap to plane-face intersectionGermano Cavalcante
This feature was added in D5608. But in practice this confuses more than it helps. This fixes T82386.
2020-10-08Fix T81529: Can't move with constraint to a zero-size local axisGermano Cavalcante
To fix the problem, it was necessary to create a fallback for the zero-sized axis in local orientation. This also affects the gizmos.
2020-10-08Cleanup: Move transform_orientations functions to separate headerGermano Cavalcante
Improves the organization and identification of the API.
2020-10-06Fix T81465: Snapping to edge center doesn't work as expected when using axis ↵Germano Cavalcante
locking The result was being affected by the view alignment correction. Regression introduced in rB4eda60c2d82d
2020-10-05Transform: Use orientation of active object with Auto ConstraintGermano Cavalcante
Fix T81429. This was an intentional change in rBc75a665c442e as it maintains the same behavior as the constraint with or without modifier. But from the user's PoV, it is better to keep the old behavior. This makes drawing and behavior more intuitive.
2020-09-25Fix T80937: Changing the contrain axis does not return to the scene orientationGermano Cavalcante
This was the behavior in old versions of blender. During a transformation operation, when pressing a contrain key, the chosen orientation is that of the scene. If you press the same key, the orientation changes to Global or Local. However, if you choose another contrain axis with the orientation changed, the orientation does not return to the set for the scene. It remains Global or Local. Now when changing a contrain axis, no matter what the current orientation is, it always returns to the scene orientation.
2020-09-23Fix T81069: Can't lock axis with move anymore, using Shift+MMBGermano Cavalcante
This fixes and reverts commit c7287ffaec59cecd4b63b4bb2ea1aaf44f09f704 Due to hardcodded keys, the modifier for auto contrain plane did not work with custom keymaps and was in conflict with other keyitems. Its usability is also confusing since it cannot be used without `MOD_PRECISION` But instead of removing it, it is better to make this modifier compatible with custom keymaps and keep the conflict.
2020-09-14Cleanup: remove unused functionJacques Lucke
The last usage was removed in {rB4eda60c2d82de0d7f7ded8ddf1036aea040e9c0d}.
2020-09-12Fix T80677: Absolute grid snapping doesn't work with constraintsGermano Cavalcante
Regression introduced in rB546b900194f0
2020-09-09Cleanup: reduce variable scopeJacques Lucke