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-11-02Refactor: Rename Object->imat to Object->world_to_objectSergey Sharybin
The goal is to improve clarity and readability, without introducing big design changes. Follows the recent obmat to object_to_world refactor: the similar naming is used, and it is a run-time only rename, meaning, there is no affect on .blend files. This patch does not touch the redundant inversions. Those can be removed in almost (if not all) cases, but it would be the best to do it as a separate change. Differential Revision: https://developer.blender.org/D16367
2022-11-01Refactor: Rename Object->obmat to Object->object_to_worldSergey Sharybin
Motivation is to disambiguate on the naming level what the matrix actually means. It is very easy to understand the meaning backwards, especially since in Python the name goes the opposite way (it is called `world_matrix` in the Python API). It is important to disambiguate the naming without making developers to look into the comment in the header file (which is also not super clear either). Additionally, more clear naming facilitates the unit verification (or, in this case, space validation) when reading an expression. This patch calls the matrix `object_to_world` which makes it clear from the local code what is it exactly going on. This is only done on DNA level, and a lot of local variables still follow the old naming. A DNA rename is setup in a way that there is no change on the file level, so there should be no regressions at all. The possibility is to add `_matrix` or `_mat` suffix to the name to make it explicit that it is a matrix. Although, not sure if it really helps the readability, or is it something redundant. Differential Revision: https://developer.blender.org/D16328
2022-10-07Cleanup: redundant parenthesisCampbell Barton
2022-09-29Cleanup: Simplify code and remove duplicationsAntonio Vazquez
This commit simplify the previous fix for T101455 f6c2f1c65e146bf20b9182f275b67c747d9e2990
2022-09-29Fix T101455: GPencil Gizmo in wrong location when using Active ElementAntonio Vazquez
The gizmo was not set when this option was selected. By design, in grease pencil the active element option uses the object origin as pivot point.
2022-09-14ViewLayer: Lazy sync of scene data.Monique Dewanchand
When a change happens which invalidates view layers the syncing will be postponed until the first usage. This will improve importing or adding many objects in a single operation/script. `BKE_view_layer_need_resync_tag` is used to tag the view layer to be out of sync. Before accessing `BKE_view_layer_active_base_get`, `BKE_view_layer_active_object_get`, `BKE_view_layer_active_collection` or `BKE_view_layer_object_bases` the caller should call `BKE_view_layer_synced_ensure`. Having two functions ensures that partial syncing could be added as smaller patches in the future. Tagging a view layer out of sync could be replaced with a partial sync. Eventually the number of full resyncs could be reduced. After all tagging has been replaced with partial syncs the ensure_sync could be phased out. This patch has been added to discuss the details and consequences of the current approach. For clarity the call to BKE_view_layer_ensure_sync is placed close to the getters. In the future this could be placed in more strategical places to reduce the number of calls or improve performance. Finding those strategical places isn't that clear. When multiple operations are grouped in a single script you might want to always check for resync. Some areas found that can be improved. This list isn't complete. These areas aren't addressed by this patch as these changes would be hard to detect to the reviewer. The idea is to add changes to these areas as a separate patch. It might be that the initial commit would reduce performance compared to master, but will be fixed by the additional patches. **Object duplication** During object duplication the syncing is temporarily disabled. With this patch this isn't useful as when disabled the view_layer is accessed to locate bases. This can be improved by first locating the source bases, then duplicate and sync and locate the new bases. Will be solved in a separate patch for clarity reasons ({D15886}). **Object add** `BKE_object_add` not only adds a new object, but also selects and activates the new base. This requires the view_layer to be resynced. Some callers reverse the selection and activation (See `get_new_constraint_target`). We should make the selection and activation optional. This would make it possible to add multiple objects without having to resync per object. **Postpone Activate Base** Setting the basact is done in many locations. They follow a rule as after an action find the base and set the basact. Finding the base could require a resync. The idea is to store in the view_layer the object which base will be set in the basact during the next sync, reducing the times resyncing needs to happen. Reviewed By: mont29 Maniphest Tasks: T73411 Differential Revision: https://developer.blender.org/D15885
2022-09-14Adding `const Scene*` parameter in many areas.Monique Dewanchand
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
2022-09-01Cleanup: Remove/replace View Layer macros.Monique Dewanchand
This patch is a cleanup required before refactoring the view layer syncing process {T73411}. * Remove FIRSTBASE. * Remove LASTBASE. * Remove BASACT. * Remove OBEDIT_FROM_WORKSPACE. * Replace OBACT with BKE_view_layer_active_object. * Replace OBEDIT_FROM_VIEW_LAYER with BKE_view_layer_edit_object. Reviewed By: mont29 Maniphest Tasks: T73411 Differential Revision: https://developer.blender.org/D15799
2022-06-07Remove workaround for drawing the rotation gizmoGermano Cavalcante
Since [0], transform gizmos are no longer hidden during transform. The same can be observed for rotation gizmos. However, as a workaround for these rotation gizmos, there was already a drawing utility running. With the gizmo and the utility this drawing is now being done twice. So remove the utility/workaround and update the gizmo accordingly. [0] {648350e456490f8d6258e7de9bf94d3a6a34dbb2} Differential Revision: https://developer.blender.org/D9542
2022-06-06UI: offset scale gizmos instead of scaling their shapeCampbell Barton
Scaling handles while dragging could be distracting, especially at extreme values where handles could become large on-screen. Now all gizmos are shown while scaling. GIZMO_GT_arrow_3d now now support changing their length while being dragged as well as negative lengths.
2022-06-05UI: align gizmo scale handles to both Y and Z axesCampbell Barton
This resolves a minor inconsistency displaying the scale gizmo handles since they're cubes it's noticeable when they're not axes aligned.
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-03-29Fix T96347: Pose gizmo shown at wrong location with multiple objectsCampbell Barton
Regression in [0] error iterating over pose bones which only used the active-object, also follow the same logic as edit-mode for using the local-matrix. [0]: d052169e7e4b84b5d621fcbf15b187a4951f1f70
2022-03-14RNA: Generate property declerations header, solving msg-bus C++ incompatibilityJulian Eisel
Lets `makesrna` generate a `RNA_prototypes.h` header with declarations for all RNA properties. This can be included in regular source files when needing to reference RNA properties statically. This solves an issue on MSVC with adding such declarations in functions, like we used to do. See 800fc1736748. Removes any such declarations and the related FIXME comments. Reviewed By: campbellbarton, LazyDodo, brecht Differential Revision: https://developer.blender.org/D13837
2022-03-12Fix transform gizmo check for shift to constrain to a planeCampbell Barton
The eventstate was checked instead of the current event being handled, causing the check to be invalid in some cases.
2022-02-25Cleanup: use flags for wmEvent modifier keysCampbell Barton
Using flags makes checking multiple modifiers at once more convenient and avoids macros/functions such as IS_EVENT_MOD & WM_event_modifier_flag which have been removed. It also simplifies checking if modifier keys have changed.
2022-02-18Cleanup: Rename original curve object type enumHans Goudey
This commit renames enums related the "Curve" object type and ID type to add `_LEGACY` to the end. The idea is to make our aspirations clearer in the code and to avoid ambiguities between `CURVE` and `CURVES`. Ref T95355 To summarize for the record, the plans are: - In the short/medium term, replace the `Curve` object data type with `Curves` - In the longer term (no immediate plans), use a proper data block for 3D text and surfaces. Differential Revision: https://developer.blender.org/D14114
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-02-02Cleanup: shadow warning, remove unused flagsCampbell Barton
2022-02-02Cleanup: restructure 'transform_convert_pose_transflags_update'Germano Cavalcante
Move the bones count and `has_translate_rotate` parameter out of the function as they are not required in some places.
2021-12-08Cleanup: move public doc-strings into headers for 'editors'Campbell Barton
Ref T92709
2021-11-12Gizmo: adjust when gizmo protection flags are displayedCampbell Barton
Restore behavior reverted in 0ea60cf6b813f8b792a253e10a6c2edaf7fb689f but only for location as it makes sense to use protection flags in global mode in that case.
2021-11-12Fix gizmo protection flag use in object modeCampbell Barton
Channel protection flags were only used in global mode, this doesn't make any sense, especially for rotation and scale. Follow pose-bones, only using protection flags for local & gimbal orientation.
2021-11-11Fix T92867: Gimbal rotation broken when used for multiple objectsCampbell Barton
Support gimbal orientation for objects & bones.
2021-11-11Cleanup: split gimbal_axis into pose and objectCampbell Barton
Allow access to a single bones gimbal matrix.
2021-11-01Fix scale cage gizmo in pose-modeCampbell Barton
The active objects matrix was ignored when calculating the cage.
2021-10-29Gizmo: support showing transform gizmos in pose + weight-paint modeCampbell Barton
These can be enabled in the gizmos popover.
2021-10-06Gizmo: remove wmGizmoGroup.use_fallback_keymapCampbell Barton
This ended up being a copy of: `toolsettings->workspace_tool_type == SCE_WORKSPACE_TOOL_FALLBACK` requiring boiler plate assignment in gizmos refresh callbacks. Remove this struct member and check `toolsettings->workspace_tool_type` directly, since so far there has been no advantage in gizmo-groups being able to control this themselves.
2021-09-15Gizmo: add flag to hide the gizmo group during interactionCampbell Barton
This allows a hack to be removed that temporarily overwrote the 3D views gizmo display flag. Also reverse change from fb27a9bb983ce74b8d8f5f871cf0706dd1e25051 that runs poll on modal gizmo groups as there is some risk that the poll function unlinks the gizmo.
2021-08-31Transform: avoid passing the context to extended orientation functionsCampbell Barton
This makes it possible to calculate orientation from functions that don't have the context.
2021-07-30Cleanup: clang-format (re-run after v12 version bump)Campbell Barton
2021-06-26Cleanup: full sentences in comments, improve comment formattingCampbell Barton
2021-04-01Cleanup/Refactor: Transform Orientation: Use 'orient_index' instead ↵Germano Cavalcante
'orient_type' `orient_index` is a more comprehensive value as it reveals both the type and index. Differential Revision: https://developer.blender.org/D9595
2021-02-05Cleanup: correct spelling in commentsCampbell Barton
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-03Merge branch 'blender-v2.92-release'Germano Cavalcante
# Conflicts: # source/blender/editors/transform/transform_constraints.c
2021-02-03Fix unreported: Rotation Gizmo "C" influenced by custom orientationGermano Cavalcante
The white rotation Gizmo should always use the View orientation. Before, if you set an orientation for the gizmo other than the default, that gizmo would behave like the contraint Z Gizmo.
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-31Revert "Fix T83092: Direction of rotation with View orientation changed in 2.91"Germano Cavalcante
This reverts commit f9e994d0f463abb87761591e30c47a9613be6cca. And fixes T85227. That commit created an inverted orientation matrix but the 'Align to Transform Orientation' operator doesn't work well with inverted matrices.
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-30Revert "Fix T83092: Direction of rotation with View orientation changed in 2.91"Germano Cavalcante
This reverts commit f9e994d0f463abb87761591e30c47a9613be6cca. And fixes T85227. That commit created an inverted orientation matrix but the 'Align to Transform Orientation' operator doesn't work well with inverted matrices.
2021-01-16GPencil: Add new parameteres to transform layersAntonio Vazquez
When using grease pencil for drawing Storyboards, it's very common to require a transform of the layers. This transform can be done using the offset modifier, but in some cases, the scene requires a lot of modifiers and makes the file hard to work. This new feature adds a transforms Location, Rotation and Scale at Layer level, and allows to transform the layer without using a modifier, keeping the scene more clean. {F9480695} This feature was suggested by @pepeland after receiving feedback from several artists. Also, done some code cleanup and rename some functions to get a better naming. Maniphest Tasks: T83660 Differential Revision: https://developer.blender.org/D9761
2020-12-28Fix T84200: Rotating a paintcurve [all paintmodes] doesn’t work correctlyGermano Cavalcante
The transform code did not provide a 2d context to be used in 3d space. The solution is to set all matrices for the screen space in these cases. This commit also removes the dial3d drawing in these cases. It was not correct anyway.
2020-11-27Fix T83092: Direction of rotation with View orientation changed in 2.91Germano Cavalcante
The change was intentional so that the orientation matrices match (`rv3d->viewinv` becomes equal to the orientation matrix). But, although in a projection matrix the Z axis is negative, this should not be so from the user's point of view. So the solution here is to negate the Z axis when the View orientation is chosen. This affects all modes, but is only evident for rotation. --- Another change here is to use the final rotation value (`values_final`) for the gizmo drawing since this value can be changed by the mode.
2020-11-13GPencil: Merge GSoC curve edit modeFalk David
Differential Revision: https://developer.blender.org/D8660 This patch is the result of the GSoC 2020 "Editing Grease Pencil Strokes Using Curves" project. It adds a submode to greasepencil edit mode that allows for the transformation of greasepencil strokes using bezier curves. More information about the project can be found here: https://wiki.blender.org/wiki/User:Filedescriptor/GSoC_2020.
2020-11-06Cleanup: transform.h comments, use doxy sectionsCampbell Barton
2020-10-10Cleanup: use C comments for descriptive textCampbell Barton
Follow our code style guide by using C-comments for text descriptions.
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-10-02Cleanup: Move `EditBone` structure definition from `ED` to `BKE` area.Bastien Montagne
Access to this structure will be needed in BKE's armature code.