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-10-07Cleanup: redundant parenthesisCampbell Barton
2022-09-27Fix: GPencil animated layer transforms evaluate wrong when identityPhilipp Oeser
Due to (optimization) checks in in `BKE_gpencil_prepare_eval_data` & `BKE_gpencil_update_layer_transforms`, updates were skipped if animation reached exact identity transforms. Now check if the matrix has changed additionally to gain proper updates. Unsure if this is the cheapest way to check for the animated state of layer transforms tbh, but I see similar checks elsewhere. Fixes T101164. Maniphest Tasks: T101164 Differential Revision: https://developer.blender.org/D16018
2022-09-26Cleanup: use 'u' prefixed integer types for brevity in C codeCampbell Barton
This also simplifies using function style casts when moving to C++.
2022-09-08IDManagement: change `IDTypeInfo.owner_get` to instead return address of the ↵Bastien Montagne
owner_id pointer. Also rename the callback. That way, we can keep moving toward a more generic handling of those embedded IDs (think e.g. about copy code).
2022-08-04I18n: make several parts of the UI translatableDamien Picard
- batch rename - keyframe settings - tool name in Tool properties header - tool name in Tool properties Drag (fake) enum - new file templates - new preset - new text datablock - new collection datablock - new geometry nodes (modifier and node group) - new grease pencil data (layers and materials) Ref. T43295 Reviewed By: mont29 Differential Revision: https://developer.blender.org/D15533
2022-07-26Cleanup: Typo in comments: `data-lock` -> `data-block`.Bastien Montagne
2022-06-23Cleanup: Clang tidyHans Goudey
Mainly duplicate includes and else after return.
2022-05-30Merge branch 'blender-v3.2-release'Antonio Vazquez
2022-05-30Fix T98488: GPencil weightpaint not visible if first point is no weightAntonio Vazquez
The problem was because the check was done with the total weights of the first element of the array and if this was null or 0, the weights were not duplicated. As this bug was introduced fixing T97150 due a problem in the weight data, now instead to duplicate all stroke data to create the perimeter for the PDF/SVG, only the points are duplicated because the weights are not needed. This fix the original bug and also reduce the memory used by the export process.
2022-05-13Cleanup: spelling in comments, capitalize tagsCampbell Barton
Also add missing task-ID reference & remove colon after \note as it doesn't render properly in doxygen.
2022-05-04GPencil: Apply layer transforms to visible framesYann Lanthony
Fix regression described in T97799. Apply layer transform and layer parenting to all visible frames, i.e. active frame + onion skinning frames. Reviewed By: #grease_pencil, antoniov Maniphest Tasks: T97799 Differential Revision: https://developer.blender.org/D14829
2022-04-08Fix T97150: Export GPencil to PDF or SVG crashes blenderAntonio Vazquez
The problem was the original file had some vertex weight information, but the weights array was empty, so the duplication was not done and the free memory crashed. To avoid this type of errors, now before duplicate weights the function checks the pointer and also the number of weights elements in the array to avoid the duplicatiopn of empty data.
2022-03-07Improve multi-user gpencil data performance with modifiersYann Lanthony
When a grease pencil data-block has multiple users and is subject to modifiers, layer transforms or parenting, performance (especially playback) is greatly affected. This was caused by the grease pencil eval process which does per instance full-copies of the original datablock in case those kinds of transformations need to be applied. This commit changes the behavior of the eval process to do shallow copies (layers with empty frames) of the datablock instead and duplicates only the visible strokes. When we need to have a unique eval data per instance, only copy the strokes of visible frames to this copy. Performance: On a test file with 1350 frames 33k strokes and 480k points in a single grease pencil object that was instanced 13 times: - master: 2.8 - 3.3 fps - patch: 42 - 52 fps Co-authored by: @filedescriptor This patch was contributed by The SPA Studios. Reviewed By: #grease_pencil, pepeland Differential Revision: https://developer.blender.org/D14238
2022-02-16Cleanup: spelling in commentsCampbell Barton
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-11Cleanup: Clang tidyHans Goudey
Mismatched parameter names and else after return.
2022-02-10GPencil: Update-on-write using update cacheFalk David
This implements the update cache described in T95401. The cache is currently only used for drawing strokes and sculpting (using the push brush). **Note: Making use of the cache throughout grease pencil will have to be done incrementally in other patches. ** The update cache stores what elements have changed in the original data-block since the last time the eval object was updated. Additionally, the update cache can store multiple updates to the data and minimizes the number of elements that need to be copied. Elements can be tagged using `BKE_gpencil_tag_full_update` and `BKE_gpencil_tag_light_update`. A full update means that the element itself will be copied but also all of the content inside. E.g. when a layer is tagged for a full update, the layer, all the frames inside the layer and all the strokes inside the frames will be copied. A light update means that only the properties of the element are copied without any of the content. E.g. if a layer is tagged with a light update, it will copy the layer name, opacity, transform, etc. When the update cache is in use (e.g. elements have been tagged) then the depsgraph will not trigger a copy-on-write, but an update-on-write. This means that the update cache will be used to determine what elements have changed and then only those elements will be copied over to the eval object. If the update cache is empty or the data block was tagged with a full update, we always fall back to a copy-on-write. Currently, the update cache is only used by the active depsgraph. This is because we need to free the update cache after an update-on-write so it's reset and we need to make sure it is not freed or read by other depsgraphs. Co-authored-by: @yann-lty This patch was contributed by The SPA Studios. Reviewed By: sergey, antoniov, #dependency_graph, pepeland, mendio Maniphest Tasks: T95401 Differential Revision: https://developer.blender.org/D13984
2021-12-14Cleanup: correct unbalanced doxygen groupsCampbell Barton
Also add groups in some files.
2021-12-07Cleanup: move public doc-strings into headers for 'blenkernel'Campbell Barton
- Added space below non doc-string comments to make it clear these aren't comments for the symbols directly below them. - Use doxy sections for some headers. - Minor improvements to doc-strings. Ref T92709
2021-11-29Refactor BKE_bpath module.Bastien Montagne
The main goal of this refactor is to make BPath module use `IDTypeInfo`, and move each ID-specific part of the `foreach_path` looper into their own IDTypeInfo struct, using a new `foreach_path` callback. Additionally, following improvements/cleanups are included: * Attempt to get better, more consistent namings. ** In particular, move from `path_visitor` to more standard `foreach_path`. * Update and extend documentation. ** API doc was moved to header, according to recent discussions on this topic. * Remove `BKE_bpath_relocate_visitor` from API, this is specific callback that belongs in `lib_id.c` user code. NOTE: This commit is expected to be 100% non-behavioral-change. This implies that several potential further changes were only noted as comments (like using a more generic solution for `lib_id_library_local_paths`, addressing inconsistencies like path of packed libraries always being skipped, regardless of the `BKE_BPATH_FOREACH_PATH_SKIP_PACKED` `eBPathForeachFlag` flag value, etc.). NOTE: basic unittests were added to master already in rBdcc500e5a265093bc9cc. Reviewed By: brecht Differential Revision: https://developer.blender.org/D13381
2021-11-24Cleanup: `IDTypeInfo` new `asset_type_info` member.Bastien Montagne
Two issues addressed here: I) `asset_type_info` is sub-data, not a callback. Therefore, move it before the callbacks in the `IDTypeInfo` struct. II) More important, initialize this new attribute in *ALL* `IDTypeInfo` instances. No member of this struct should ever be left implicitely uninitilazed, ever. Aftermath of rBa84f1c02d251.
2021-10-26Cleanup: LibQuery: Rename `BKE_LIB_FOREACHID_PROCESS` to ↵Bastien Montagne
`BKE_LIB_FOREACHID_PROCESS_IDSUPER`. More in-line name with the rest of that macro-based API, especially since this will be extended in the future.
2021-10-05Cleanup: quiet shadow warning, trailign spaceCampbell Barton
2021-10-04Cleanup: Use LISTBASE_FOREACH macroAntonio Vazquez
2021-09-23Add missing GPencil `IDTYPE_FLAGS_APPEND_IS_REUSABLE` flag.Bastien Montagne
Forgot that one in rB794c2828af60. Noted by Antonio Vazquez (@antoniov), thanks.
2021-09-17Fix T91481: Grease Pencil Layer Double TransformationsHenrik Dick
Use the inverse of the grease pencil object. This patch fixes the issue for bones and objects. Maniphest Tasks: T91481 Differential Revision: https://developer.blender.org/D12539
2021-08-26Cleanup: Use `ID_IS_LINKED` instead of direct `id.lib` pointer check.Bastien Montagne
2021-08-20Cleanup: use "free_data" suffix when the argument isn't freedCampbell Barton
Avoid API misuse that caused leaks in T90791 & 2788b0261cb7d33a2f6f2978ff4f55bb4987edae.
2021-08-19Cleanup: Blendwrite: Move code deciding if an ID should be written out of ID ↵Bastien Montagne
callbacks. This was not really useful, and added estra useless steps in case and ID should not actually be written. Further more, it prevented clearing the usercount on write, which can be cause a false positive 'chanhged' detection in undo/redo case.
2021-08-11Fix T88033: Python reference memory leaks for non main data-blocksCampbell Barton
ID data-blocks that could be accessed from Python and weren't freed using BKE_id_free_ex did not release the Python reference count. Add BKE_libblock_free_data_py function to clear the Python reference in this case. Add asserts to ensure no Python reference is held in situations when ID's are copied for internal use (not exposed through the RNA API), to ensure these kinds of leaks don't go by unnoticed again.
2021-07-16Cleanup: remove redundant parenthesesCampbell Barton
2021-07-14Cleanup: Avoid duplication in line art stroke generationHans Goudey
The BKE_gpencil_stroke_add_points API function worked well for creating the primitives in the add object menu, but it expected a specific data format that doesn't make sense in a dynamic context. As evidence of that we can see the way source data was duplicated in the line art file just to use this API function. This commit solves that problem in two ways: - Clean up the line art function (this should make it faster too). - Move/rename the function so its intended use is more clear. Differential Revision: https://developer.blender.org/D11909
2021-07-13Refactor: Move vertex group names to object dataHans Goudey
This commit moves the storage of `bDeformGroup` and the active index to `Mesh`, `Lattice`, and `bGPdata` instead of `Object`. Utility functions are added to allow easy access to the vertex groups given an object or an ID. As explained in T88951, the list of vertex group names is currently stored separately per object, even though vertex group data is stored on the geometry. This tends to complicate code and cause bugs, especially as geometry is created procedurally and tied less closely to an object. The "Copy Vertex Groups to Linked" operator is removed, since they are stored on the geometry anyway. This patch leaves the object-level python API for vertex groups in place. Creating a geometry-level RNA API can be a separate step; the changes in this commit are invasive enough as it is. Note that opening a file saved in 3.0 in an earlier version means the vertex groups will not be available. Differential Revision: https://developer.blender.org/D11689
2021-07-06GPencil: Rename BKE_gpencil_visible_stroke_iterAntonio Vazquez
Renamed to BKE_gpencil_visible_stroke_advanced_iter Also created a simple version of the iterator to be used without multiframe and onion skin.
2021-07-03Cleanup: consistent use of tags: NOTE/TODO/FIXME/XXXCampbell Barton
Also use doxy style function reference `#` prefix chars when referencing identifiers.
2021-06-26Cleanup: full sentences in comments, improve comment formattingCampbell Barton
2021-06-26GPencil: Duplicate Masks when separate Layer/StrokesAntonio Vazquez
Now, the mask layers are copied and later a cleanup is done in order to verify all mask layer exist in destination object. If the layer mask does not exist, it's removed from the list. This is related to T89234.
2021-06-22Cleanup: Remove extra blank lineAntonio Vazquez
2021-06-22Fix T89366: GPencil hide layers above parented layerAntonio Vazquez
The problem was the flag was not reset by layer in the loop.
2021-06-21GPencil: Disable Lights when duplicate layerAntonio Vazquez
Missing to disable default light ON when use separate operator.
2021-06-18GPencil: Missed flag in previous Copy Settings commitAntonio Vazquez
2021-06-18GPencil: Move copy layer settings to functionAntonio Vazquez
Better to have a function that can be reused to duplicate the settings that need to be copied.
2021-05-27Cleanup: spellingCampbell Barton
2021-05-26GPencil: Add option to disable masks in view layerFalk David
This patch adds an option in the Layers > Relations panel called "Disable Masks in Render". When checked, no masks on this layer are included in the render. Example: | {F10087680} | {F10087681} | See T88202 for why this is needed. Reviewed By: antoniov Maniphest Tasks: T88202 Differential Revision: https://developer.blender.org/D11234
2021-05-26Merge branch 'blender-v2.93-release'Falk David
2021-05-26Fix: GPencil mask shows in view layer renderFalk David
Currently when rendering the view layer of a grease pencil layer that has a mask layer attached, the mask layer would show in the rendered image. This is inconsistent with the default behaviour with no mask on the grease pencil layer, because it would only render what's on that particular layer and not anything from any other layer. This patch makes the masks invisible in the render. Note: This might seem like not the best solution, but because masks are just regular grease pencil layers, it's tricky to pass this edge-case to the drawing code. The way it is handled right now is the best I could come up with, without making changes that could affect something else. Reviewed By: antoniov Maniphest Tasks: T88202 Differential Revision: https://developer.blender.org/D11403
2021-05-14GPencil: Refactor Append operatorsAntonio Vazquez
Now the operators work like other areas of Blender using the list of selected objects. Also, the name has been changed to: ```Layers: - Copy Layer to Selected - Copy All Layers to Selected Materials: - Copy Material to Selected - Copy All Materials to Selected``` Reviewed By: mendio, pablovazquez, pepeland Differential Revision: https://developer.blender.org/D11216
2021-04-09Cleanup: use our own code style for doxy-gen comment blocksCampbell Barton
2021-04-06Fix T87236: crash reading file with grease pencil palettesPhilipp Oeser
Caused by typo in {rB76689e851700}. Since Palettes and bGPDpalette are not the same size, this would not only cause a crash in versioning code, but could only go downhill from here on. Maniphest Tasks: T87236 Differential Revision: https://developer.blender.org/D10903
2021-03-23Cleanup: de-duplicate gpencil logic to ensure materialsCampbell Barton
- Rename: `BKE_gpencil_object_material_get_index_name`, to `BKE_gpencil_object_material_index_get_by_name` Matching `BKE_gpencil_layer_get_by_name`. - Move logic to ensure named materials into a new function: `BKE_gpencil_object_material_ensure_by_name`