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-08-08Merge branch 'blender-v3.3-release'Germano Cavalcante
2022-08-08Revert "Fix T100280: GG not toggling the offset transform mode in tracker"Germano Cavalcante
This reverts commits b72eddac6190353714745756dcc335f98cda1369 and f8b5706a1ffe61ae3bdd949ad851d6e9ff3fe188. And fixes T100265. It brings more problems than solutions.
2022-08-08Merge branch 'blender-v3.3-release'Germano Cavalcante
2022-08-08Fix T100280: GG not toggling the offset transform mode in trackerGermano Cavalcante
Caused by {rB791bfae1d64b}. The solution was to create the special handle for the Move Clip and Mask transformation. One change that cannot be reversed is showing the `G` shortcut in the statusbar. But the description of this shortcut was not even correct before.
2022-08-06Cleanup: Simplify NULL handling for BKE_image_find_nearest_tileChris Blackbourn
Differential Revision: https://developer.blender.org/D15616
2022-07-22Cleanup: add BKE_image_find_nearest_tile_with_offsetCampbell Barton
Every caller BKE_image_find_nearest_tile was calculating the tile offset so add a version of this function that returns the offset too.
2022-07-15Cleanup: separate clipUVTransform into two different functionsChris Blackbourn
No functional changes. Prep for D15420 / T98061.
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-06-06Refactor: Snap-related. Clarified attribute names and refactored #defines ↵jon denning
into enums The transformation snapping code contains a bunch of `#define`s, some ambiguously or incorrectly named attributes. This patch contains refactored code to improve this. This patch does (should) not change functionality of snapping. Clarified ambiguously / incorrectly named attributes. - "Target" is used to refer to the part of the source that is to be snapped (Active, Median, Center, Closest), but several other areas of Blender use the term "target" to refer to the thing being snapped to and "source" to refer to the thing getting snapped. Moreover, the implications of the previous terms do not match the descriptions. For example: `SCE_SNAP_TARGET_CENTER` does not snap the grabbed geometry to the center of the target, but instead "Snap transforamtion center onto target". - "Select" refers to the condition for an object to be a possible target for snapping. - `SCE_SNAP_MODE_FACE` is renamed to `SCE_SNAP_MODE_FACE_RAYCAST` to better describe its affect and to make way for other face snapping methods (ex: nearest). Refactored related `#define` into `enum`s. In particular, constants relating to... - `ToolSettings.snap_flag` are now in `enum eSnapFlag` - `ToolSettings.snap_mode` are now in `enum eSnapMode` - `ToolSettings.snap_source` (was `snap_target`) are now in `enum eSnapSourceSelect` - `ToolSettings.snap_flag` (`SCE_SNAP_NO_SELF`) and `TransSnap.target_select` are now in `enum eSnapTargetSelect` As the terms became more consistent and the constants were packed together into meaningful enumerations, some of the attribute names seemed ambiguous. For example, it is unclear whether `SnapObjectParams.snap_select` referred to the target or the source. This patch also adds a small amount of clarity. This patch also swaps out generic types (ex: `char`, `short`, `ushort`) and unclear hard coded numbers (ex: `0`) used with snap-related enumerations with the actual `enum`s and values. Note: I did leave myself some comments to follow-up with further refactoring. Specifically, using "target" and "source" consistently will mean the Python API will need to change (ex: `ToolSettings.snap_target` is not `ToolSettings.snap_source`). If the API is going to change, it would be good to make sure that the used terms are descriptive enough. For example, `bpy.ops.transform.translate` uses a `snap` argument to determine if snapping should be enabled while transforming. Perhaps `use_snap` might be an improvement that's more consistent with other conventions. This patch is (mostly) a subset of D14591, as suggested by @mano-wii. Task T69342 proposes to separate the `Absolute Grid Snap` option out from `Increment` snapping method into its own method. Also, there might be reason to create additional snapping methods or options. (Indeed, D14591 heads in this direction). This patch can work along with these suggestions, as this patch is trying to clarify the snapping code and to prompt more work in this area. Reviewed By: mano-wii Differential Revision: https://developer.blender.org/D15037
2022-06-05UI: show gizmo while transformingCampbell Barton
When interacting with translate/rotate/scale gizmo, show the gizmo while it's in use. There are some exceptions to this, as showing all scale gizmos while scaling causes the gizmos to become large & distracting so in this case only the gizmo being dragged is shown. Resolves T63743.
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-21Fix T94191: correct (time) translation headers not showing DeltaXGermano Cavalcante
Caused by {rBb0d9e6797fb8} For the header (both Graph Editor case in general `headerTranslation` as well as `headerTimeTranslate`) we are interested in deltas values (not absolute values). Since culprit commit, `snapFrameTransform` was not working with deltas anymore, but we have to compensate for this. For the Graph Editor, this only worked "by accident" in rB7192e57d63a5, since `ival` is still zero at this point. So now, reacquire the delta right after the snap operation. Also use a more appropriate center value in the translate operator. Maniphest Tasks: T94191 Differential Revision: https://developer.blender.org/D13641
2021-12-14Cleanup: correct unbalanced doxygen groupsCampbell Barton
Also add groups in some files.
2021-11-08Cleanup: Grammar in commentsHans Goudey
2021-08-25Fix wrong length value in the header of the Move operatorGermano Cavalcante
Missed in {rB0d36439f95c0}.
2021-08-25Fix T90911: Move along axis does not display real distance unitsGermano Cavalcante
Variable was wrongly set to 0. Caused by {rB7192e57d63a5}.
2021-08-19Fix the value in the graphical editor header when transformingGermano Cavalcante
The header did not display the actual value when transforming with snapping
2021-07-24UI: Do not abbreviate/shorten wordingAaron Carlisle
Abbreviations are harder to read and understand thus it is best to be direct. For example without understanding and context it is hard to know exactly what "Len" means.
2021-07-01Cleanup: replace booleans with enum for storing translate rotationCampbell Barton
2021-07-01Correction to T89571 fix 4546f176eb0f822048b53766f2e97c5a4cbf53c6Campbell Barton
Supporting both object & edit-mode is more involved. Both cases are now supported with object mode tracking the last-used state for rotation so it's only reset once when rotation is disabled.
2021-07-01Fix T89571: Align Orientation to Target keeps rotation when toggledCampbell Barton
2021-06-30Cleanup: rename transform mode variablesCampbell Barton
Use the term 'mat_final' for calculated matrices used for transforming. Also rename 'pivot' to 'pivot_local'.
2021-06-30Transform: support multi-threading for most modesCampbell Barton
Multi-threading support for transform modes: bevel-weight, crease, push-pull, rotate, shear, shrink-fatten, skin-resize, to-sphere, trackball & translate. This is done using a parallel loop over transform data. From testing a 1.5million polygon mesh on a 32 core system the overall performance gains were between ~20-28% To ensure the code is thread-safe arguments to shared data are const. Reviewed By: mano-wii
2021-06-30Cleanup: split uses of _snap_sequencer_apply according to transform modeGermano Cavalcante
The `applySnap` callback of each mode was overwriting the value calculated in `transform_snap_sequencer_apply`.
2021-06-29Cleanup: translate commentsCampbell Barton
It wasn't so clear why the POINT_INIT check was disabled, move this into the code comment.
2021-06-28Transform: Move "Proportional Size" and "AutoIK-Len" values to the beginning ↵Germano Cavalcante
of the header This prevents the text from shaking while transforming.
2021-06-25Fix T87185: value assigned to modal Scale does not work properlyCampbell Barton
`t->values` does not necessarily represent a final value of the transformation, as each mode treats this value differently. So, unfortunately, we cannot have a generic offset solution for modal transform operations. Offset needs to be handled by each mode. Note: Currently only, `Move`, `Rotate` and `Resize` support this.
2021-06-23Cleanup: compiler warning for invalid argument typeCampbell Barton
2021-06-22Transform: display units for proportional edit valueGermano Cavalcante
This fixes T88346. The code is also more readable by making a better distinction between the texts used for Distances, "Proportional Size" and "AutoIK-Len". And the text used to translate the "Proportional Size" is reused.
2021-06-22Cleanup: deduplicate code and rename variablesGermano Cavalcante
This makes it clearer that variables are strings and how they are used in the Move header code.
2021-05-27Fix incorrect BLI_snprintf usageCampbell Barton
Event though in practice this wasn't causing problems as the fixed size buffers are generally large enough not to truncate text. Using the result from `snprint` or `BLI_snprintf` to step over a fixed size buffer allows for buffer overruns as the returned value is the size needed to copy the entire string, not the number of bytes copied. Building strings using this convention with multiple calls: ofs += BLI_snprintf(str + ofs, str_len_max - ofs); .. caused the size argument to become negative, wrapping it to a large value when cast to the unsigned argument.
2021-05-24Fix T88478: Fallback to dolly not working when moving the camera in camera viewGermano Cavalcante
This fallback is an old hack. It is difficult to have an orientation convention when several random factors determine which one should be used. In this case, to "fix" the problem, a new behavior had to be implemented. Now the redo when moving the camera in `Camera View` has the default orientation as `View`.
2021-05-20Fix T87947: Trasnform: Keyboard input uses view orientationGermano Cavalcante
When activated in modal, `translate`, `resize`, `rotate`, `shear` and `edge_rotate_normal` use a different orientation than the set in scene. This orientation needed to match since some of these modes can be switched during operation. The default orientation for these modes was `V3D_ORIENT_VIEW`. And this changed when finishing the `translate` and `resize` to `V3D_ORIENT_GLOBAL`. But this could cause inconsistencies when inputting values from the keyboard. The solution now is to change the orientation when you change the mode. --- Note: Although the user can expect the value entered to reflect the orientation set in the scene, it would require a lot of changes and would not be really useful.
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-01-11Transform: In the Header, show translation value in local space only with ↵Germano Cavalcantemano-wii
constraint This partially reverts commit ad15e764dd92. The local value is only useful with constraint.
2021-01-11Transform: In the Header, show the translation value in local spaceGermano Cavalcantemano-wii
Showing value in the global space was an unintentional change.
2021-01-11Fix Increment Snapping Without Constraints in Non-Axis-Aligned ViewsGermano Cavalcantemano-wii
The incremental snap was always operating in the local space, which in most cases is the VIEW type orientation. Use only local space when the operation is affected by constraint. Differential Revision: https://developer.blender.org/D10052
2020-12-16Fix T83801: UVEditor translation ignores "Pixel Coordinates" and aspectPhilipp Oeser
ratio Caused by rB4eda60c2d82d. T83801 reported not moving in pixel space, but even without that toggle above commit caused the translation to not take apsect ratio into account properly [a translation of 1 on the x axis for example on an image with non 1:1 aspect ration caused the UVs to not end up in the same place on the next 'tile'] Above commit removed 'removeAspectRatio()' [the counterpart of applyAspectRatio -- which does the pixel coord correction internally] from 'applyTranslation()'. This was also reported in T83352 [which was closed by rBf3b08af24c9f -- but that only solved the displax in header, not the actual transformation] Now bring back 'removeAspectRatio()'. Maniphest Tasks: T83801 Differential Revision: https://developer.blender.org/D9869
2020-12-03Fix T83352: Move with constraint showing an incorrect value in the headerGermano Cavalcante
The displayed value was always that of the x axis.
2020-11-27Fix transform snap mixed with incrementalGermano Cavalcante
The incremental was taking priority but the other elements are mandatory.
2020-10-27Cleanup: use over-line for doxy commentsCampbell Barton
Follow our code style for doxygen sections.
2020-10-08Cleanup: Simplify use of 'Snapping Gears'Germano Cavalcante
This commit removes `t->snap[0]` and `t->snap_spatial[0]`. They were not actually being used, and could add overhead for transformation without snap.
2020-09-24Fix T81096, T81127: Errors with the typed value for x-axis constrainGermano Cavalcante
`applyNumInput` does not write all axis values and does not consider the orientation.
2020-09-12Fix T80677: Absolute grid snapping doesn't work with constraintsGermano Cavalcante
Regression introduced in rB546b900194f0
2020-09-09Cleanup: Rename public "bUnit" functionsHans Goudey
This commit renames the functions in "BKE_unit.h` to be consistent with the naming in the rest of blenkernel. bUnit_AsString -> BKE_unit_value_as_string_adaptive bUnit_AsString2 -> BKE_unit_value_as_string bUnit_ReplaceString -> BKE_unit_replace_string bUnit_ApplyPreferredUnit -> BKE_unit_apply_preferred_unit bUnit_ToUnitAltName -> BKE_unit_name_to_alt bUnit_ClosestScalar -> BKE_unit_closest_scalar bUnit_BaseScalar -> BKE_unit_base_scalar bUnit_IsValid -> BKE_unit_is_valid bUnit_GetSystem -> BKE_unit_system_get bUnit_GetBaseUnit -> BKE_unit_base_get bUnit_GetBaseUnitOfType -> BKE_unit_base_of_type_get bUnit_GetName -> BKE_unit_name_get bUnit_GetNameDisplay -> BKE_unit_display_name_get bUnit_GetIdentifier -> BKE_unit_identifier_get bUnit_GetScaler -> BKE_unit_scalar_get bUnit_IsSuppressed -> BKE_unit_is_suppressed Differential Revision: https://developer.blender.org/D8828
2020-08-31Cleanup/Refactor: Split the snap to increments codeGermano Cavalcante
Now we have a better distinction of what is snap to grid and what is snap to increments. The code also allows the implementation of mixed snap for these modes.
2020-07-21Cleanup: move 'int i' declarationGermano Cavalcante
It is preferable that the value used for interators is defined close to where it is used.
2020-07-14Fix T78875: Numerical display of delta of translation is not updating in 3d viewGermano Cavalcante
2020-06-22Transform: Full snapping support for Vert SlideGermano Cavalcante
Now all options for "snap to" affect the Vert Slide mode. Reviewed By: campbellbarton Maniphest Tasks: T66426 Differential Revision: https://developer.blender.org/D3440
2020-06-18Cleanup: Move snap callbacks to their respective transform modeGermano Cavalcante
These functions are very specific to the mode. More modes can support snap, and there is no reason to keep all callbacks for each mode in the transform_snap.c file.