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-26Fix T100633: Node Editor: Edge scrolling breaks node snappingGermano Cavalcante
The view offset, calculated by the Edge Pan system, only affects the position of the nodes, but forget to update: - snapping data - final value of transform - values used for custom drawing Therefore, to avoid having to update a lot of scattered data, the `transformViewUpdate` utility has been implemented to recalculate input values when the view changes. This utility does more than is necessary to fix the bug, but with that, it can work in any situation.
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-04-04Cleanup: ensure space after file named in headersCampbell Barton
Add blank lines after file references to avoid them being interpreted as doc-strings the following declarations.
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
2022-01-20Subdivision: add support for vertex creasingKévin Dietrich
This adds vertex creasing support for OpenSubDiv for modeling, rendering, Alembic and USD I/O. For modeling, vertex creasing follows the edge creasing implementation with an operator accessible through the Vertex menu in Edit Mode, and some parameter in the properties panel. The option in the Subsurf and Multires to use edge creasing also affects vertex creasing. The vertex crease data is stored as a CustomData layer, unlike edge creases which for now are stored in `MEdge`, but will in the future also be moved to a `CustomData` layer. See comments for details on the difference in behavior for the `CD_CREASE` layer between egdes and vertices. For Cycles this adds sockets on the Mesh node to hold data about which vertices are creased (one socket for the indices, one for the weigths). Viewport rendering of vertex creasing reuses the same color scheme as for edges and creased vertices are drawn bigger than uncreased vertices. For Alembic and USD, vertex crease support follows the edge crease implementation, they are always read, but only exported if a `Subsurf` modifier is present on the Mesh. Reviewed By: brecht, fclem, sergey, sybren, campbellbarton Differential Revision: https://developer.blender.org/D10145
2022-01-07Cleanup: remove redundant const qualifiers for POD typesCampbell Barton
MSVC used to warn about const mismatch for arguments passed by value. Remove these as newer versions of MSVC no longer show this warning.
2021-12-08Cleanup: move public doc-strings into headers for 'editors'Campbell Barton
Ref T92709
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-08-19Cleanup: move animation snap utilities to a separate compilation unitGermano Cavalcante
The snap functions of animation editors were scattered in `transform_mode` and `transform_snap`.
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-27Cleanup: inconsistent parameter nameJacques Lucke
2021-05-26Cleanup: array-parameter warning with GCC 11Campbell Barton
Pass the string size as this is less error prone in general.
2021-05-12Fix 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-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.
2020-12-02Transform: Correct Mirror for Object Mode along arbitrary axisHenrik Dick
This fixes T68521, T82334. The object are not properly mirrored in object mode. For mirroring an object that has an arbitrary rotation along the X axis this is the procedure: 1. mirror x location. 2. negate x scale of the 3. negate y and z component of the rotation (independent of which rotation mode is used). This knowledge applies now for all angles and axes to finally make the mirror operation work in object mode. The new mirror function has the downside that it can not (in this form) be used with proportional editing. This is no problem since the old behavior can still be replicated by scaling with -1 along any axis. The solution to get perfect mirrors can not work for scaling in general, because in that case there could be scew created. Reviewed By: mano-wii Differential Revision: https://developer.blender.org/D9625
2020-09-30Cleanup: sort struct declarationsCampbell Barton
2020-08-07Code Style: use "#pragma once" in source directoryJacques Lucke
This replaces header include guards with `#pragma once`. A couple of include guards are not removed yet (e.g. `__RNA_TYPES_H__`), because they are used in other places. This patch has been generated by P1561 followed by `make format`. Differential Revision: https://developer.blender.org/D8466
2020-06-26Fix T78151: Vertex/Edge Slide after enabling 'Even' doesn't cancel properlyGermano Cavalcante
Problem introduced by rBcf42721f
2020-06-23Fix T78045: CTL-ALT-S does nothing in pose mode and crashes when called from ↵Germano Cavalcante
the menu
2020-06-15Cleanup: Rearrange Vert and Edge slide functionsGermano Cavalcante
And make `trans_mesh_customdata_correction` a more generic utility.
2020-05-21Fix T76935: Current orientation not taken in account when using "Align to ↵Germano Cavalcante
transform orientation"
2020-03-14Cleanup: sort file lists & struct declatationsCampbell Barton
2020-02-21Cleanup: Move transform_mode_init to transform_mode APIGermano Cavalcante
2020-02-16Cleanup: Transform: Rearrange definitions and declarationsmano-wii
2020-02-14Cleanup: Rename bonesize transform filemano-wii
`transform_mode_bonesize.c` --> `transform_mode_bbone_resize.c`
2020-02-14Cleanup: Split transform.c in multiple filesmano-wii
Differential Revision: https://developer.blender.org/D5819