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-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
2021-09-17UI: enable the depend-on-cursor flag for some operatorsCampbell Barton
- Bend (Transform). - Extrude to Cursor. - Lasso Select (related operators such as node-cut links, mask.. etc). - Rip Mesh / UV's. - Vertex/Edge Slide.
2021-09-15Cleanup: Use function to mark mesh normals dirtyHans Goudey
2021-08-31Cleanup: remove unnecessary obedit argument from ED_space_image_setCampbell Barton
This was left over from when changing the image set the faces texture.
2021-08-06Cleanup: use MEM_SAFE_FREE macroCampbell Barton
2021-08-05Fix T90235: Smooth Brush not working with interior vertices with two ↵Pablo Dobarro
adjacent edges The exception to automatically pin vertices of grid corners also has to take into account that the vertex is in a boundary. Reviewed By: JacquesLucke Maniphest Tasks: T90235 Differential Revision: https://developer.blender.org/D12044
2021-08-05Fix T90236: Sculpt automasking failing when the stroke does not start over ↵Pablo Dobarro
the mesh The active geometry element are usually updated by the cursor drawing code (as they are needed for the cursor preview) and when an sculpt operator starts. For brushes, this was not happening. This was making brushes rely by default on the last cursor drawing update, which can be incorrect if the mouse moved after starting the stroke without hovering the active geometry. Reviewed By: JacquesLucke Maniphest Tasks: T90236 Differential Revision: https://developer.blender.org/D12045
2021-08-05Cleanup: remove redundant parenthesisCampbell Barton
2021-08-03Cleanup: use C++ comments or 'if 0' for commented codeCampbell Barton
2021-07-26Cleanup: spelling in commentsCampbell Barton
2021-07-23Cleanup: code comments punctuation / spacingCampbell Barton
2021-07-20Cleanup: use single back-tick quoting in commentsCampbell Barton
While doxygen supports both, conform to our style guide. Note that single back-tick's are already used in a majority of comments.
2021-07-16Cleanup: remove redundant parenthesesCampbell Barton
2021-07-15Cleanup: replace BLI_assert(!"text") with BLI_assert_msg(0, "text")Campbell Barton
This shows the text as part of the assertion message.