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-04-06Cleanup: spelling & poor wording in code & commentsCampbell Barton
2022-04-06Fix: T78228 Send all python errors to info editorCampbell Barton
Python exceptions are now shown in the info editor, this also resolves an old bug where errors were printed twice. This was originally based on D9752 by @ShadowChaser although many changes have been made from the original patch. Details: - BPy_errors_to_report no longer prints additional output. - BKE_report_print_test was added so it's possible to check if calling BKE_report also printed to the stdout. - Callers to BPy_errors_to_report are responsible for ensuring output is printed to the stdout/stderr. - Python exceptions no longer add a trailing newline, needed to avoid blank-space when displayed in the info-editor.
2022-04-06Cleanup: quiet compiler warningsCampbell Barton
Ideally this wouldn't be needed, I couldn't find a good solution to avoid casting when comparing const/non-const pointers in this case.
2022-04-06BVH Utils: remove 'isolate' parameterGermano Cavalcante
This is an internal usage parameter. No functional changes.
2022-04-06BVH Utils: Remove '_allocated' members from 'BVHTreeFromMesh'Germano Cavalcante
The parameters indicating whether it is allocated are always `false` and it is up to the caller to free them. Also clang-format was triggered.
2022-04-06Refactor: remove cache parameters from `bvhtree_from_` functionsGermano Cavalcante
The `BVHCacheType bvh_cache_type` parameter defines specific `BVHTrees` that cannot be customized. So it doesn't make sense to pass this value to any `*bvhtree_from_[...]_ex` function as the `BVHTrees` created in these cases are custom and cannot be saved in the cache. This also resulted in a nice cleanup in the code. Differential Revision: https://developer.blender.org/D14479
2022-04-06Cleanup: Simplify if statements, clang tidyHans Goudey
2022-04-06Refactor: Deduplicate and simplify BVH Utils codeGermano Cavalcante
In summary the changes are: - Merge all `bvhtree_from_mesh_*.*_setup_data` in a single utility - Create `bvhtree_from_editmesh_setup_data` - Setup data only once in `BKE_bvhtree_from_mesh_get` and `BKE_bvhtree_from_editmesh_get` Also the behavior of `BKE_bvhtree_from_mesh_get` and `BKE_bvhtree_from_editmesh_get` changed a bit: - If a null tree is cached, don't set the `data` to zero. This tree is not an error and the others data can still be used. - If a null tree is returned, don't set the `data` to zero. Matches the previous change. Differential Revision: https://developer.blender.org/D14549
2022-04-05Refactor: Unify vertex and sculpt colors into newJoseph Eagar
color attribute system. This commit removes sculpt colors from experimental status and unifies it with vertex colors. It introduces the concept of "color attributes", which are any attributes that represents colors. Color attributes can be represented with byte or floating-point numbers and can be stored in either vertices or face corners. Color attributes share a common namespace (so you can no longer have a floating-point sculpt color attribute and a byte vertex color attribute with the same name). Note: this commit does not include vertex paint mode, which is a separate patch, see: https://developer.blender.org/D14179 Differential Revision: https://developer.blender.org/D12587 Ref D12587
2022-04-05Curves: fix edit mode detectionKévin Dietrich
This adds missing cases to detect edit mode for Curves objects. Unlike other object types, Curves do not have specific edit data, rather we edit the original data directly, and rely on `Object.mode`. For this, `BKE_object_data_is_in_editmode` had to be modified to take a pointer to the object. This affects two places: the outliner and the dependency graph. For the former place, the object pointer is readily available, and we can use it. For the latter, the object pointer is not available, however since it is used to update edit mode pointers, and since Curves do not have such data, we can safely pass null to the function here. This also fixes the assertion failure that happens when closing a file in edit mode. Differential Revision: https://developer.blender.org/D14330
2022-04-05Curves: Port legacy curve viewport drawing to the new data-blockHans Goudey
Instead of using `CurveEval` to draw the curve wire edges, use the new `Curves` data-block, which is already built as part of an object's evaluated geometry set whenever there is a `CurveComponent`. This means that we can remove `Curve`'s temporary ownership of `CurveEval` for drawing (added in 9ec12c26f16ea3da1e), which caused a memory leak as described in T96498. In my testing this improved performance by around 1.5x during viewport playback, back to the performance of 3.1 before the curve data structure transition started. The next step of using the GPU to do the final curve evaluation for the viewport is described in T96455, but is unrelated. Differential Revision: https://developer.blender.org/D14551
2022-04-05Refactor: Evaluate surface objects as mesh componentsHans Goudey
This commit furthers some of the changes that were started in rBb9febb54a492 and subsequent commits by changing the way surface objects are presented to render engines and other users of evaluated objects in the same way. Instead of presenting evaluated surface objects as an `OB_SURF` object with an evaluated mesh, `OB_SURF` objects can now have an evaluated geometry set, which uses the same system as other object types to deal with multi-type evaluated data. This clarification makes it more obvious that lots of code that dealt with the `DispList` type isn't used. It wasn't before either, now it's just *by design*. Over 1100 lines can be removed. The legacy curve draw cache code is much simpler now too. The idea behind the further removal of `DispList` is that it's better to focus optimization efforts on a single mesh data structure. One expected functional change is that the evaluated mesh from surface objects can now be used in geometry nodes with the object info node. Cycles and the OBJ IO tests had to be tweaked to avoid using evaluated surface objects instead of the newly exposed mesh objects. Differential Revision: https://developer.blender.org/D14550
2022-04-05Curves: new Grow/Shrink brushJacques Lucke
This adds a new Grow/Shrink brush which is similar to the Length brush in the old hair system. * It's possible to switch between growing and shrinking by hold down ctrl and/or by changing the direction enum. * 3d brush is supported. * Different brush falloffs are supported. * Supports scaling curves uniformly or shrinking/extrapolating them. Extrapolation is linear only in this patch. * A minimum length settings helps to avoid creating zero-sized curves. Differential Revision: https://developer.blender.org/D14474
2022-04-05Fix: Assert fails when evaluating single point Bezier curveHans Goudey
Return early when there is only one point, since that means there are no segments.
2022-04-04Fix T95678: Thumbnails are not working with big / large ObjectsGermano Cavalcante
The internal camera used to render the thumbnails also has to consider `clip_start` and `clip_end`. Reviewed By: Severin Maniphest Tasks: T95678 Differential Revision: https://developer.blender.org/D14138
2022-04-04VSE: Add channel headersRichard Antalik
This patch adds channel region to VSE timeline area for drawing channel headers. It is synchronizedwith timeline region. 3 basic features are implemented - channel visibility, locking and name. Channel data is stored in `SeqTimelineChannel` which can be top-level owned by `Editing`, or it is owned by meta strip to support nesting. Strip properties are completely independent and channel properties are applied on top of particular strip property, thus overriding it. Implementation is separate from channel regions in other editors. This is mainly because style and topology is quite different in VSE. But also code seems to be much more readable this way. Currently channels use functions similar to VSE timeline to draw background to provide illusion of transparency, but only for background and sfra/efra regions. Great portion of this patch is change from using strip visibility and lock status to include channel state - this is facilitated by functions `SEQ_transform_is_locked` and `SEQ_render_is_muted` Originally this included changes in D14263, but patch was split for easier review. Reviewed By: fsiddi, Severin Differential Revision: https://developer.blender.org/D13836
2022-04-04Cleanup: Simplify zero-initializing DNA structures in C++Sergey Sharybin
Avoids duplication of type which previously was specified twice in a line.
2022-04-04Cleanup: clang-tidyCampbell Barton
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-04-03Curves: Support set origin and apply transform operatorsHans Goudey
Add support for the Curves object to the "Set Origin" and "Apply Object Tansform" operators. Also change the automatic handle calculation to avoid adding Bezier attributes if they don't need to be added. Differential Revision: https://developer.blender.org/D14526
2022-04-03Curves: Inline some simple methodsHans Goudey
These functions are very simple, but some of them were showing up in in profiles for curves sculpt mode and various curve nodes. Making sure they are inlined will allow avoiding the compiler to optimize this logic much better. Differential Revision: https://developer.blender.org/D14529
2022-04-02Cycles: Add support for light groupsLukas Stockner
Light groups are a type of pass that only contains lighting from a subset of light sources. They are created in the View layer, and light sources (lamps, objects with emissive materials and/or the environment) can be assigned to a group. Currently, each light group ends up generating its own version of the Combined pass. In the future, additional types of passes (e.g. shadowcatcher) might be getting their own per-lightgroup versions. The lightgroup creation and assignment is not Cycles-specific, so Eevee or external render engines could make use of it in the future. Note that Lightgroups are identified by their name - therefore, the name of the Lightgroup in the View Layer and the name that's set in an object's settings must match for it to be included. Currently, changing a Lightgroup's name does not update objects - this is planned for the future, along with other features such as denoising for light groups and viewing them in preview renders. Original patch by Alex Fuller (@mistaed), with some polishing by Lukas Stockner (@lukasstockner97). Differential Revision: https://developer.blender.org/D12871
2022-04-02Cleanup: Further use of const for object bounding boxesHans Goudey
Also solves two warnings from the previous similar commit, f688e3cc3130e70e77f0bb0. The change to the grease pencil modifier is quite suspicious, but doesn't change the behavior, which was already broken.
2022-04-01Cleanup: Remove object bounding box functionHans Goudey
This abstraction doesn't serve any purpose after 11c6d4e88eb919. The flag on bounding boxes isn't used, except for the dirty tag.
2022-04-01Cleanup: Use float3 typeHans Goudey
This can help make some refactoring to bounding boxes slightly easier.
2022-04-01Cleanup: Use const for bounding boxes where possibleHans Goudey
2022-04-01Cycles: enable Alembic procedural for final rendersKévin Dietrich
The Alembic procedural was only enabled during viewport renders originally because it did not have any caching strategy. Now that is does, we can allow its usage in final renders. This also removes the `dag_eval_mode` argument passing to `ModifierTypeInfo.dependsOnTime` which was originally added to detect if we are doing a viewport render for enabling the procedural. Differential Revision: https://developer.blender.org/D14520
2022-04-01Cleanup: Move geometry set fields to a separate headerHans Goudey
This commit moves declarations that depend on `FN_field.hh` out of `BKE_geometry_set.hh` into `BKE_geometry_fields.hh`. This helps to reduce the number of areas that need to depend on the functions module, which recently came in in review of D11591. In the future we may have a library of standard field inputs in order to make composing algorithms easier, so it makes sense to have a header that could contain them and some basic related utilities relating the concepts of geometry and fields. Reducing use of unnecessary headers may also reduce compilation time. Differential Revision: https://developer.blender.org/D14517
2022-04-01Geometry Nodes: Port set handle nodes to new data-blockHans Goudey
This commit ports the "Set Handle Positions" and "Set Hanle Type" nodes to use the new curves data-block. The nodes become simpler and likely much faster too, though they're usually not the bottleneck anyway. Most of the code is ported from `BezierSpline` directly. The majority of the complexity comes from the interaction between different automatically calculated handle types. In comparison `BezierSpline`, the calculation of auto handles is done eagerly-- mostly because it's simpler. Eventually lazy calculation might be good to add. Differential Revision: https://developer.blender.org/D14464
2022-03-31Cleanup: Compilation warnings in gpencil code after DNA C++ changesSergey Sharybin
Direct replacement of code: - memcpy of a single point is done as a shallow_copy() assignment. - memcpy of a range of points is done with an explicit cast to void* to tell compiler that we really want to memcpy even a non-trivial type. In some cases it seems that memcpy can be used more (points are copied in a loop). Those left as-is since this is supposed to be a simple cleanup. Differential Revision: https://developer.blender.org/D14505
2022-03-31Cleanup: spelling, trailing space for comment-blocksCampbell Barton
2022-03-31Cleanup: Curves draw cache renaming, use referencesHans Goudey
Also change some remaining cases of "hair object" to "curves object".
2022-03-30GPencil: Fix double-free issue in update cacheFalk David
When a `GPencilUpdateCacheNode` is created, it always allocates the `children` pointer. This should not be freed until the whole cache is deleted. The `cache_node_update` would free the `children` pointer in a specific case, causing a double-free later when the cache was removed.
2022-03-30Iterator to loop over objects based on a flagDalai Felinto
2022-03-30Fix: Failing curves test after recent commitHans Goudey
87e9451d660e8288d missed updating the behavior for Catmull Rom curves.
2022-03-30Curves: Port parameter node to the new data-blockHans Goudey
Using the evaluated lengths cache from 72d25fa41d8c575, re-implement the curve parameter node with the new data structure. Conceptually it works the same way, but the code is restructured and cleaned up a bit as well. This also adds support for Catmull Rom curves. Differential Revision: https://developer.blender.org/D14461
2022-03-30Curves: Add length cache, length paramerterize utilityHans Goudey
This commit adds calculation of lengths along the curve for each evaluated point. This is used for sampling, resampling, the "curve parameter" node, and potentially more places in the future. This commit also includes a utility for calculation of uniform samples in blenlib. It can find evenlyspaced samples along a sequence of points and use linear interpolation to move data from those points to the samples. Making the utility more general aligns better with the more functional approach of the new curves code and makes the behavior available elsewhere. A "color math" header is added to allow very basic interpolation between two colors in the `blender::math` namespace. Differential Revision: https://developer.blender.org/D14382
2022-03-30Cleanup: spelling in commentsCampbell Barton
2022-03-30Cleanup: unbalanced doxy sectionsCampbell Barton
2022-03-29Fix: incorrect assert in new codeHans Goudey
2022-03-29LibOverride: Massive edits to 'editable' IDs checks in editors code.Bastien Montagne
Add new `BKE_id_is_editable` helper in `BKE_lib_id.h`, that supercedes previous check (simple `ID_IS_LINKED()` macro) for many editing cases. This allows to also take into account 'system override' (aka non-editable override) case. Ref: {T95707}.
2022-03-29LibOverride: Rename 'delete hierarchy' to 'clear hierarchy', add 'clear ↵Bastien Montagne
single' operations. 'Delete' was a confusing name, even though it would delete the overrides it would replace them by linked data. Adding the 'single' version of that operation made it even more confusing, since often it has to keep the override ID for sakes of hierarchy, and just reset it and turn it back into a non-editable system override. Ref: {T95707}.
2022-03-29LibOverride: Add initial handling of system overrides in ↵Bastien Montagne
creation/duplication/resync code, and some basic do_version. When creating with hierarchies, core code only generates system overrides, responsibility to define 'user overrides' is then for the higher-level calling code (Editor/Operator-level). do_version code uses fairly basic euristics, should be good enough here though in most cases. and can always be refined later if needed. Ref: {T95707}.
2022-03-29LibOverride: Add initial System Override flag.Bastien Montagne
This merely adds the flag, exposes it in RMA, and uses it in some of the most common 'is editable' checks (RNA, `BASE_EDITABLE` macro...). Next step: do_version and defining systemoverrides at creation. Ref: {T95707}.
2022-03-29Cover DNA_gpencil_types.h with C++ structure methodsSergey Sharybin
Ref T96847 Maniphest Tasks: T96847 Differential Revision: https://developer.blender.org/D14487
2022-03-29Cleanup: Remove legacy dupli system from point cloud objectHans Goudey
The "dupli" system now has a faster, more powerful, and more flexible alternative with geometry nodes. Since the point cloud objects haven't been exposed in the non-experimental UI yet, we can remove the dupli implementation and the panel for the object type. Differential Revision: https://developer.blender.org/D14482
2022-03-29Assets: Support automatic collection previewsJulian Eisel
Adds supports for collection previews that are rendered automatically when collections are marked as assets. (Or when preview rendering is triggered differently, e.g. through the //Refresh Data-Block Previews// operator). Idea in this patch is to create a collection instance empty outside of main for the collection, and then reuse the object rendering code to render the preview. This keeps things very simple and works just fine. Differential Revision: https://developer.blender.org/D14460 Reviewed by: Bastien Montagne
2022-03-29Fix (unreported) LibOverride: re-creation of overrides in consecutive ↵Bastien Montagne
partial overrides of a same hierarchy. If creating partial hierarchy overrides (from the outliner e.g.), that need to create extra overrides, those could be re-created everytime, leading to very bad situation where there would be several overrides of the same reference ID in the same override hierarchy. This fix makes it so that existing overrides in a given hierarchy will always be re-used in case other overrides are added to the hierarchy.
2022-03-29Cleanup: Use higher level semantic for zeroing DNA objects in C++Sergey Sharybin
Replaces old-style memzero-style of call with zero-initializer. Allows to shorten typical initialization code to a single line: Object foo = blender::dna::shallow_zero_initialize<Object>() This will allow to more easily convert designated initializer which is often used to fill object with zeroes to the explicit function calls: MyDNAStruct foo = {}; will be translated to MyDNAStruct foo = blender::dna::shallow_zero_initialize<MyDNAStruct>(); Differential Revision: https://developer.blender.org/D14486
2022-03-29Cleanup: Remove redundant DNA C++ helper functionSergey Sharybin
Use shallow_copy, no need in copy_memory. The latter appeared as some last minute solution for a compilation warning on Friday.