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-02-28Merge branch 'blender-v3.1-release'Sergey Sharybin
2022-02-28Fix compilation warning.Jeroen Bakker
2022-02-28Fix T95992: Crash Ancored strokes 2d texture painting.Jeroen Bakker
When using ancored stroked the diameter of the stroke can be 0 what leads to a division by zero that on certain platforms wrap to a large negative number that cannot be looked up. This fix will clamp the size of the brush to 1.
2022-02-25Cleanup: use flags for wmEvent modifier keysCampbell Barton
Using flags makes checking multiple modifiers at once more convenient and avoids macros/functions such as IS_EVENT_MOD & WM_event_modifier_flag which have been removed. It also simplifies checking if modifier keys have changed.
2022-02-23Curves: initial brush implementations for curves sculpt modeJacques Lucke
The main goal here is to add the boilerplate code to make it possible to add the actual sculpt tools more easily. Both brush implementations added by this patch are meant to be prototypes which will be removed or refined in the coming weeks. Ref T95773. Differential Revision: https://developer.blender.org/D14180
2022-02-23Cleanup: correction to repeated word removal & correct spellingCampbell Barton
2022-02-22Cleanup: Replace eTexPaintMode with classes.Jeroen Bakker
For an upcoming prototype we would introduced a new eTexPaintMode option. That would add more cases and if statements. This change migrate the eTexPaintMode to 3 classes. AbstractPaintMode contains a shared interface. ImagePaintMode for 2d painting and ProjectionPaintMode for 3d painting.
2022-02-22Fix compilation issue under windows.Jeroen Bakker
2022-02-22Fix compilation error on certain platforms.Jeroen Bakker
Seems this isn't an issue on newer compilers.
2022-02-22Convert paint_image to cc.Jeroen Bakker
2022-02-22Cleanup: Renamed PaintOperation.custom_paint to stroke_handle.Jeroen Bakker
2022-02-22Cleanup: use doxygen sectionsCampbell Barton
2022-02-22Cleanup: Use switch-statement for eTexPaintMode.Jeroen Bakker
2022-02-21Paint: pass operator to stroke update functionJacques Lucke
This allows accessing properties of the operator that the stroke belongs to.
2022-02-21Curves: use paint cursor in curves sculpt modeJacques Lucke
Also adds radius and strength control to the tool settings in the ui.
2022-02-21Cleanup: use namespace and code sectionsJacques Lucke
2022-02-21Cleanup: move curves sculpt mode toggle operator to sculpt/paint moduleJacques Lucke
This is necessary, because the operator will have to use functions that are currently private within this module. E.g. `paint_cursor_start`.
2022-02-21Paint: decouple op->customdata from PaintStrokeJacques Lucke
Previously, all operators using `PaintStroke` would have to store the stroke in `op->customdata`. That made it impossible to store other operator specific data in `op->customdata` that was unrelated to the stroke. This patch changes it so that the `PaintStroke` is passed to api functions as a separate argument, which allows storing the stroke as a subfield of some other struct in `op->customdata`.
2022-02-18Cleanup: Rename original curve object type enumHans Goudey
This commit renames enums related the "Curve" object type and ID type to add `_LEGACY` to the end. The idea is to make our aspirations clearer in the code and to avoid ambiguities between `CURVE` and `CURVES`. Ref T95355 To summarize for the record, the plans are: - In the short/medium term, replace the `Curve` object data type with `Curves` - In the longer term (no immediate plans), use a proper data block for 3D text and surfaces. Differential Revision: https://developer.blender.org/D14114
2022-02-18Curves: initial brush system integration for curves sculpt modeJacques Lucke
This adds the boilerplate code that is necessary to use the tool/brush/paint systems in the new sculpt curves mode. Two temporary dummy tools are part of this patch. They do nothing and only serve to test the boilerplate. When the first actual tool is added, those dummy tools will be removed. Differential Revision: https://developer.blender.org/D14117
2022-02-16Merge branch 'blender-v3.1-release'Philipp Oeser
2022-02-16Fix T95787: Texture paint: Apply Camera Image crash for certain imagesPhilipp Oeser
This does not happen with **any** image, but with images that have ID properties. ID properties are used to store view projection matrices (e.g. for reprojection with `Image from View` or `Quick Edit` -- these are the ones we are interested in), but of course they can be used for anything else, too. The images in the file from the report have ID properties from an Addon for example. So the crash can reliably be reproduced with **any** image doing the following: ``` bpy.data.images['myImage']['myIDprop'] = "foo" ``` This would lead code in `texture_paint_camera_project_exec` to think the needed `view_data` is on the image (but in reality it was just some other IDprop). Solution is simple: just check `view_data` is really valid after getting it from the IDprops. Maniphest Tasks: T95787 Differential Revision: https://developer.blender.org/D14116
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
2022-02-10Cleanup: copyright in headers, spelling in commentsCampbell Barton
- Order year consistently. - Minor consistency (case, double-spacing). - Correct typos.
2022-02-09Cleanup: move file descriptions into doxygen file sectionCampbell Barton
Continuation of 19100aa57d847699d17527b76c2fab1f4ab88885.
2022-02-09Cleanup: move file descriptions into doxygen file sectionCampbell Barton
Also other minor corrections & reformat particle system copyright.
2022-02-03Cleanup: use NULL items for the default sample enumCampbell Barton
Using this enum quiets a warning when exporting key-maps.
2022-02-03Merge branch 'blender-v3.1-release'Campbell Barton
2022-02-03Docs: correct weight paint sample descriptionCampbell Barton
2022-02-01Merge branch 'blender-v3.1-release'Campbell Barton
2022-02-01Cleanup: remove duplicate vertex normal array in SculptSessionCampbell Barton
From investigating T95185, it's important the normal returned by SCULPT_vertex_normal_get always match the PBVH normal array. Since this is always initialized in the PBVH, there is no advantage in storing the normal array in two places, it only adds the possibility that changes in the future causing different meshes normals to be used. Split out from D13975.
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