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
2020-03-28Cleanup: compiler warningsBrecht Van Lommel
2020-03-27Sculpt: Pose Brush Face Sets origin modePablo Dobarro
This commit introduces a new mode for calculating the positions and weights of the IK segments in the Pose Brush based on the Face Sets. The first segment of the chain will always include all face sets inside the brush radius and it will propagate until the boundary of the last face sets added in the flood fill. Then consecutive connected face sets are added to the chain until the chain length limit is reached or all face sets of the mesh are already part of the chain. This feature enables complete control over the pose brush origins in case that is needed. Also, with this mode, the user can have a library of base meshes with face sets already configured to get to the initial pose as fast as possible. Reviewed By: jbakker Differential Revision: https://developer.blender.org/D7235
2020-03-27Sculpt: Weight normal and area sampling towards the brush centerPablo Dobarro
Previously, all vertices inside the brush radius were taken into account equally when calculating the sculpt normal and area. This was causing artifacts and unpredictable results with large brushes or meshes with curvatures, as the strongest deformation point of all brushes is usually in the center. By weighting the vertex normal and position towards the center when sampling, all brushes should now behave in a more predictable way in non-uniform surfaces. Reviewed By: jbakker Differential Revision: https://developer.blender.org/D6989
2020-03-27Fix T74637: Reset face set data when disabling dyntopoPablo Dobarro
Last time I checked Face Sets were preserved in a more or less predictable way when modifying the mesh with dyntopo. As it looks that in some problems this may cause bugs and you can't see or use face sets when modifying the topology of the mesh whith dyntopo active, it is probably better to reset them when going from dyntopo to mesh. This way you know that you are always going to get a predictable face sets state. Reviewed By: jbakker Maniphest Tasks: T74637 Differential Revision: https://developer.blender.org/D7099
2020-03-27Cleanup: quiet unused function warningCampbell Barton
2020-03-27Cleanup: rename WM_modalkeymap API names, matching WM_keymapCampbell Barton
Rename: - WM_modalkeymap_add to WM_modalkeymap_ensure - WM_modalkeymap_get to WM_modalkeymap_find
2020-03-27Cleanup: uppercase macros for sculpt iterators, add to clang-formatCampbell Barton
Also use sculpt prefix for SCULPT_CLAY_STABILIZER_LEN.
2020-03-26Sculpt: Create Face Set by Edit Mode SelectionPablo Dobarro
This implements a new mode in the Face Sets Create operator to create a new face sets from the faces selection in edit mode. This can be used when the user considers that the edit mode tools are more convenient for a more precise control or a certain type of selection, like creating a face set from a face loop. Reviewed By: jbakker Differential Revision: https://developer.blender.org/D7211
2020-03-26Sculpt: Face Sets Init operatorPablo Dobarro
This operator initializes all face sets in the sculpt at once using different mesh properties. It can create face sets by mesh connectivity, material slots, face normals, UV seams, creases, sharp edges, bevel weights and face maps. For properties that are already in the faces, this is implemented as a loop. Properties that depend on edge attributes use a similar operation to sculpt flood fill, but using face adjacency instead of edge vertex connectivity. As Multires also stores the face sets in the base mesh, this should work in the face sets Multires implementation without any changes. This is implemented as a separate operator as this resets the visibility and creates all face sets at once, while the create face set operator creates a single face sets, leaving the rest of the face sets in the mesh as they are. Reviewed By: jbakker Differential Revision: https://developer.blender.org/D7209
2020-03-26Sculpt: Surface Smooth Brush and Mesh FilterPablo Dobarro
This implements the Surface Smooth Brush as a mode inside the Smooth tool, which uses the HC algorithm from "Improved Laplacian Smoothing of Noisy Surface Meshes". Comparted to the regular smooth brush with laplacian smooth, this brush removes the surface while preserving the volume of the object. The smooth result can be controlled by tweaing the original shape preservation, displacement and iteration count. The same surface smooth operation is also available as a mesh filter. Reviewed By: jbakker Differential Revision: https://developer.blender.org/D7057
2020-03-26Fix T74780: Face sets operators not aware of SCULPT_FACE_SET_NONEPablo Dobarro
SCULPT_FACE_SET_NONE default value is 0 and it is rendered hidden, so the invert sign operation to show it was not working. Now the show all function sets this face set to ID 1 before setting its sign. I also refactored this check in gpu_buffers. Not related to the reported issue, but the mesh in attached contains non manifold geometry with hidden loose vertices, so the visibility state was not syncing correctly to those vertices. Now the toggle operators checks the current visibility only on the face sets, so no manifold vertices are ignored (as they are in the rest of operations in sculpt mode). Reviewed By: jbakker Maniphest Tasks: T74780 Differential Revision: https://developer.blender.org/D7188
2020-03-26Fix T74761: Reimplement vertex to face sets visibility syncPablo Dobarro
This fixes multiple issues: - Adds tag to update shading when changing vertex visibiliyt. This makes the mesh visibility update when the operator ends. - Sync vertex to face sets no longer requires the pmap, so it does not crash. (Maybe we can initialize the pmap on undo to avoid these problems in the future). - Sync vertex to face sets now works in a coherent way with the rest of visibility operations. Hide Box and Hide mask now sync the visibility changes to the face sets, so the all the operations are now getting a correct visibility state. Reviewed By: brecht Maniphest Tasks: T74761 Differential Revision: https://developer.blender.org/D7187
2020-03-26Fix T74808: Division by 0 in Cloth brush solver with overlapping verticesPablo Dobarro
This checks that the distance of the current positions of two connected vertices is not 0 before calculating the correction vectors for those vertices. Reviewed By: jbakker Maniphest Tasks: T74808 Differential Revision: https://developer.blender.org/D7184
2020-03-26Fix T75089: Missing pmap when using Face Sets in the mesh filterPablo Dobarro
When using Face Sets to mask the mesh filter the pmap needs to be initialized to check the face sets of each vertex, otherwise it will crash because it is null. Probably now we should just initalize the pmap when building the PBVH as almost all tools need it, so we can avoid these crashes in the future. Reviewed By: jbakker Maniphest Tasks: T75089 Differential Revision: https://developer.blender.org/D7236
2020-03-26Cleanup: redundant cast, unused argumentsCampbell Barton
2020-03-26Fix crash with missing NULL check accessing grease pencil paintCampbell Barton
2020-03-26Fix crashes from various missing checks in operator poll functionsCampbell Barton
Issues exposed by 'bl_run_operators.py' utility.
2020-03-26Fix crash setting the brush with the current brush was unsetCampbell Barton
2020-03-26Fix T74711: tiling brush option in image editor not working anymoreBrecht Van Lommel
This makes it work again at least for the non-UDIM case. For UDIM it's not great still but I'll consider that a known limitation. A proper solution is probably to find the closest tile at the start of the stroke and then only paint in that one tile for the rest of the stroke.
2020-03-19Cleanup: fix typos in commentsBrecht Van Lommel
Contributed by luzpaz. Differential Revision: https://developer.blender.org/D7133
2020-03-19Cleanup: `make format` after SortedIncludes changeDalai Felinto
2020-03-18Cleanup: Resolve HKEY conflictRay Molenkamp
Both the MS headers and blender headers define the HKEY which gives all kind of inclusion order issues. This diff renames all *KEY constants to EVT_*KEY to resolve this conflict. Reviewed By: brecht , dfelinto Differential Revision: http://developer.blender.org/D7164
2020-03-18Weight Paint: Implement a new Lock-Relative mode.Alexander Gavrilov
This check box alters how weights are displayed and painted, similar to Multi Paint, but in a different way. Specifically, weights are presented as if all locked vertex groups were deleted, and the remaining deform groups normalized. The new feature is intended for use when balancing weights within a group of bones while all others are locked. Enabling the option presents weight as if the locked bones didn't exist, and their weight was proportionally redistributed to the editable bones. Conversely, the Multi-Paint feature allows balancing a group of bones as a whole against all unselected bones, while ignoring weight distribution within the selected group. This mode also allows temporarily viewing non-normalized weights as if they were normalized, without actually changing the values. Differential Revision: https://developer.blender.org/D3837
2020-03-17VR: Initial Virtual Reality support - Milestone 1, Scene InspectionJulian Eisel
NOTE: While most of the milestone 1 goals are there, a few smaller features and improvements are still to be done. Big picture of this milestone: Initial, OpenXR-based virtual reality support for users and foundation for advanced use cases. Maniphest Task: https://developer.blender.org/T71347 The tasks contains more information about this milestone. To be clear: This is not a feature rich VR implementation, it's focused on the initial scene inspection use case. We intentionally focused on that, further features like controller support are part of the next milestone. - How to use? Instructions on how to use this are here: https://wiki.blender.org/wiki/User:Severin/GSoC-2019/How_to_Test These will be updated and moved to a more official place (likely the manual) soon. Currently Windows Mixed Reality and Oculus devices are usable. Valve/HTC headsets don't support the OpenXR standard yet and hence, do not work with this implementation. --------------- This is the C-side implementation of the features added for initial VR support as per milestone 1. A "VR Scene Inspection" Add-on will be committed separately, to expose the VR functionality in the UI. It also adds some further features for milestone 1, namely a landmarking system (stored view locations in the VR space) Main additions/features: * Support for rendering viewports to an HMD, with good performance. * Option to sync the VR view perspective with a fully interactive, regular 3D View (VR-Mirror). * Option to disable positional tracking. Keeps the current position (calculated based on the VR eye center pose) when enabled while a VR session is running. * Some regular viewport settings for the VR view * RNA/Python-API to query and set VR session state information. * WM-XR: Layer tying Ghost-XR to the Blender specific APIs/data * wmSurface API: drawable, non-window container (manages Ghost-OpenGL and GPU context) * DNA/RNA for management of VR session settings * `--debug-xr` and `--debug-xr-time` commandline options * Utility batch & config file for using the Oculus runtime on Windows. * Most VR data is runtime only. The exception is user settings which are saved to files (`XrSessionSettings`). * VR support can be disabled through the `WITH_XR_OPENXR` compiler flag. For architecture and code documentation, see https://wiki.blender.org/wiki/Source/Interface/XR. --------------- A few thank you's: * A huge shoutout to Ray Molenkamp for his help during the project - it would have not been that successful without him! * Sebastian Koenig and Simeon Conzendorf for testing and feedback! * The reviewers, especially Brecht Van Lommel! * Dalai Felinto for pushing and managing me to get this done ;) * The OpenXR working group for providing an open standard. I think we're the first bigger application to adopt OpenXR. Congratulations to them and ourselves :) This project started as a Google Summer of Code 2019 project - "Core Support of Virtual Reality Headsets through OpenXR" (see https://wiki.blender.org/wiki/User:Severin/GSoC-2019/). Some further information, including ideas for further improvements can be found in the final GSoC report: https://wiki.blender.org/wiki/User:Severin/GSoC-2019/Final_Report Differential Revisions: D6193, D7098 Reviewed by: Brecht Van Lommel, Jeroen Bakker
2020-03-17Fix T74838: fix dereferencing of NULL in sculpt_no_multires_poll when no ↵Robert Guetzkow
active object exists Fix crash when the operator search is used while no active object exists. The cause of the issue is an attempt to dereference `ob` when it is `NULL`. Therefore this patch checks the return value of `SCULPT_mode_poll()` first, to ensure that `ob` isn't `NULL`. Reviewed By: pablodp606 Maniphest Tasks: T74838 Differential Revision: https://developer.blender.org/D7156
2020-03-16Update viewport rotation origin when changing Face Set visibilityPablo Dobarro
Small UX fix. When hidding everything but the active face set with H, the last stroke lotation center can be in a part of the model that is hidden, so viewport navigation becomes confusing until you start a new stroke on the visible face set. Now the viewport navigation rotation center is updated to the active vertex when using a visibility operation that uses it, so it always rotates using the visible face set as the origin. Reviewed By: jbakker Differential Revision: https://developer.blender.org/D7137
2020-03-14Cleanup: sort file lists & struct declatationsCampbell Barton
2020-03-12Fix boundary edges detection ignoring Face Set visibilityPablo Dobarro
If one of the faces connected to a vertex is hidden in the face sets, we can assume that the vertex is part of a boundary edge, so it should be cosidered like that in all automasking and edge detection functions. Reviewed By: jbakker Differential Revision: https://developer.blender.org/D7126
2020-03-12Fix flood fill operation not taking into account hidden verticesPablo Dobarro
The idea of the visibility system is that tools should behave like hidden vertices do not exist, so the flood fill operation should ignore hidden vertices for all operators. Reviewed By: jbakker Differential Revision: https://developer.blender.org/D7125
2020-03-12Use golden ratio conjugate for Face Sets hue generationPablo Dobarro
The face set ID is sequential, so implementing this was straightforward. Suggested by Jeroen Bakker Reviewed By: jbakker Differential Revision: https://developer.blender.org/D7123
2020-03-12Fix Face Set operators not modifying sigle poly Face SetsPablo Dobarro
The face_set_set function which sets a face sets given a vertex index can ignore all modifications to hidden face sets, so we can skip all vertex visibility checks outside that function. This makes the code faster, simpler and fixes multiple bugs. Reviewed By: jbakker Differential Revision: https://developer.blender.org/D7122
2020-03-12Fix T74646: Pick a random face set to be rendered white when randomizing the ↵Pablo Dobarro
colors The previous solution was also working fine as the white face set has no meaning, but now it is a little bit more random. Also, bigger face sets have more chance of getting the white color. Reviewed By: jbakker Maniphest Tasks: T74646 Differential Revision: https://developer.blender.org/D7111
2020-03-12Fix T74648: Do not relax with 0 neighbors or no vertex normalPablo Dobarro
The mesh provided in the report has 0 area faces and overlapping vertices, causing the relax code to fail when calculating the plane to constraint the vertex movement. Now it works fine both in the brush and in the mesh filter. Reviewed By: jbakker Maniphest Tasks: T74648 Differential Revision: https://developer.blender.org/D7109
2020-03-12Fix mesh shrinking when using the relax mesh filter.Pablo Dobarro
If the relax mesh filter was used on a non manifold mesh with open boundaries, all the vertices were relaxed and the mesh was shrinking. This was an unintended behavior that was making the filter unusable with these meshes. The mesh filter is now initializing an automasking buffer using the same boundary automasking function from the brush code. Now edges are preserved and the relax filter works as it should. Reviewed By: jbakker Differential Revision: https://developer.blender.org/D7097
2020-03-12Fix T74659: Seaching for operator crashes BlenderAntonio Vazquez
The poll function was not checking the paint pointer.
2020-03-11Fix T74315: Cloth brush breaks orbit around selectionJacques Lucke
Reviewers: pablodp606 Differential Revision: https://developer.blender.org/D7095
2020-03-11Cleanup: clang-formatCampbell Barton
2020-03-10Fix rendering artifacts when changing Face Sets visibilityPablo Dobarro
All sculpt operators and brushes need to use ID_RECALC_SHADING even when PBVH rendering is not used.
2020-03-10Fix T74425: Cannot texture paint an images sequence anymorePhilipp Oeser
Caused by the introduction of UDIM (rBc30d6571bb47). We need to make sure the tiles ImageUser is set up correctly [especially the framenr], otherwise BKE_image_acquire_ibuf() and friends will fail to find the correct ImBuf. Also instead of initializing a minimal BKE_imageuser_default, now use an appropriate ImageUser if avaliable and pass this around (instead of just the tile_number). 2D painting can reuse the Image Editor ImageUser, for 3D painting we still rely on a default ImageUser in most places, but at least set the framenr correctly]. This also fixes crashes when doing image operations such as inverting or resizing on images in a sequence in the Image Editor. This also fixes color sampling (S) from the 3DView going wrong for image sequences (would fallback to OpenGL sampling because an ImBuf could not be found). Maniphest Tasks: T74425 Differential Revision: https://developer.blender.org/D7022
2020-03-09Fix T74354: Avoid division by 0 when calculating hardnessPablo Dobarro
I could not reproduce the issue, but it looks like it was produced by this division by 0. In any case, the code here was wrong. Reviewed By: jbakker Maniphest Tasks: T74354 Differential Revision: https://developer.blender.org/D6987
2020-03-09Sculpt: Edge AutomaskingPablo Dobarro
This automasking option protects the open boundary edges of the mesh from the brush deformation. This is needed to sculpt cloths and it works nicely with the cloth brush. It has a Propagation Steps property that controls the falloff of the mask from the edge. Limitations: - The automask is recalculated at the beginning of each stroke, creating a little bit of lag in high poly meshes, but it is not necessary. This can be fixed in the future by caching the edge distances, increasing a little bit the complexity of the code. - The boundary vertex detection in meshes is not ideal and it fails with triangulated geometry, but it is the same as in the smooth brush. After fixing this, we should refactor the smooth brush to use the API and let the automasking option manually control the affected vertices. - It does not work in Multires (it needs to be implemented in the API). The smooth brush in Multires is also not making boundary vertices. - The falloff has a visible line artifact on grid patterns. We can smooth the final automasking factors several iterations, but it will make the initialization much slower. This can also be added in the future if we decided to cache the distances. Reviewed By: jbakker Differential Revision: https://developer.blender.org/D6705
2020-03-09Face Sets: Use white color for a default Face Set to enable the overlayPablo Dobarro
This introduces a variable to store a face set ID which is going to be rendered white. When initializing a mesh or randomizing the colors, this variable gets updated to always render a white face set. This way the face set overlay can be enabled without adding colors to the mesh if face sets are not in use. After creating the first face set, new colors are generated randomly like usual. The face set stored as default does not have any special meaning for tools or brushes, it just affects the rendering color. Reviewed By: brecht Differential Revision: https://developer.blender.org/D7035
2020-03-09Face Sets: Add relax support to Mesh Filter and Draw Face SetsPablo Dobarro
This enables a relax operation that works only on face sets boundaries, which smooths the jagged edges that are produced when painting or expanding face sets by sliding the topology without affecting the shape of the mesh. This has many uses in hard surface sculpting for things like sculpting panels or smoothing surfaces. It can also help when working with remeshed topology as it makes the face sets looks better and more organized if needed. The operation is implemented as an Shift smooth in the Draw Face sets tool, similar to the Slide/Relax tool. The same operation is also available in the mesh filter to smooth all the face sets boundaries uniformly or to smooth the face set under the cursor with the Use Face Sets option. Reviewed By: brecht Differential Revision: https://developer.blender.org/D7034
2020-03-09Fix Cloth Brush not working with automaskingPablo Dobarro
The cloth brush was not using the automasking values when calculating the mask value on each vertex. Reviewed By: brecht Differential Revision: https://developer.blender.org/D7083
2020-03-09Fix T74499: Add visibility checks to Face Sets creation operationsPablo Dobarro
Create face sets by visibility needs to check if all face sets of a vertex are visible to set the new face set. I renamed the functions to make this more cleare in the API. I also added a visibility check when creating by mask to avoid modifying hidden areas. Reviewed By: brecht Maniphest Tasks: T74499 Differential Revision: https://developer.blender.org/D7048
2020-03-09Sculpt: Remove hardcoded hardness from Clay brushPablo Dobarro
Hardness is now a property implemented for all brushes, so this is no longer needed. Reviewed By: brecht Differential Revision: https://developer.blender.org/D7078
2020-03-09Fix T74492: Reset Face Set data when cancelling the expand operatorPablo Dobarro
The operator was resetting the mask data when cancelling instead of the face set data, so it was crashing because mask data was not available when starting the operator in expand face set mode. Reviewed By: brecht Maniphest Tasks: T74492 Differential Revision: https://developer.blender.org/D7043
2020-03-09GPencil: Refactor of Draw Engine, Vertex Paint and all internal functionsAntonio Vazquez
This commit is a full refactor of the grease pencil modules including Draw Engine, Modifiers, VFX, depsgraph update, improvements in operators and conversion of Sculpt and Weight paint tools to real brushes. Also, a huge code cleanup has been done at all levels. Thanks to @fclem for his work and yo @pepeland and @mendio for the testing and help in the development. Differential Revision: https://developer.blender.org/D6293
2020-03-09Cleanup: Replace ABS/SQUARE/CUBE with function callsSergey Sharybin
While it might be handy to have type-less functionality which is similar to how C++ math is implemented it can not be easily achieved with just preprocessor in a way which does not have side-effects on wrong usage. There macros where often used on a non-trivial expression, and there was at least one usage where it was causing an actual side effect/bug on Windows (see change around square_f(sh[index++]) in studiolight.c). For such cases it is handy to have a function which is guaranteed to have zero side-effects. The motivation behind actually removing the macros is that there is already a way to do similar calculation. Also, not having such macros is a way to guarantee that its usage is not changed in a way which have side-effects and that it's not used as an inspiration for cases where it should not be used. Differential Revision: https://developer.blender.org/D7051
2020-03-07Fix T74513: Wrong naming in some Face Set comments and operatorsPablo Dobarro
Missing changes from one of the renamings of the initial face sets patch. Reviewed By: brecht Maniphest Tasks: T74513 Differential Revision: https://developer.blender.org/D7054