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-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-08-06Cleanup: use MEM_SAFE_FREE macroCampbell Barton
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-07-15Cleanup: replace BLI_assert(!"text") with BLI_assert_msg(0, "text")Campbell Barton
This shows the text as part of the assertion message.
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-23Fix T89221: Sculpt tools symmetry failing with non symmetrical meshesPablo Dobarro
SCULPT_nearest_vertex_get expects a distance, not a distance squared. This should make symmetry work as expected, but it still can fail if the mesh topology is not completely symmetrical. Reviewed By: JacquesLucke Maniphest Tasks: T89221 Differential Revision: https://developer.blender.org/D11642
2021-06-01Cleanup: correct sculpt quat argument sizeCampbell Barton
2021-05-14Fix sculpt neighbor iterator not taking visibility into accountPablo Dobarro
Sculpting tools are designed to ignore hidden geometry and behave like hidden geometry does not exist. When getting the neighbors of a vertex, now this takes into account hidden geometry to avoid returing neighbors which connected edge is not visible. This should make corner cases of a lot of tools work properly, especially when working in low poly meshes when is common to have a single face loop hidden. Reviewed By: JacquesLucke Differential Revision: https://developer.blender.org/D11007
2021-05-14Fix Sculpt tools showing the cursor of the previous active brushPablo Dobarro
When using a tool that is not a brush, the previously used brush preset will still be active in the tool settings, so the cursor will draw its custom reviews. This checks if the current active tool is a brush before drawing its previews. If it is not a brush tools, it draws a default white cursor. Reviewed By: sergey Differential Revision: https://developer.blender.org/D9418
2021-03-13Cleanup: add BKE_pbvh_vertex_iter_begin to clang-formatPablo Dobarro
Reviewed By: JacquesLucke Differential Revision: https://developer.blender.org/D10707
2021-03-12Sculpt: Mask Init operatorPablo Dobarro
This operator initializes mask values for the entire mesh. It supports different modes for initializing those values, and more will be added in the future. The initial version supports generating a random mask per vertex, Face Sets or loose parts. These masks are useful for introducing variations in the model using the filters (both shapes and colors). Reviewed By: JacquesLucke Differential Revision: https://developer.blender.org/D10679
2021-03-09Sculpt: 'Unifiy' Dyntopo Detail Size operatorsPhilipp Oeser
Prior to rB99a7c917eab7, Shift + D was used to set detail size for both constant and relative detail (using radial control). The commit added an improved operator for doing this for constant detail (showing the triangle grid representation), but left the user without a shortcut to do this for relative detail. Interestingly rB99a7c917eab7 only changed this for the Blender keymap, the Industy Compatible keymap still has the "old" entry. This patch changes both keymaps to have both entries. For user experience, the real change here is to have both available on one 'primary' shortcut (Shift+D), the improved 'dyntopo_detail_size_edit' operator will now act on all possible cases. If it deals with constant detail, it acts as before, if it deals with relative detail etc, it will fallback to the "old" way of doing it via radial control instead. I assume this adresses what was stated in rB99a7c917eab7: "Deciding if both detail sizes can be unified needs a separate discussion" Also, move dyntopo_detail_size_edit to sculpt_detail.c Fixes T83828 Maniphest Tasks: T83828 Differential Revision: https://developer.blender.org/D9871
2021-03-02Sculpt: Expand OperatorPablo Dobarro
Expand is a new operator for Sculpt Mode which is intended to be the main tool for masking, Face Set editing, interacting with the filters and pattern creation. The fundamentals of the tool are similar to the previous sculpt.mask_expand operator. It shares the same default shortcuts and functionality, making the previous operator obsolete. The shortcuts to execute the operator are: - Shift + A: Expand mask - Shift + Alt + A: Expand mask by normals - Shift + W: Expand Face Set - Shift + Alt + W: Resize current Face Set The main changes compared to the previous sculpt.mask_expand operator are: - Modal keymap, all operator options can be changed in real time while the operator is running. - Supports creating Mask, Face Sets and Sculpt Vertex Colors. - Much better code, new features can be easily integrated. Limitations: - All Mask operations are supported for Sculpt Vertex colors, but not exposed by default as their support is still experimental. - Dyntopo does not support any Face Set or Sculpt Vertex Colors. functionality (they are not implemented in general for Dyntopo). - Multires does not support any feature related to geodesic distances. - Multires does not support vertex colors. - Multires does not support recursions. - In Multires, Face Sets snaping does not initialize all current enabled Face Sets when toggling snapping. - In Multires, Face Sets are created at base mesh level (works by this by design, like any other tool). - Unlike the previous mask_expand operator, this one does not blur the mask by default after finishing Expand as that does not fit the new design. The mask can still be blurred by using the mask filter manually. Reviewed By: JacquesLucke Differential Revision: https://developer.blender.org/D10455
2021-02-26Fix crash with dyntopo on tools that use cached vertex infoPablo Dobarro
Tools can cache data related to the mesh topology for later use. This data is indexed by vertex index, so it will be invalid after dyntopo changes the topology during the stroke. Reviewed By: JacquesLucke Differential Revision: https://developer.blender.org/D10550
2021-02-13Cleanup: spellingCampbell Barton
2021-02-10Cleanup: Unindent if statements in sculpt tools codePablo Dobarro
This removes indentations from if statements by converting them to early returns and continue. Most of the code of brushes and tools has loops with a full indented body inside of an if, which was also copied into some of the new tools. Reviewed By: JacquesLucke Differential Revision: https://developer.blender.org/D10333
2021-02-10Merge branch 'blender-v2.92-release'Pablo Dobarro
2021-02-10Fix T85079: Thumb brush unstable when producing larger displacementsPablo Dobarro
The thumb brush was updating the area normal per brush sample, which was making unstable sampled normals for setting the displacement direction when the vertices are moved too much from their original positions. Now it always uses the original normal except when using anchored strokes. In those cases, the normal always needs to be updated. Reviewed By: JacquesLucke Maniphest Tasks: T85079 Differential Revision: https://developer.blender.org/D10214
2021-02-05Cleanup: correct spelling in commentsCampbell Barton
2021-02-03Fix T85230: Face Set Boundary automasking not working with dyntopoPablo Dobarro
Dyntopo does not have Face Sets implemented yet, so the entire mesh is considered a single Face Set. In that case, the check unique face set function should always return true. Reviewed By: JacquesLucke Maniphest Tasks: T85230 Differential Revision: https://developer.blender.org/D10259
2021-01-25Fix T84031 initialize connectivity info of the base mesh before using ↵Greg Neumiller
Displacement Smear brush. Reviewed By: pablodp606 Maniphest Tasks: T84031 Differential Revision: https://developer.blender.org/D9956
2021-01-06Fix T84202: Sculpt lasso mask crash after remesh.Bastien Montagne
'Caused'/revealed by rBd29a720c45e5: Operators that fully re-create the mesh would previously rely on `sculpt_update_object` called from update code to get required sculpt-specific data layers re-added to the new mesh. Now instead put all code adding data to orig mesh for sculpt purpose into a new util function (`BKE_sculpt_ensure_orig_mesh_data`), and call that function when entering sculpt mode, and from voxel remesher code. This is contonuing effort to more clearly separate orig data from evaluated data handling/usage in sculpt code. TODO: there are likely other code paths that would need to call that new function? Reviewers: @sergey, @pablodp606 Subscribers:
2021-01-05Sculpt: use distance threshold for dyntopo symmetrizeCampbell Barton
This was only used for non-dyntopo symmetrize. There is no reason to use a hard-coded value in this case.
2021-01-05Fix T84364: Sculpt symmetrize fails with shape keysCampbell Barton
Use the BMesh symmetrize operator instead of using the modifier code. While we could support shape-keys with the existing code used by the mirror modifier, we'd need to add code-paths for evaluated mesh & bmesh conversion to handle shape-keys differently just for this one case, since we want to avoid copying & processing shape-keys layers for evaluated meshes in general.
2021-01-05BMesh: Add shape-key support to edit-mesh symmetrizeCampbell Barton
Symmetrize now flips shape-keys too since using the un-flipped locations creates an overlapping surface which isn't useful.
2020-12-29Fix T83439: Sculpt: Radial symmetry combined with mirroring results in ↵Philipp Oeser
texture offsets Looks like this has been wrong since the introduction in rB5505697ac508 10 years ago. To get the proper texture lookup in the mirrored area, first rotate, then translate/flip [instead of the other way around]. Maniphest Tasks: T83439 Differential Revision: https://developer.blender.org/D9897
2020-12-24Cleanup: Fix capitalization in various UI stringsYevgeny Makarov
Approximately 195 changes of capitalization to conform to MLA title style. UI labels and property names should use MLA title case, while descriptions should be capitalized like regular prose, generally with only the start of a sentence capitalized. Differential Revision: https://developer.blender.org/D9922
2020-12-23Fix T84002: Sculpt: Masking operations crash if multires is in play.Bastien Montagne
This fixes the main issue there (essentially a followup to rB90e12e823ff0: Fix T81854: crash when undoing switch between sculpt and edit mode). We basically remove more (hopefully all the remaining!) modifications of orig mesh from `sculpt_update_object`, as those done here will not be immediately available in the evaluated data (that specific bug happened because masking data was added to orig mesh there, but not flushed to depsgraph evaluated one). This also goes towards a better separation between handling of evaluated data and orig one. Note that modification of orig mesh data can still happen, e.g. values in some cdlayers, but at least all pointers should now be valid in the evaluated mesh. There are still some issues, e.g. we now get an assert/crash in `multires_reshape_assign_final_coords_from_ccg` when undoing out of the Sculpt mode, presumably because subdiv_ccg data remains unchanged then (and hence still has the `has_mask` flag set), while actual mesh data do not have that cdlayer anymore... This commit also cleans up/simplifies some code, `ED_object_sculptmode_enter_ex` was (indirectly) calling `BKE_sculpt_face_sets_ensure_from_base_mesh_visibility` twice e.g.
2020-12-16Fix T83856: Sculpt: anchored brushes with spherical falloff ignore topology ↵Philipp Oeser
automasking Anchored brushes with spherical falloff start off with zero radius, thus we have no pbvh nodes on the first brush step. This would prevent initializing the automasking cache [which only happens on the first brush step]. Maniphest Tasks: T83856 Differential Revision: https://developer.blender.org/D9873
2020-12-16Sculpt: Multires Displacement SmearPablo Dobarro
This tool implements smearing for multires displacement over the limit surface, similar to how smearing for colors and topology slide works. When used the displacement values of the vertices "slide" over the topology, creating the effect of smearing the surface detail. As the brush just modifies displacement values instead of coordinates, the total displacement of the affected area doesn't change. This means that this smearing effect can be used multiple times over the same area without generating any artifacts in the topology. When the brush is used with the pinch or expand smear modes, displacement differences are pushed into the same area, creating hard surface effects without pinching the topology. As any other brush that relies on the limit surface (like displacement erasers), this will work better after using apply base. Reviewed By: sergey, JulienKaspar, dbystedt Differential Revision: https://developer.blender.org/D9659
2020-12-15Fix T83201: Cloth brush performance regressionPablo Dobarro
The if statement of the dynamic area mode branch should be an else if. When using local mode, this was running both the local and global code. I moved this code to sculpt_cloth and refactored it to use a switch case to prevent this from happening again. Reviewed By: mont29 Maniphest Tasks: T83201 Differential Revision: https://developer.blender.org/D9762
2020-12-14Cleanup: Fix capitalization in various placesYevgeny Makarov
Approximately 33 changes of capitalization to conform to MLA title style. Differential Revision: https://developer.blender.org/D9796 Reviewed by Julian Eisel
2020-12-10Sculpt: Elastic deform type for Snake HookPablo Dobarro
This adds deformation types to snake hook and the elastic deformation type. This mode deforms the mesh using a kelvinlet instead of applying the displacement directly inside the brush radius, which is great for stylized shapes sketching. Changes in rake rotation when using elastic are too strong when set to 1, so I'll add a nicer way to support rake rotations with smoother transitions in the future. Reviewed By: sergey, JulienKaspar Differential Revision: https://developer.blender.org/D9560
2020-12-01Fix sculpt transform incorrently flipping displacement in Y and Z axisPablo Dobarro
These functions were only checking the X axis for flipping the displacement for a symmetry area depending on the initial position of the pivot. This affects transform and any other tools that transform vertices and applies symmetry based on areas (the pose brush, for example). Reviewed By: sergey Differential Revision: https://developer.blender.org/D9654
2020-11-30Cleanup: Use "region" for ARegion variable namesHans Goudey
As proposed in T74432 and already implemented in several commits, "region" is the preferred name for `ARegion` variables, rather than any variant of "ar". This commit changes a few "ar" variables that have popped up over time and also adjusted names of variants like "arnew".
2020-11-27Sculpt: Refactor transform code to allow incremental updatesPablo Dobarro
This adds support for incremental updates in the sculpt transform code. Now tools can define if they need the displacement applied for the original coordinates or incrementally. This is needed for features like elastic transform or cloth deformation target in the transform tool. No functional changes. Reviewed By: sergey Differential Revision: https://developer.blender.org/D9547
2020-11-12Fix T82388: Sculpt mode: Unexpected undo behavior.Bastien Montagne
Issue exposed by rB4c7b1766a7f1. Main idea is that non-memfile first undo step should check into previous memfile and tag the ID it is editing as `future_changed`. That way, when we go back and undo to the memfile, said IDs are properly detected as changed and re-read from the memfile. Otherwise, undo system sees them as unchanged, and just re-use the current data instead. Note that currently only Sculpt mode seems affected (probably because it is storing the mode switch itself as a Sculpt undo step instead of a memfile one), but similar action might be needed in some other cases too. Maniphest Tasks: T82388 Differential Revision: https://developer.blender.org/D9510
2020-11-09Merge branch 'blender-v2.91-release'Pablo Dobarro
2020-11-09Fix assert in the sculpt pen tilt codePablo Dobarro
Reviewed By: campbellbarton Differential Revision: https://developer.blender.org/D9422
2020-11-06Cleanup: use ELEM macro (>2 args)Campbell Barton
2020-11-06Merge branch 'blender-v2.91-release'Pablo Dobarro
2020-11-06Fix T81915: Draw Face Sets not working with deformed sculpt meshPablo Dobarro
The draw face sets brush uses the poly center when used in meshes to increase its precision when working in low poly geometry. For this to work with deformed meshes, the deformed coordinates from the PBVH should be used instead. Reviewed By: sergey Maniphest Tasks: T81915 Differential Revision: https://developer.blender.org/D9424
2020-11-06Fix T82400: Dyntopo detail size edit operator visual glitchPablo Dobarro
Just a missing immUnbindProgram Reviewed By: sergey Maniphest Tasks: T82400 Differential Revision: https://developer.blender.org/D9459
2020-11-06Fix Dyntopo detail size preview orientation not matching the cursorPablo Dobarro
Used the sampled cursor normal when available instead of the raycast face normal. This makes the preview match the previous orientation of the cursor. Reviewed By: sergey Differential Revision: https://developer.blender.org/D9460
2020-11-04Merge branch 'blender-v2.91-release'Pablo Dobarro
2020-11-04Fix T81842: Cloth brush not creating simulation areas for each tiling ↵Pablo Dobarro
symmetry pass The cloth brush fixed simulation areas are created using the initial_location variable in the StrokeCache. This variable was not being updated by tiling symmetry, so all symmetry passes were using the same simulation area location. Reviewed By: sergey Maniphest Tasks: T81842 Differential Revision: https://developer.blender.org/D9421
2020-11-04Fix T82297: Brush alpha not affecting smear tools strengthPablo Dobarro
The strength of this brush needs to take alpha into account Reviewed By: sergey Maniphest Tasks: T82297 Differential Revision: https://developer.blender.org/D9419
2020-10-30Sculpt: Dyntopo detail size edit operatorPablo Dobarro
This introduces a new operator to edit the detail size of constant detail mode in dyntopo. The way this operator works and the functionality it provides is similar to the "Voxel size edit" operator for the voxel remesher. It also includes a sample mode. When pressing Ctrl, the detail size will be sampled from the surface under the cursor, updating the preview in real time. This allows quick resolution changes without using the operator multiple times. The operator is set to Shift + D, replacing the old way to change the constant detail size of dyntopo. Shift + R will remain available to be enabled when the voxel remesher works with dyntopo. Deciding if both detail sizes can be unified needs a separate discussion as the new dyntopo can work with detail sizes in parts of the mesh that can easily crash the remesher. The structure of these operators is similar, but the data they control, ranges, drawing and setup functions are completely different, making it hard to merge them into one. Reviewed By: sergey Differential Revision: https://developer.blender.org/D9355