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
2021-07-03Cleanup: consistent use of tags: NOTE/TODO/FIXME/XXXCampbell Barton
Also use doxy style function reference `#` prefix chars when referencing identifiers.
2021-07-02Cleanup: Further use of const when accessing evaluated meshHans Goudey
Also resolve a warning from the previous commit. The next blocker to using const is `BKE_mesh_wrapper_ensure_mdata`.
2021-07-02Cleanup: Fix variable redeclaration warningHans Goudey
2021-07-02Cleanup: Remove unused/unneeded code from old Asset Engine designJulian Eisel
This code was written for the File Browser together with the Asset Engine design, that is not part of the Asset Browser/System design anymore. Updated comments accordingly. `FileDirEntryRevision` was actually used, but I removed it and moved the used members to the parent `FileDirEntry`, since there is no concept of revisions currently. There should be no functional changes.
2021-07-02Constraints: support a new Local Space (Owner Orientation) for targets.Alexander Gavrilov
Add a new transformation space choice for bone constraints, which represent the local transformation of the target bone in the constraint owner's local space. The use case for this is transferring the local (i.e. excluding the effect of parents) motion of one bone to another one, while ignoring the difference between their rest pose orientations. The new option replaces the following setup: * A `child` bone of the `target`, rotated the same as `owner` in rest pose. * A `sibling` bone of the `target`, positioned same as `child` in rest pose and using Copy Transforms in World Space from `child`. * The `owner` bone constraint uses Local Space of `sibling`. (This analogy applies provided both bones use Local Location) Differential Revision: https://developer.blender.org/D9493
2021-07-02Copy Transforms: implement Remove Target Shear and more Mix options.Alexander Gavrilov
This constraint can be naturally viewed as a prototype for a future 4x4 matrix math node (or subset thereof), since its basic semantics already is matrix assignment. Thus it makes sense to add math options to this constraint to increase flexibility in the meantime. This patch adds support for several operations that would be useful: - An option to remove shear in the incoming target matrix. Shear is known to cause issues for various mathematical operations, so an option to remove it at key points is useful. Constraints based on Euler like Copy Rotation and Limit Rotation already have always enabled shear removal built in, because their math doesn't work correctly with shear. In the future node system shear removal would be a separate node (and currently Limit Rotation can be used as a Remove Shear constraint). However removing shear from the result of the target space conversion before mixing (similar to Copy Rotation) has to be built into Copy Transforms itself as an option. - More ways to combine the target and owner matrices. Similar to multiple Inherit Scale modes for parenting, there are multiple ways one may want to combine matrices based on context. This implements 3 variants for each of the Before/After modes (one of them already existing). - Full implements regular matrix multiplication as the most basic option. The downside is the risk of creating shear. - Aligned emulates the 'anti-shear' Aligned Inherit Scale mode, and basically uses Full for location, and Split for rotation/scale. (This choice already existed.) - Split Channels combines location, rotation and scale separately. Looking at D7547 there is demand for Split Channels in some cases, so I think it makes sense to include it in Copy Transforms too, so that the Mix menu items can be identical for it and the Action constraint. Differential Revision: https://developer.blender.org/D9469
2021-07-02File Browser: Refactor file "UUID" code (which wasn't really a "UUID")Julian Eisel
To some degree these are changes in preparation of further Asset Browser related changes, see D11119. But also, the current UUID design was written for the old Asset Engine design, which isn't part of the current Asset Browser/System design anymore. And lastly, "UUID" are a well established standard (https://en.wikipedia.org/wiki/Universally_unique_identifier) which this implementation didn't follow. What we have here is more of an index, or a unique identifier (https://en.wikipedia.org/wiki/Unique_identifier). So this does the following changes: * Renames "UUID" to "UID" * Changes the type of the UID to (a typedef'ed) `uint32_t`, which is more than enough for our current asset system design and simplifies things. * Due to the new type, we can avoid allocations for hash-table storage. * Add/use functions for UID handling Note that I am working on a major rewrite of the file-list code. Meanwhile we want to keep things sensible.
2021-07-02GPencil: New modifier to generate weights dynamicallyAntonio Vazquez
his new modifier allows to generate weights base on: * Angle of the stroke relative to object or world orientation. For example, if the value is 90, the maximum weights will be for vertical lines and minimum for horizontal lines. * Distance to Target object. The distance calculated is normalized to get valid weights between 0 and 1.0. The weights are created in an existing vertex group and the data can be replaced or mixed with the existing value to combine different weight effects. The minimum parameter, allows to define the minimum weight generated. This is useful to avoid very low weights. The generated weights can be used in any modifier. For example, the angle weight value can be used to mimic FreeStyle Caligraphy modifier using the weight with the thickness modifier. Also some modifier has been changed to inlude a new option to use the weights as factor of the effect. As result of this change, the fading option has been removed from Thickness and Opacity modifiers because this can be done using the new modifier, it's not logic to repeat the same. Reviewed By: mendio, filedescriptor Differential Revision: https://developer.blender.org/D11604
2021-07-02Cleanup: Use const variables for object's evaluated meshHans Goudey
Generally the evaluated mesh should not be changed, since that is the job of the modifier stack. Current code is far from const correct in that regard. This commit uses a const variable for the reult of `BKE_object_get_evaluated_mesh` in some cases. The most common remaining case is retrieving a BVH tree from the mesh.
2021-07-02Cleanup: refactor edit-mesh copy functions into functionsCampbell Barton
2021-07-02Cleanup: spelling in commentsCampbell Barton
2021-07-02VSE: Fix handle size calculationRichard Antalik
Handle width calculation was incorrect in drawing code. This caused handles to be invisible when zoomed out. After fixing math, handles become too large, so now they are constrained to quarter of strip width, which feels more natural and represents clickable area more closely. `sequence_handle_size_get_clamped()` did not return size in pixels, but in 2D-View space, this comment was corrected.
2021-07-01Fix memory leak in VSE transform codeRichard Antalik
SeqCollection wasn't freed. It wasn't easy to find culprit so added argument to SEQ_collection_create() to pass function name. Reviewed By: sergey Differential Revision: https://developer.blender.org/D11746
2021-07-01VSE: Snapping feedbackRichard Antalik
Address initial feedback: - Use checkboxes instead of radio buttons - Hide snapping distance control from UI - Tweak snapping line color - use selected strip color, 50% transparency. Similar to other editors - Draw 2px thick line, since strip outline is also 2px thick Reviewed By: HooglyBoogly Differential Revision: https://developer.blender.org/D11759
2021-07-01Fix race condition when loading multiple File/Asset Browsers at onceJulian Eisel
When multiple File or Asset Browsers would load at once (e.g. when loading a file with two File Browsers open) and they would load multiple directories or .blend files (using the Recursions option in the File Browser or loading an asset library with multiple .blends), often only one File/Asset Browser would correctly load all files. Others would be incomplete or entirely empty. That was because of a race condition, where the directories or .blend files would be loaded concurrently and the first one that finished would cancel the other ones. This again happened because they used the job system with the same "owner", which by design makes all jobs with the same owner cancel as soon as the first is finished. Address this by making sure they have different owners. That is, not the scene anymore, but the filelist the job belongs to. Doesn't make much sense to use the scene as owner for scene-unrelated file loading anyway. Steps to reproduce were: * Open two File Browsers as regular editors. * In the Display Settings popover, set "Recursions" to 2 or 3 levels. * Navigate to a directory with plenty of subdirectories in both File Browsers. * Save the file. * Reload the file, one of the File Browsers likely has an incomplete file list. Alternatively, use Asset Browsers and open an asset library containing multiple .blends.
2021-07-01Fix: Export subtitles timecode relative to scene start frame, ignore muted ↵Paul Golter
strips This patch writes the timecode in the .srt file relative to the start frame of the scene. If the timecode is global but scene does not start at frame 0 the subtitles don't match if they get loaded in an external video player. Muted strips will be ignored. Don't allow negative timecodes in .srt. Reviewed By: Richard Antalik Differential Revision: http://developer.blender.org/D11762
2021-07-01Fix edit-mesh partial update regression when snapping to normalsCampbell Barton
Edit-mesh partial update logic assumed translate didn't need normals to be recalculated (for faces with all vertices being transformed). However translate can optionally rotate which requires all transformed normals to be updated. Check for this case and use the previous partial-update method when it modified extra geometry, so the normals are properly reset. Further updates need not recalculate them.
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-07-01Cleanup: spellingCampbell Barton
2021-07-01Cleanup: rename playhead to current-frameCampbell Barton
2021-07-01Cleanup: outdated IPO references in commentsCampbell Barton
2021-07-01Cleanup: remove unused internal grease pencil definitionsCampbell Barton
2021-06-30UI: custom free function improvementsJacques Lucke
This changes `UI_but_func_tooltip_set` so that it allows passing a custom free function, which has two benefits: * The caller can pass `null` to indicate that the value should not be freed. * Arbitrary c++ data can be passed to the callback (before the struct had to be trivially destructible). I added `uiFreeArgFunc` and used it in other places where appropriate. Differential Revision: https://developer.blender.org/D11738
2021-06-30Cleanup: store the result of isLockConstraint for reuseCampbell Barton
This was being called for every element in some situations.
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 bendCampbell Barton
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: use const arguments for accessor functionsCampbell Barton
2021-06-30Cleanup: use const for datatoc declarationsCampbell Barton
2021-06-30Cleanup: rename 'count' to 'len'Campbell Barton
Reserve the term count for values that require calculation (typically linked lists). Without this convention it's difficult to know if using a length accessor function in a loop will be O(N^2) without inspecting the underlying implementation.
2021-06-30Cleanup: unused arg warningsCampbell Barton
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: Deduplicate codeGermano Cavalcante
2021-06-29Cleanup: split CalcSnapGeometry in smaller functionsGermano Cavalcante
2021-06-29VSE: Improved SnappingRichard Antalik
Change snapping behavior to snap strip edges when they are close to snap point. Default behavior is, that each transformed strip is snapped to any other strip. Implement snapping controls in sequencer tool settings. These controls include: - Snapping on/off - Ability to snap to playhead and strip hold offset points - Filter snap points by excluding sound or muted strips - Control snapping distance Snapping controls are placed in timeline header similar to 3D viewport Reviewed By: mano-wii Differential Revision: https://developer.blender.org/D11646
2021-06-29Fix crash on link/append for asset data-blocks in Thumbnails modeJulian Eisel
Same fix as 03a83b4eb5bc, but for the Thumbnails display mode.
2021-06-29UI: Support setting operator properties for `UILayout.operator_menu_enum()`Julian Eisel
`UILayout.operator_menu_enum()` now returns the operator properties, just like `UILayout.operator()`. This makes it possible to set options for the operator displayed in the menu. In C it can be done through the new `uiItemMenuEnumFullO()` or `uiItemMenuEnumFullO_ptr()`. It's reasonable to have this, probably just a small thing never bothered to add. D10912 could use it, the following comment can be addressed now too: https://developer.blender.org/diffusion/B/browse/master/source/blender/editors/space_nla/nla_buttons.c$583-586
2021-06-29Fix T89484: NLA "Remove Empty Animation Data" missing Outliner refreshPhilipp Oeser
Similar to rBb4530deec478, just add appropriate notifier. Maniphest Tasks: T89484 Differential Revision: https://developer.blender.org/D11724
2021-06-29Fix T89526: "Toggle Maximize Area" clears context screen propertiesCampbell Barton
Removed in b787581c9cda5a0cd4bc8b03bbdd1f9832438db4 as it's comment noted it was bad code, the reason for it's necessity was no longer valid. Add this back with comment explaining why it's still needed.
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-06-29Cleanup: clang-formatCampbell Barton
2021-06-29Cleanup: spellingCampbell Barton
2021-06-29Typo in function identifier: mutli -> multiHarley Acheson
Fixing small typo of word "multi" in function identifier by renaming "count_mutli_input_socket_links" to "count_multi_input_socket_links" Differential Revision: https://developer.blender.org/D11732 Reviewed by Hans Goudey
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-29Cleanup: clang-tidyCampbell Barton
2021-06-28Cleanup: Remove unused "for_orco" argument to curve evaluationHans Goudey
`BKE_displist_make_curveTypes` had a `for_orco` argument that was always false in calls to the function. Removing it allows the curve displist and modifier evaluation code to become simpler. There are some related cleanups in rBdf4299465279 and rB93aecd2b8107.
2021-06-28Fix T89515: Clicking on Favorites in File Browser will rename themJulian Eisel
Likely uncovered by 6c97c7f767c9, the actual mistake would be from 6942dd9f4900. The hacks to display text buttons for renaming in UI-Lists used the emboss of the text button for handling logic. It relied on the emboss `NONE` but we also introduced `NONE_OR_STATUS` with 6942dd9f4900. Both values need to be treated equally for the logic of this hack to work. The change in `interface_layout.c` is actually not needed for this exact issue, but it's the correct thing to do. There may actually be more cases where `NONE` and `NONE_OR_STATUS` need to be treated equally. Something to be checked still.
2021-06-28Fix T89449: File Browser preview image not responsive to clickJulian Eisel
Logic in the main `switch` for button handling was wrong and would execute for other button types than the new data-set row button type.