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
2020-09-11Constraints: Child-Of, set inverse matrix upon creationJoseph Brandenburg
Set the inverse matrix when the Child Of constraint is created. This prevents the bone/object from jumping away when the constraint is added, improving usability. Reviewed by: sybren Differential Revision: https://developer.blender.org/D8851
2020-09-09Cleanup: reduce variable scopeJacques Lucke
2020-08-29Cleanup: spellingCampbell Barton
2020-08-17Cleanup: spellingCampbell Barton
2020-08-13Cleanup: spellingCampbell Barton
2020-08-08Cleanup: use array syntax for sizeof with fixed valuesCampbell Barton
Also order sizeof(..) first to promote other values to size_t.
2020-08-07Cleanup: pass arrays const where possibleCampbell Barton
2020-08-07Cleanup: Blenkernel, Clang-Tidy else-after-return fixesSybren A. Stüvel
This addresses warnings from Clang-Tidy's `readability-else-after-return` rule in the `source/blender/blenkernel` module. No functional changes.
2020-07-20T77086 Animation: Passing Dependency Graph to DriversSybren A. Stüvel
Custom driver functions need access to the dependency graph that is triggering the evaluation of the driver. This patch passes the dependency graph pointer through all the animation-related calls. Instead of passing the evaluation time to functions, the code now passes an `AnimationEvalContext` pointer: ``` typedef struct AnimationEvalContext { struct Depsgraph *const depsgraph; const float eval_time; } AnimationEvalContext; ``` These structs are read-only, meaning that the code cannot change the evaluation time. Note that the `depsgraph` pointer itself is const, but it points to a non-const depsgraph. FCurves and Drivers can be evaluated at a different time than the current scene time, for example when evaluating NLA strips. This means that, even though the current time is stored in the dependency graph, we need an explicit evaluation time. There are two functions that allow creation of `AnimationEvalContext` objects: - `BKE_animsys_eval_context_construct(Depsgraph *depsgraph, float eval_time)`, which creates a new context object from scratch, and - `BKE_animsys_eval_context_construct_at(AnimationEvalContext *anim_eval_context, float eval_time)`, which can be used to create a `AnimationEvalContext` with the same depsgraph, but at a different time. This makes it possible to later add fields without changing any of the code that just want to change the eval time. This also provides a fix for T75553, although it does require a change to the custom driver function. The driver should call `custom_function(depsgraph)`, and the function should use that depsgraph instead of information from `bpy.context`. Reviewed By: brecht, sergey Differential Revision: https://developer.blender.org/D8047
2020-06-25Cleanup: spellingCampbell Barton
2020-06-25Python API: add methods to allow copying of constraints.Alexander Gavrilov
Blender has an operator to do Copy & Paste of constraints between objects and bones, but no simple method to do that directly via the Python API is provided. This adds a copy() method to object and pose bone constraint collections. Differential Revision: https://developer.blender.org/D8112
2020-06-19UI: Fix check for constraint panel default expansionHans Goudey
2020-06-19UI: Drag and Drop Constraints, Layout UpdatesHans Goudey
This patch implements the list panel system D7490 for constraints. In this case the panels are still defined in Python. The layouts are also updated to use subpanels and the a more organized single column layout. There may be more tweaks necessary for the layouts. Reviewed By: Severin, billreynish, Mets Differential Revision: https://developer.blender.org/D7499
2020-05-28Cleanup: spellingCampbell Barton
2020-05-25Merge remote-tracking branch 'origin/blender-v2.83-release'Dalai Felinto
2020-05-25Fix T76941: "Set Inverse" in Child Of constraint broken with armaturesSybren A. Stüvel
When the Child Of constraint is owned by a bone, before the constraint is run the matrix is converted from world to pose space. However, setting the inverse should also take the armature object's transform into account.
2020-05-11Fix T76438: Wrong calculation of depth for Follow Track constraintSergey Sharybin
Need to transform direction as such, without adding translation component of the camera matrix.
2020-05-11Tracking: Cleanup, split code of follow track constraintSergey Sharybin
Makes a set of more isolated individual functions, which should make it more clear what's going on. Improved naming, added some comments. Some extra cleanup is possible to get rid of generic vectors called vec and disp.
2020-05-01Cleanup: moved drivers to BKE_fcurve_driver.h / fcurve_driver.cSybren A. Stüvel
All the driver-specific code in `fcurve.c` has been moved into a new file `fcurve_driver.c`. The corresponding declarations have been moved from `BKE_fcurve.h` to `BKE_fcurve_driver.h`. All the `#include "BKE_fcurve.h"` statements have been investigated and replaced with `BKE_fcurve_driver.h` where necessary. No functional changes.
2020-04-24Defaults: Change default axes for Track To constraintJulian Eisel
The main use-case for the Track To constraint is camera tracking, so this sets up a better default for this. That is, track to -Z with Y up. Agreed on internally with Pablo Vazquez and William Reynish. Should there be a reason to revert this, that would be fine compatibility-wise.
2020-04-20Tracking: Specify image image for (un)distortion modelSergey Sharybin
Allows to support distortion models which needs to know actual image dimensions to apply or inverse camera intrinsics.
2020-04-09Fix T75490: Child Of - difference between 2.82 and 2.83Sybren A. Stüvel
rB10162d68e385 introduced a difference in computing the matrix, as well as a better way to compute the inverse matrix. This commit reverts the former, while keeping the latter and some other improvements.
2020-04-03Code Quality: Replace for loops with LISTBASE_FOREACHDalai Felinto
Note this only changes cases where the variable was declared inside the for loop. To handle it outside as well is a different challenge. Differential Revision: https://developer.blender.org/D7320
2020-04-03Cleanup: split `BKE_anim.h` and `anim.c` into smaller piecesSybren A. Stüvel
The files are now split up into the following sections: - `BKE_anim_path.h` and `anim_path.c` for path/curve functions. - `BKE_anim_visualization.h` and `anim_visualizationanim_path.c` for animation visualization (mostly motion paths). - `BKE_duplilist.h` for DupliList function declarations. These were already implemented in `object_dupli.c`, so they were rather out of place being declared in `BKE_anim.h` in the first place. No functional changes.
2020-03-29Cleanup: spelling, commentsCampbell Barton
2020-03-20Cleanup: clang-format, comment indentationCampbell Barton
2020-03-19Cleanup: `make format` after SortedIncludes changeDalai Felinto
2020-03-16Cleanup: Typo in commentSergey Sharybin
2020-03-09Alembic: constraint for transform animation is using world matrix againSybren A. Stüvel
In rB7c5a44c71f13 I changed the way transform matrices are loaded from Alembic. Instead of having the Alembic importer convert matrices from local (in the Alembic file) to World (to pass to the constraint handling the animation of transforms), I set the constraint space to `CONSTRAINT_SPACE_LOCAL`. This worked thanks to rB7728bfd4c45c. However, that commit was reverted, which meant that for parentless objects `CONSTRAINT_SPACE_LOCAL` no longer means "local space". The situation is resolved by setting the constraint to world space again, and computing the world matrix in the Alembic importer.
2020-03-09Cleanup: Replace ABS/SQUARE/CUBE with function callsSergey Sharybin
While it might be handy to have type-less functionality which is similar to how C++ math is implemented it can not be easily achieved with just preprocessor in a way which does not have side-effects on wrong usage. There macros where often used on a non-trivial expression, and there was at least one usage where it was causing an actual side effect/bug on Windows (see change around square_f(sh[index++]) in studiolight.c). For such cases it is handy to have a function which is guaranteed to have zero side-effects. The motivation behind actually removing the macros is that there is already a way to do similar calculation. Also, not having such macros is a way to guarantee that its usage is not changed in a way which have side-effects and that it's not used as an inspiration for cases where it should not be used. Differential Revision: https://developer.blender.org/D7051
2020-03-09Revert "Constraints: remove special meaning of Local Space for parentless ↵Sybren A. Stüvel
Objects." This reverts commit 7728bfd4c45c634ba6b62e149176425ec5779945. Although this brings back an inconsistency in the behaviour of constraints on objects and bones, people were relying on the old behaviour, and the new behaviour broke their files. It is still desired to remove this inconsistency, but it will happen more gradually.
2020-03-06Cleanup: use 'BKE_' prefix for BKE_deform API callsCampbell Barton
- Use 'BKE_object_defgroup' prefix for object functions. - Rename 'defvert_verify_index' to 'defvert_ensure_index' since this adds the group if it isn't found.
2020-02-28Objects: make evaluated data runtime storage usable for types other than meshBrecht Van Lommel
This is in preparation of new object types. This only changes mesh_eval, we may do the same for mesh_deform_eval and other areas in the future if there is a need for it. This previously caused a bug in T74283, that should be fixed now. Differential Revision: https://developer.blender.org/D6695
2020-02-28Revert "Objects: make evaluated data runtime storage usable for types other ↵Brecht Van Lommel
than mesh" This reverts commit f2b95b9eae2ee913c99cff7595527b18d8b49d0a. Fix T74283: modifier display lost when moving object in edit mode. The cause is not immediately obvious so better to revert and look at this carefully.
2020-02-27Objects: make evaluated data runtime storage usable for types other than meshBrecht Van Lommel
This is in preparation of new object types. This only changes mesh_eval, we may do the same for mesh_deform_eval and other areas in the future if there is a need for it. Differential Revision: https://developer.blender.org/D6695
2020-02-27Constraints: replace 'Set Inverse' operator with an eval-time updateSybren A. Stüvel
This fixes {T70269}. Before this commit there was complicated code to try and compute the correct parent inverse matrix for the 'Child Of' and 'Object Solver' constraints outside the constraint evaluation. This was done mostly correctly, but did have some issues. The Set Inverse operator now defers this computation to be performed during constraint evaluation by just setting a flag. If the constraint is disabled, and thus tagging it for update in the depsgraph is not enough to trigger immediate evaluation, evaluation is forced by temporarily enabling it. This fix changes the way how the inverse matrix works when some of the channels of the constraint are disabled. Before this commit, the channel flags were used to filter both the parent and the inverse matrix. This meant that it was impossible to make an inverse matrix that would actually fully neutralize the effect of the constraint. Now only the parent matrix is filtered, while inverse is applied fully. As a result, pressing the 'Set Inverse' matrix produces the same transformation as disabling the constraint. This is also reflected in the changed values in the 'Child Of' unit test. This change is not backward compatible, but it should be OK because the old way was effectively unusable, so it is unlikely anybody relied on it. The change in matrix for the Object Solver constraint is due to a different method of computing it, which caused a slightly different floating point error that was slightly bigger than allowed by the test, so I updated the matrix values there as well. This patch was original written by @angavrilov and subsequently updated by me. Differential Revision: https://developer.blender.org/D6091
2020-02-25Cleanup: Constraints, simplified ChildOf evaluation functionSybren A. Stüvel
This un-indents the `childof_evaluate()` function by one level, making it easier to add new functionality in an upcoming commit. No functional changes.
2020-02-25Cleanup: Reduced indentation in objectsolver_evaluate()Sybren A. Stüvel
This will make an upcoming change cleaner to implement. No functional changes.
2020-02-14Alembic: refactor import and export of transformationsSybren A. Stüvel
The Alembic importer now works with local coordinates. Previously, the importer converted transformations from Alembic to world coordinates before processing them further; this processing often included re-converting to local coordinates. This change made it possible to remove some code that assumed that a child transform was only read after its parent transform. Blender's Alembic code follows the Maya convention, where in the zero orientation the camera looks forward instead of down. This extra rotation is now handled more consistently, and now also properly handles children of cameras. This fixes T73269. Unit tests were added to at least ensure that the importer and exporter are compatible with each other, and that static and animated camera transforms are handled in the same way.
2020-02-10Cleanup/refactor: Rename `BKE_library` files to `BKE_lib`.Bastien Montagne
Note that `BKE_library.h`/`library.c` were renamed to `BKE_lib_id.h`/`lib_id.c` to avoid having a too generic name here. Part of T72604.
2020-02-10Tracking: Fix usage PLACEHOLDER functionSergey Sharybin
Don't use BKE_view_layer_context_active_PLACEHOLDER which is marked as "never use this". In fact, it isn't needed to lookup for camera in the tracking function at all: camera object is always explicitly passed to it.
2020-02-07Constraint: Fix forced request of evaluated cameraSergey Sharybin
Constraint stack similarly to modifier stack is fully operate on what have been given to it, without requesting original or evaluated IDs. Validness of datablocks passed to constraint stack are to be handled on dependency graph/evaluation stream levels.
2019-12-24Action Constraint: introduce a mix mode setting.Alexander Gavrilov
Currently the action channels are applied after the existing transformation, as if the action controlled a child of the bone. This is not very natural, but more importantly, the transform tools are not designed to work conveniently with an additional 'pseudo-child' transformation, resulting in effects like an unexpected pivot location. Implementing a Before mode that integrates the action channels as if applied to a parent allows using the special transform tool code intended for dealing with such constraints. Note that in either mode, Action constraints should be added in reverse order, putting a new constraint before the existing ones that the Action was keyframed to work together. In order to implement the option, extract a utility from the Copy Transform constraint code for combining transforms with special anti-shear scale handling that matches the Aligned Inherit Scale mode. The Before mode also requires switching the constraint to the Local owner space, while the After mode can still use the World space for efficiency as before. Since the constraint doesn't have an Owner space option in the UI, this has to be handled in an RNA setter. For full backward compatibility, the original simple matrix multiplication mode is preserved as the third option, but it is not recommended due to creating shear. Differential Revision: https://developer.blender.org/D6297
2019-11-07Stretch To: implement a mode similar to Damped Track for rotation.Alexander Gavrilov
Most of the time Stretch To is used in actual rigs, like BlenRig or Rigify, in combination with Damped Track to handle rotation before the stretch, because it produces rotations more appropriate for organic deformation, and doesn't flip because of internal gimbal lock. The prevalence of this pattern suggests that Stretch To should support that kind of rotation directly as an option. Differential Revision: https://developer.blender.org/D6134
2019-11-07Stretch To: clean up the math code in the implementation.Alexander Gavrilov
Combine computing `size` and normalizing the matrix, invert the direction of `vec` to avoid negating it later, use `rescale_m4` instead of matrix multiplication to scale the final result. Differential Revision: https://developer.blender.org/D6134
2019-11-06Constraints: remove special meaning of Local Space for parentless Objects.Alexander Gavrilov
In 2011 special handling was introduced, apparently for no other reason than to address a complaint in T25707 that World and Local space are equivalent for objects without parent. This causes issues and confusion, as mentioned in rB599c8a2c8e4. This special meaning of Local Space is not documented in the manual, and is not known to experienced riggers, so removing it should not be a problem. Differential Revision: https://developer.blender.org/D6095
2019-09-14Cleanup: use const args, variablesCampbell Barton
2019-09-06Transformation Constraint: implement a Mix Mode option.Alexander Gavrilov
Allow selecting how the new location/rotation/scale is combined with the existing transformation. This is most useful for rotation, which has multiple options, and scale, which previously could only replace.
2019-09-06Transformation Constraint: initialize scale range values to 1 instead of 0.Alexander Gavrilov
2019-09-06Copy Transforms: add a mixing mode option.Alexander Gavrilov
Allow combining location, rotation and scale at the same time, using one constraint. The mixing modes are based on matrix multiplication, but handle scale in a way that avoids creating shear. Reviewers: brecht Differential Revision: https://developer.blender.org/D5640