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-01-31Cleanup: Add back comment removed in recent commitHans Goudey
23775f3914d6474fd73eff7 removed this comment, but it's preferred to keep it instead.
2022-01-31Cleanup: Remove unused DerivedMesh functionsHans Goudey
Remove functions and function pointers that were never set or never used at all. The "tessface" original index handling in `subsurf_ccg.c` can be removed because the data was never used.
2022-01-30Cleanup: Cmake: remove unnecessary definitions for internationalizationAaron Carlisle
Previously, macros were ifdefed using the cmake option `WITH_INTERNATIONAL` However, the is unnecessary as withen the functions themselves have checks for building without internationalization. This also means that many `add_definitions(-DWITH_INTERNATIONAL)` are also unnecessary. Reviewed By: mont29, LazyDodo Differential Revision: https://developer.blender.org/D13929
2022-01-25Cleanup: Correct location of node function declarationsHans Goudey
Currently there are many function declarations in `BKE_node.h` that don't actually have implementations in blenkernel. This commit moves the declarations to `NOD_composite.h`, `NOD_texture.h`, and `NOD_shader.h` instead. This helps to clarify the purpose of the different modules. Differential Revision: https://developer.blender.org/D13869
2022-01-24Cleanup: Move the "toggle smooth brush" functionality to functionsSebastian Parborg
This is so it will be easier to keep the logic to toggle on/off in sync because they are declared close to eachother.
2022-01-24Hook up invert and smooth mode to weight and vertex paintSebastian Parborg
Previously weight paint wasn't hooked up to the "Smooth" and "Invert" modes. With this patch it is not possible to use the "Smooth" and "Invert" modifiers for the draw keybindings. Reviewed By: Campbell Barton Differential Revision: http://developer.blender.org/D13857
2022-01-24Cleanup: Remove unused enumGermano Cavalcante
The `SCULPT_TRANSFORM_DISPLACEMENT_INCREMENTAL` value is not actually being used. Keeping it in the code only complicates its readability.
2022-01-20Revert "Sculpt: Multires Heal Brush"Joseph Eagar
This reverts commit ae349eb2d50524b030f702b8ed3fd75531d4db7e.
2022-01-20Sculpt: Multires Heal BrushJoseph Eagar
This brush fixes the random spikes that occasionally happen in multires models. These spikes can be nearly impossible to fix manually and can make working with multires a nightmare.
2022-01-20Cleanup: spelling in commentsCampbell Barton
2022-01-20Cleanup: clang-formatCampbell Barton
2022-01-20Cleanup doc comments for sculpt_intern.hJoseph Eagar
2022-01-13Refactor: Move normals out of MVert, lazy calculationHans Goudey
As described in T91186, this commit moves mesh vertex normals into a contiguous array of float vectors in a custom data layer, how face normals are currently stored. The main interface is documented in `BKE_mesh.h`. Vertex and face normals are now calculated on-demand and cached, retrieved with an "ensure" function. Since the logical state of a mesh is now "has normals when necessary", they can be retrieved from a `const` mesh. The goal is to use on-demand calculation for all derived data, but leave room for eager calculation for performance purposes (modifier evaluation is threaded, but viewport data generation is not). **Benefits** This moves us closer to a SoA approach rather than the current AoS paradigm. Accessing a contiguous `float3` is much more efficient than retrieving data from a larger struct. The memory requirements for accessing only normals or vertex locations are smaller, and at the cost of more memory usage for just normals, they now don't have to be converted between float and short, which also simplifies code In the future, the remaining items can be removed from `MVert`, leaving only `float3`, which has similar benefits (see T93602). Removing the combination of derived and original data makes it conceptually simpler to only calculate normals when necessary. This is especially important now that we have more opportunities for temporary meshes in geometry nodes. **Performance** In addition to the theoretical future performance improvements by making `MVert == float3`, I've done some basic performance testing on this patch directly. The data is fairly rough, but it gives an idea about where things stand generally. - Mesh line primitive 4m Verts: 1.16x faster (36 -> 31 ms), showing that accessing just `MVert` is now more efficient. - Spring Splash Screen: 1.03-1.06 -> 1.06-1.11 FPS, a very slight change that at least shows there is no regression. - Sprite Fright Snail Smoosh: 3.30-3.40 -> 3.42-3.50 FPS, a small but observable speedup. - Set Position Node with Scaled Normal: 1.36x faster (53 -> 39 ms), shows that using normals in geometry nodes is faster. - Normal Calculation 1.6m Vert Cube: 1.19x faster (25 -> 21 ms), shows that calculating normals is slightly faster now. - File Size of 1.6m Vert Cube: 1.03x smaller (214.7 -> 208.4 MB), Normals are not saved in files, which can help with large meshes. As for memory usage, it may be slightly more in some cases, but I didn't observe any difference in the production files I tested. **Tests** Some modifiers and cycles test results need to be updated with this commit, for two reasons: - The subdivision surface modifier is not responsible for calculating normals anymore. In master, the modifier creates different normals than the result of the `Mesh` normal calculation, so this is a bug fix. - There are small differences in the results of some modifiers that use normals because they are not converted to and from `short` anymore. **Future improvements** - Remove `ModifierTypeInfo::dependsOnNormals`. Code in each modifier already retrieves normals if they are needed anyway. - Copy normals as part of a better CoW system for attributes. - Make more areas use lazy instead of eager normal calculation. - Remove `BKE_mesh_normals_tag_dirty` in more places since that is now the default state of a new mesh. - Possibly apply a similar change to derived face corner normals. Differential Revision: https://developer.blender.org/D12770
2022-01-07Cleanup: rename sculpt_brushes.c -> sculpt_brush_types.cCampbell Barton
This better differentiates sculpt brush types with brush data-blocks, since the same sculpt brush type may be used for many brushes.
2022-01-07Cleanup: remove redundant const qualifiers for POD typesCampbell Barton
MSVC used to warn about const mismatch for arguments passed by value. Remove these as newer versions of MSVC no longer show this warning.
2022-01-06Fix T94635: Sculpt Smooth in Surface mode with Anchored Stroke crashPhilipp Oeser
Sculpt Smooth in Surface mode (as opposed to Laplacian) needs a cache initialized on first time. In anchored stroke mode with spherical falloff this was skipped though (because this starts of with no PBVH nodes and an early return checks for this) and `first_time` was set to false before cache initialization. Now move the cache initalization to happen earlier (same as the cache initialization for automasking). Maniphest Tasks: T94635 Differential Revision: https://developer.blender.org/D13746
2022-01-06Cleanup: move public doc-strings into headersCampbell Barton
Some recent changes re-introduced public-style doc-strings in the source file.
2022-01-06Cleanup: spelling in commentsCampbell Barton
2022-01-05Fix T94564: Mirror clipping is not properly placed in sculpt modePhilipp Oeser
If a mirror object is used in a mirror modifier, sculptmode did not take this into account (and instead always clipped on the sculpt objects local axis). Now take this into account by storing a matrix in the preparation function `sculpt_init_mirror_clipping` and use that later in `SCULPT_clip`. Maniphest Tasks: T94564 Differential Revision: https://developer.blender.org/D13711
2021-12-25Cleanup: Use array for BKE cursor functionsAaron Carlisle
Differential Revision: https://developer.blender.org/D12962
2021-12-21Nodes: refactor node tree update handlingJacques Lucke
Goals of this refactor: * More unified approach to updating everything that needs to be updated after a change in a node tree. * The updates should happen in the correct order and quadratic or worse algorithms should be avoided. * Improve detection of changes to the output to avoid tagging the depsgraph when it's not necessary. * Move towards a more declarative style of defining nodes by having a more centralized update procedure. The refactor consists of two main parts: * Node tree tagging and update refactor. * Generally, when changes are done to a node tree, it is tagged dirty until a global update function is called that updates everything in the correct order. * The tagging is more fine-grained compared to before, to allow for more precise depsgraph update tagging. * Depsgraph changes. * The shading specific depsgraph node for node trees as been removed. * Instead, there is a new `NTREE_OUTPUT` depsgrap node, which is only tagged when the output of the node tree changed (e.g. the Group Output or Material Output node). * The copy-on-write relation from node trees to the data block they are embedded in is now non-flushing. This avoids e.g. triggering a material update after the shader node tree changed in unrelated ways. Instead the material has a flushing relation to the new `NTREE_OUTPUT` node now. * The depsgraph no longer reports data block changes through to cycles through `Depsgraph.updates` when only the node tree changed in ways that do not affect the output. Avoiding unnecessary updates seems to work well for geometry nodes and cycles. The situation is a bit worse when there are drivers on the node tree, but that could potentially be improved separately in the future. Avoiding updates in eevee and the compositor is more tricky, but also less urgent. * Eevee updates are triggered by calling `DRW_notify_view_update` in `ED_render_view3d_update` indirectly from `DEG_editors_update`. * Compositor updates are triggered by `ED_node_composite_job` in `node_area_refresh`. This is triggered by calling `ED_area_tag_refresh` in `node_area_listener`. Removing updates always has the risk of breaking some dependency that no one was aware of. It's not unlikely that this will happen here as well. Adding back missing updates should be quite a bit easier than getting rid of unnecessary updates though. Differential Revision: https://developer.blender.org/D13246
2021-12-20Run clang-formatJoseph Eagar
2021-12-20Sculpt: split sculpt.c into three filesJoseph Eagar
Sculpt.c is now three files: * Sculpt.c: main API methods and the brush stroke operator * Sculpt_brushes.c: Code for individual brushes. * Sculpt_ops.c: Sculpt operators other than the brush stroke operator. TODO: split brush stroke operator into a new file (sculpt_stroke.c?).
2021-12-16Cleanup: spellingCampbell Barton
2021-12-14Cleanup: correct unbalanced doxygen groupsCampbell Barton
Also add groups in some files.
2021-12-10Cleanup: move public doc-strings into headers for various API'sCampbell Barton
Some doc-strings were skipped because of blank-lines between the doc-string and the symbol and needed to be moved manually. - 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. Ref T92709
2021-12-08Cleanup: move public doc-strings into headers for 'editors'Campbell Barton
Ref T92709
2021-12-07Cleanup: Use rcti marking dirty regions when texture painting.Jeroen Bakker
Dirty regions when painting are not using rcti. Meaning less understandable code. Found issue when refactoring the image_gpu partial update. In a future change gpu partial update API will be using rcti also what makes the code even cleaner. Reviewed By: campbellbarton Differential Revision: https://developer.blender.org/D13260
2021-11-30Cleanup: spelling in comments & stringsCampbell Barton
2021-11-26Fix T93117: Texture paint clone tool crash in certain situationPhilipp Oeser
Caused by {rBaf162658e127}, so long standing bug. When changing clone slots (report involved a quite complicated sequence of selecting textures and undo -- but I think this could happen in more situations) code checks for UV of new clone slot. However, since above commit the slot and the clone slot were mixed up, so in this case the responsible NULL check (for when no UV is assigned) wasnt working. Now correct this (NULL check the clone slot uv -- instead of the paint slot UV). note: not sure why low level CustomData functions actually dont do the name NULL checks themselves (seems like callers are always responsible). Maniphest Tasks: T93117 Differential Revision: https://developer.blender.org/D13378
2021-11-22Painting: Performance curve masks.Jeroen Bakker
This patch separates the static-part from the dynamic-part when generate brush masks. This makes the generation of brush masks 2-5 times faster depending on the size of the brush. More improvements can be done, this was just low hanging fruit.
2021-11-22Cleanup: Removed unused code in curve mask creation.Jeroen Bakker
Generating curve mask for 2d texture painting had some hard-coded parameters that eventually weren't used in the algorithm (hardness and rotation of the brush). This patch removes these parameters.
2021-11-22Painting: migrated curve mask generation to CPP.Jeroen Bakker
Curve mask generation is done during 2d texture painting. There are some performance issues in this part of the code. Before addressing those we move the code to CPP.
2021-11-17Cleanup: Painting - reduce reallocation of same memory.Jeroen Bakker
Curve mask is freed/allocated every time, but could still reuse the previous allocated buffer when the diameter of the brush doesn't change.
2021-11-13Cleanup: spelling in comments, comment block formattingCampbell Barton
2021-11-08Cleanup: remove references to non-existent 'mtexpoly'Campbell Barton
2021-11-02Images: refactor how failed image load attempts are rememberedJacques Lucke
Previously, `ImageTile->ok` and `ImageUser->ok` were used to indicate whether an image failed to load. There were three possible values which (probably) had the following meanings: * `0`: There was an error while loading the image. Don't try to load again. * `1`: Default value. Try to load the image. * `2`: The image was loaded successfully. This image-wide flag did not make sense unfortunately, because loading may work for some frames of an image sequence but not for others. Remember than an image data block can also contain a movie. The purpose of the `->ok` flag was to serve as an optimization to avoid trying to load a file over and over again when there is an error (e.g. the file does not exist or is invalid). To get the optimization back, the patch is changing `MovieCache` so that it can also cache failed load attempts. As a consequence, `ibuf` is allowed to be `NULL` in a few more places. I added the appropriate null checks. This also solves issues when image sequences are used with the Image Texture node in Geometry nodes (also see D12827). Differential Revision: https://developer.blender.org/D12957
2021-10-26Cleanup: spelling in commentsCampbell Barton
2021-10-22Fix T92290: Linked Color Palette datablocks can not be used.Bastien Montagne
* Forbid editing linked palettes. * Make `color` RNA property of ColorPalette '`LIB_EXCEPTION`', so that the color buttons in the palette template remain active on linked data. NOTE: This incidently makes linked palettes' colors editable from RNA, not from UI though, so think this is OK for now.
2021-10-21Cleanup: use underscore separators for event struct membersCampbell Barton
Improve readability using underscores for separators, e.g. prev_click_time instead of prevclicktime.
2021-10-20Cleanup: use an array for wmEvent cursor position variablesAaron Carlisle
Use arrays for wmEvent coordinates, this quiets warnings with GCC11. - `x, y` -> `xy`. - `prevx, prevy` -> `prev_xy`. - `prevclickx, prevclicky` -> `prev_click_xy`. There is still some cleanup such as using `copy_v2_v2_int()`, this can be done separately. Reviewed By: campbellbarton, Severin Ref D12901
2021-10-20Cleanup: use elem macrosCampbell Barton
2021-10-18Fix T79005: Vertex color conversion operators changing the colorsPablo Dobarro
CD_PROP_COLOR vertex data is stored in scene linear while legacy vertex colors are srgb, so both operators also need to do this conversion Reviewed By: sergey Maniphest Tasks: T79005 Differential Revision: https://developer.blender.org/D8320
2021-10-18Cleanup: spelling in commentsCampbell Barton
2021-10-14Cleanup: pass the sizeof(..) as the second arg for array allocationCampbell Barton
By argument naming and convention this is the intended argument order.
2021-10-07Revert commit, turns out this isn't a bug?Joseph Eagar
2021-10-07Fix mask expand not properly supportingJoseph Eagar
both inverse and keep mask modes being on at the same time.
2021-10-06Cleanup: spelling in commentsCampbell Barton
2021-09-29Fix T89164: Sculpt "Smooth" brush crash with zero pressurePhilipp Oeser
Caused by {rB3e5431fdf439} Issue is that sculpting could start with using `SCULPT_smooth` and (because of the Pressure sensitivity dropping to zero) code would switch to `SCULPT_enhance_details_brush` at strength zero. Issue with this though is that this can be in the middle or end of a stroke and the necessary `ss->cache->detail_directions` are only initialized for the first brush step (see `SCULPT_stroke_is_first_brush_step` in `SCULPT_enhance_details_brush`). With these missing, it could only go downhill from there. Suggest to prevent the "mode-flip" from `SCULPT_smooth` to `SCULPT_enhance_details_brush` (happening solely because of pressure strength) by changing the condition. Now do `SCULPT_enhance_details_brush` only if strength is **below** zero and `SCULPT_smooth` else (flipping from enhance_details to regular smooth is fine). If inverting the brush in the middle of the stroke will be supported at some point, the codepath of `smooth` would have to inform the cache that invert changed and detail_directions would have to be initialized then (even if not at the start of the stroke). Maniphest Tasks: T89164 Differential Revision: https://developer.blender.org/D12676
2021-09-23Fix T91557: Texture Paint Stencil doesnt use assigned UV LayerPhilipp Oeser
Choosing a UV layer would actually affect the overlay in the viewport and also painting with the mask brush was in that UV space, but the resulting stencil mask was always applied with the active UV (not the explicitly selected stencil UV -- the one one is looking at in the viewport!) to painting. This has been like that as far as I have checked back (at least 2.79b), I am surprised this has not come up before, but it does not seem to make sense at all... Now use the UV specified for the stencil layer when applying the mask for painting, so it corresponds to the stencil mask one is looking at in the viewport. Maniphest Tasks: T91557 Differential Revision: https://developer.blender.org/D12583