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-08-16Sculpt: Fix redo panel bugsJoseph Eagar
SCULPT_undo_push_begin no longer takes an explicit name. Instead it takes a wmOperator pointer and uses op->type->name for the name. This is necassary for the redo panel to work and should fix the entire class of bugs related to misspelled undo push names. Cases where the calling operator is not registered may use SCULPT_undo_push_begin_ex if desired; it takes a name string as before.
2022-08-02Merge branch 'blender-v3.3-release'Hans Goudey
2022-08-02Fix T96810: Invalid sculpt normals after some operationsHans Goudey
Mask and color brushes were using the existing PBVH vertex "update tag" to mark their modifications. This was mostly unnecessary, and causes unnecessary calculation of normals. It also caused errors though, because they didn't tag the corresponding PBVH node for normal recalculation, causing problems on the borders of nodes, since one node might accumulate into another's vertex normals, but the other node wouldn't also accumulate and normalize the normals. The solution is to only use the update tag for tagging deformed vertices that need recalculated normals. Everything else is handled at the PBVH node level (which was already the case, but it wasn't clear). The update tag was also used for undo to tag the nodes corresponding to changed vertices. This was wrong though, because normals and visibility would also be recalculated for just color or mask undo steps. Instead, just use local arrays to map from vertices to nodes. Differential Revision: https://developer.blender.org/D15581
2022-07-30Sculpt: Opaque vertex type for sculptJoseph Eagar
This is a port of sculpt-dev's `SculptVertRef` refactor (note that `SculptVertRef was renamed to PBVHVertRef`) to master. `PBVHVertRef` is a structure that abstracts the concept of a vertex in the sculpt code; it's simply an `intptr_t` wrapped in a struct. For `PBVH_FACES` and `PBVH_GRIDS` this struct stores a vertex index, but for `BMesh` it stores a direct pointer to a BMVert. The intptr_t is wrapped in a struct to prevent the accidental usage of it as an index. There are many reasons to do this: * Right now `BMesh` verts are not logical sculpt verts; to use the sculpt API they must first be converted to indices. This requires a lot of indirect lookups into tables, leading to performance loss. It has also led to greater code complexity and duplication. * Having an abstract vertex type makes it feasible to have one unified temporary attribute API for all three PBVH modes, which in turn made it rather trivial to port sculpt brushes to DynTopo in sculpt-dev (e.g. the layer brush, draw sharp, the smooth brushes, the paint brushes, etc). This attribute API will be in a future patch. * We need to do this anyway for the eventual move to C++. Differential Revision: https://developer.blender.org/D14272 Reviewed By: Brecht Van Lommel Ref D14272
2022-07-11Fix T99383: Wrong origdata type in color filterJoseph Eagar
2022-06-27Fix T99100: Undo/redo bugs with paint and gravityJoseph Eagar
You can now push multiple sculpt undo nodes of different types. This is necassary to handle paint tools that have gravity enabled.
2022-06-16Cleanup: differentiate region/screen relative coordinatesCampbell Barton
- Avoid ambiguity which caused these values to be confused, use `mval` for region relative mouse coordinates, otherwise `event_xy`. - Pass region relative coordinates to sample_detail_dyntopo & sample_detail_voxel as there is no reason to use screen-space values. - Rename invalid use of mval for screen-space coordinates.
2022-05-31UI: Correct sculpt tooltipsJulien Kaspar
Some of the tools in sculpt mode were still referring to the previously experimental sculpt vertex colors. They should instead refer to color attributes. Reviewed By: jbakker Differential Revision: https://developer.blender.org/D15073
2022-05-23Cleanup: clarify what is scene linear color space in conversion conversionBrecht Van Lommel
* Rename ambiguous rgb to scene_linear in some places * Precompute matrices to directly go to scene instead of through XYZ * Make function signatures more consistent
2022-05-18Cleanup: formatCampbell Barton
2022-05-10D14887: Fix artifacts in hue filterRamil Roosileht
The hue color filter now wraps correctly. Fixes T97768. Reviewed By: Julien Kaspar & Joseph Eagar Differential Revision: https://developer.blender.org/D14887 Ref D14887
2022-05-06Switch viewport shading for color tools in solid modeRamil Roosileht
This patch implements T97613, switching viewport shading when using Color Filter and Mask By Color ALSO, this patch makes it so viewport shading color switches only when SOLID mode is chosen, to prevent color switching when using other shading modes, without user noticing it. {F13049889} Reviewed By: JulienKaspar, joeedh, jbakker Maniphest Tasks: T97613 Differential Revision: https://developer.blender.org/D14765
2022-04-30D14808: Use saturation as multiplier for saturation filterRamil Roosileht
A change proposed in T97697, using existing saturation as a multiplier for the filter operation {F13038602} Review By: Joseph Eagar, Julian Kaspar Differential Revision: https://developer.blender.org/D14808 Ref D14808
2022-04-29Fix T97097: Color filter saturate affects non-colorsJoseph Eagar
Saturation is now tested for > 0.001 instead of != 0. We may wish to turn the limit into an operator property in the future.
2022-04-21Fix T97469: Sculpt colors crash in multiresolution or dynamic topology modes.Joseph Eagar
Sculpt paint tools now pop up an error message if dynamic topology or multires are enabled. Implementation notes: * SCULPT_vertex_colors_poll is now a static function in sculpt_ops.c. It is now used solely by the legacy color attribute conversion operators (SCULPT_OT_vertex_to_loop_colors and SCULPT_OT_loop_to_vertex_colors) and should be deleted when they are. * There is a new method, SCULPT_handles_colors_report, that returns true if the sculpt session can handle color attributes; otherwise it returns false and displays an error message to the user.
2022-04-13Cleanup: shadowed variable warningCampbell Barton
2022-04-12Fix T97132: Create a color attribute automaticallyJoseph Eagar
for color filter tool instead of canceling.
2022-04-12Fix T97098: Color filter sharpening artifacts.Joseph Eagar
Color filter sharpening now clamps the output. The sharpening delta is now calculated from the difference of two levels of vertex averaging instead of one smooth iteration and the base color. TODO: Sharpen in a different color space; SRGB-linear has saturation artifacts. I tried HSL but it had value artifacts. I'd like to try LAB but we don't seem to have conversion functions for it (at least as far as I could see).
2022-04-11Fix T97097: Color Filter saturates colors that have no saturationJoseph Eagar
2022-04-11Fix T97096: Color filter brush was corrupting alpha.Joseph Eagar
2022-04-08Painting: Canvas switcher for painting brushes/tools.Jeroen Bakker
This patch adds color attributes to TexPaintSlot. This allows an easier selection when painting color attributes. Previously when selecting a paint tool the user had to start a stroke, before the UI reflected the correct TexPaintSlot. Now when switching the slot the active tool is checked and immediate the UI is drawn correctly. In the future the canvas selector will also be used to select an image or image texture node to paint on. Basic implementation has already been done inside this patch. A limitation of this patch is that is isn't possible anymore to rename images directly from the selection panel. This is currently allowed in master. But as CustomDataLayers aren't ID fields and not owned by the material supporting this wouldn't be easy. {F12953989} In the future we should update the create slot operator to also include color attributes. Sources could also be extended to use other areas of the object that use image textures (particles, geom nodes, etc... ). Reviewed By: brecht Maniphest Tasks: T96709 Differential Revision: https://developer.blender.org/D14455
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-03-09Cleanup: rename wmEvent.prev_click_* to prev_press_*Campbell Barton
At the time of naming these members only some event types generated click events so it made some sense to differentiate a click. Now all buttons support click & drag it's more logical to use the prefix "prev_press_" as any press event will set these values. Also update doc-strings.
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-10Refactor: Move PBVH update tag out of MVertHans Goudey
This is part of the project of converting `MVert` into `float3`. (more details in T93602), The pbvh update flag is removed and replaced with a bitmap stored in the PBVH structure. This patch is similar to D13878. This is mainly setup for an eventual performance improvement by removing the extra data from mesh vertices, but if it's consistent with testing in the other patch doing the same thing for another "temp tag", then it may actually increase the speed of sculpt code slightly, since less memory needs to be loaded when checking/changing the flags. Differential Revision: https://developer.blender.org/D14000
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-07-23Cleanup: code comments punctuation / spacingCampbell Barton
2021-03-13Cleanup: add BKE_pbvh_vertex_iter_begin to clang-formatPablo Dobarro
Reviewed By: JacquesLucke Differential Revision: https://developer.blender.org/D10707
2021-02-14Cleanup: Source Code Typosluzpaz
Corrects approximately 36 spelling errors in source variable names. Differential Revision: https://developer.blender.org/D10347 Reviewed by Hans Goudey
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-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-10-15Sculpt: Add global automasking settings support in filtersPablo Dobarro
When using the sculpt filters, global automasking settings that affect all brushes were ignored because the automasking system was not implemented for filters, making filters and brushes react differently to the global sculpt settings which creates confusion. This makes all filter tools (mesh, cloth, color) use the same general automasking settings and features as the brush tools. Filters will now use the settings in the options panel to limit their effect. This also removes the "use Face Sets" option from the Mesh filter code, as it was duplicated from the automasking code just to have that funcitonality. This is now handled by the regular automasking system. The "Use Face Sets" option is still available in the cloth filter as that option limits the action of the forces, not the displacement. After this, it is possible to initialize the automasking system independently from the StrokeCache and Brush settings, so it can also be added to more tools and features in the future. Fixes T81619 Reviewed By: dbystedt, sergey Maniphest Tasks: T81619 Differential Revision: https://developer.blender.org/D9171
2020-09-02Fix T80311: Sculpt Filters not working when using vertical splitPablo Dobarro
All filters were using prevclicx, which is in screen coordinates and mval[0], which is in region coordinates to get the filter strength. This fixes the issue in all filters. Reviewed By: Severin Maniphest Tasks: T80311 Differential Revision: https://developer.blender.org/D8776
2020-08-18Sculpt: Sculpt Filter Orientation OptionsPablo Dobarro
Previously, the XYZ deform axis of the Mesh Filter were limited to object space (which is the default for sculpt mode). Now it is possible to limit the XYZ displacement in Local, Global or View space. Reviewed By: sergey Differential Revision: https://developer.blender.org/D8582
2020-08-12Cleanup: Use clamp_f instead of CLAMP in sculpt codePablo Dobarro
Reviewed By: sergey Differential Revision: https://developer.blender.org/D8528
2020-08-12Fix Sculpt Filters operator namingPablo Dobarro
Reviewed By: sergey Differential Revision: https://developer.blender.org/D8523
2020-08-04Merge branch 'blender-v2.90-release'Bastien Montagne
Conflicts: source/blender/editors/gpencil/gpencil_primitive.c
2020-08-04Cleanup: typos & co in UI messages (and some other places).Bastien Montagne
2020-07-29Cleanup: declare static variablesCampbell Barton
2020-07-27Fix T78242: Crash when using a Sculpt color tools that needs connectivity ↵Pablo Dobarro
for the first time When there is no color layer available, BKE_sculpt_update_object_for_edit creates a new one and tags the mesh with ID_RECLAC_GEOMETRY, so this layer is inmediatly available when the tool starts. This also deletes the PBVH and when it is created again in BKE_sculpt_update_object_after_eval, the pmap is not initialized, making the tool crash. This moves the color layer creation to a separate function outside BKE_sculpt_update_object_for_edit, which now runs after the color layer is available, so it won't need to update again and the pmap will still be available when the tool is used. Reviewed By: sergey Maniphest Tasks: T78242 Differential Revision: https://developer.blender.org/D8135
2020-07-09Sculpt: Make Sculpt Vertex Colors features experimentalPablo Dobarro
This disables all Sculpt Vertex Colors tools, operators, panels and rendering capabilities and puts them under the "Use Sculpt Vertex Colors" experimental option. Reviewed By: brecht Differential Revision: https://developer.blender.org/D8239
2020-06-30Sculpt: Color filter fill modePablo Dobarro
This implements a fill mode in the Color Filter tool, which fills the entire mesh with a specific color. As this functionality is part of the color filter, this allows to control the blending of the fill color with the filter strength. Reviewed By: sergey Differential Revision: https://developer.blender.org/D8158
2020-06-29Remove Threaded Sculpt optionPablo Dobarro
Threaded Sculpt is now always enabled by default. If it causes performance problems compared single threaded sculpt it should be considered a bug. Reviewed By: sergey Maniphest Tasks: T77638 Differential Revision: https://developer.blender.org/D7960
2020-06-26Fix Color Filter not updating during modal operatorPablo Dobarro
The code for tagging the updates was wrong Reviewed By: sergey Differential Revision: https://developer.blender.org/D8109
2020-06-23Sculpt Vertex Colors: Initial implementationPablo Dobarro
Sculpt Vertex Colors is a painting system that runs inside sculpt mode, reusing all its tools and optimizations. This provides much better performance, easier to maintain code and more advanced features (new brush engine, filters, symmetry options, masks and face sets compatibility...). This is also the initial step for future features like vertex painting in Multires and brushes that can sculpt and paint at the same time. This commit includes: - SCULPT_UNDO_COLOR for undo support in sculpt mode - SCULPT_UPDATE_COLOR and PBVH flags and rendering - Sculpt Color API functions - Sculpt capability for sculpt tools (only enabled in the Paint Brush for now) - Rendering support in workbench (default to Sculpt Vertex Colors except in Vertex Paint) - Conversion operator between MPropCol (Sculpt Vertex Colors) and MLoopCol (Vertex Paint) - Remesher reprojection in the Voxel Remehser - Paint Brush and Smear Brush with color smoothing in alt-smooth mode - Parameters for the new brush engine (density, opacity, flow, wet paint mixing, tip scale) implemented in Sculpt Vertex Colors - Color Filter - Color picker (uses S shortcut, replaces smooth) - Color selector in the top bar Reviewed By: brecht Maniphest Tasks: T72866 Differential Revision: https://developer.blender.org/D5975