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-11-08Fix T102312: anchored brush texture overlay draws in wrong placePhilipp Oeser
Rotation and scale was done around the wrong center (always around mouse position) in paint_draw_tex_overlay [on the other hand, paint_draw_cursor_overlay already got the center right]. Now make the center dependent on UnifiedPaintSettings "draw_anchored". Maniphest Tasks: T102312 Differential Revision: https://developer.blender.org/D16418
2022-11-01Refactor: Rename Object->obmat to Object->object_to_worldSergey Sharybin
Motivation is to disambiguate on the naming level what the matrix actually means. It is very easy to understand the meaning backwards, especially since in Python the name goes the opposite way (it is called `world_matrix` in the Python API). It is important to disambiguate the naming without making developers to look into the comment in the header file (which is also not super clear either). Additionally, more clear naming facilitates the unit verification (or, in this case, space validation) when reading an expression. This patch calls the matrix `object_to_world` which makes it clear from the local code what is it exactly going on. This is only done on DNA level, and a lot of local variables still follow the old naming. A DNA rename is setup in a way that there is no change on the file level, so there should be no regressions at all. The possibility is to add `_matrix` or `_mat` suffix to the name to make it explicit that it is a matrix. Although, not sure if it really helps the readability, or is it something redundant. Differential Revision: https://developer.blender.org/D16328
2022-10-07Cleanup: redundant parenthesisCampbell Barton
2022-10-04Cleanup: remove unnecessary includes from sculpt_paintCampbell Barton
2022-09-05GPU: convert 'GPU_SHADER_2D_IMAGE_COLOR' to 3DGermano Cavalcante
3D shaders work in both 2D and 3D viewports. This shader is a good candidate to be exposed in Python.
2022-09-05GPU: remove 'GPU_SHADER_2D_UNIFORM_COLOR'Germano Cavalcante
The only real difference between `GPU_SHADER_2D_UNIFORM_COLOR` and `GPU_SHADER_3D_UNIFORM_COLOR` is that in the vertex shader the 2D version uses `vec4(pos, 0.0, 1.0)` and the 3D version uses `vec4(pos, 1.0)`. But VBOs with 2D attributes work perfectly in shaders that use 3D attributes. Components not specified are filled with components from `vec4(0.0, 0.0, 0.0, 1.0)`. So there is no real benefit to having two different shader versions. This will simplify porting shaders to python as it will not be necessary to use a 3D and a 2D version of the shaders. In python the new name for '2D_UNIFORM_COLOR'' and '3D_UNIFORM_COLOR' is 'UNIFORM_COLOR', but the old names still work for backward compatibility. Differential Revision: https://developer.blender.org/D15836
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-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-06-09Cleanup: warningsCampbell Barton
2022-06-08Paint: Fix Image Editor Cursor Disappearing (T90120)Joseph Eagar
This patch fixes T90120. The fundamental problem is that 2d and the old 3d paint modes share a single Paint struct, ToolSettings->imapaint. This patch is a temporary fix until the new 3d paint mode (which has its own Paint struct) is released. The patch works by listening for `NC_SCENE|ND_MODE` inside `image_listener` in `space_image.c`. It does not use `ED_space_image_paint_update` since that requires a `bMain.` Instead it calls `paint_cursor_start` (which is promoted to `ED_paint_cursor_start`). `image_paint_poll` is also promoted to an `ED_` function. Reviewed By: Campbell Barton Differential Revision: https://developer.blender.org/D14946 Ref D14946
2022-04-02Cleanup: Further use of const for object bounding boxesHans Goudey
Also solves two warnings from the previous similar commit, f688e3cc3130e70e77f0bb0. The change to the grease pencil modifier is quite suspicious, but doesn't change the behavior, which was already broken.
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-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
2021-12-08Cleanup: move public doc-strings into headers for 'editors'Campbell Barton
Ref T92709
2021-10-20Cleanup: use elem macrosCampbell Barton
2021-06-24Cleanup: comment blocks, trailing space in commentsCampbell Barton
2021-06-01GPU: add 2D projection functionCampbell Barton
When projecting into screen space Z value isn't always needed. Add 2D projection functions, renaming them to avoid accidents happening again. - Add GPU_matrix_project_2fv - Add ED_view3d_project_v2 - Rename ED_view3d_project to ED_view3d_project_v3 - Use the 2D versions of these functions when the Z value isn't used.
2021-05-14Cleanup: clang-formatCampbell Barton
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-04-08Fix T87267: Texture Paint stencil texture not drawingPhilipp Oeser
Typo in {rBafcfc6eb0842}. Maniphest Tasks: T87267 Differential Revision: https://developer.blender.org/D10915
2021-03-28Fix T86060: Texture Paint clone tool misleading texture UICampbell Barton
For projection painting tools besides the `DRAW` tool: - Don't show the texture from viewport stencil drawing. - Don't show the texture panel. Based on D10564 by @lichtwerk with own changes.
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-17Cleanup: Abbreviate enums with 'UNSIGNED_' in the nameGermano Cavalcante
2021-02-05Cleanup: correct spelling in commentsCampbell Barton
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
2020-10-19Fix (unreported) crash when unlinking a brush from a tool.Bastien Montagne
Cursor drawing code was not checking for potential NULL pointers.
2020-10-01Sculpt: Cloth Simulation Dynamic area modePablo Dobarro
This simulation area mode moves the active area with the brush. When enabled, the cloth brush has no restrictions on stroke length, area or mesh vertex count. In order to work, this enables PBVH nodes dynamically for simulation as the stroke location moves and builds the constraints for new nodes during the stroke. When a node is not inside the simulated area, all the constraints that were created for it and vertex collisions are not computed. The simulation limits falloff areas and constraints tweaking control how the simulated and no simulated nodes blend. Reviewed By: sergey, zeddb Differential Revision: https://developer.blender.org/D8726
2020-09-21Various fixes in UI messages.Bastien Montagne
Along some other typos in comments or variable names.
2020-09-18Unify all XYZ symmetry options using Mesh SymmetryPablo Dobarro
This adds XYZ symmetry as a property of meshes and updates all modes to use the mesh symmetry by default to have a consistent tool behavior between all modes and when switching objects. Reviewed By: brecht, mano-wii, campbellbarton Maniphest Tasks: T79785 Differential Revision: https://developer.blender.org/D8587
2020-09-18Revert "Fix T79523 Paint Cursor: Wide line not supported on OSX"Clément Foucault
This commit caused regression on some sculpt paint cursors. A better approach is being worked on. This reverts commit 6ade522f277fb74d4691973b7bb55840300043a2.
2020-09-16Fix T79523 Paint Cursor: Wide line not supported on OSXClément Foucault
This replace the use of GPU_line_width by the specialized GPU_SHADER_3D_POLYLINE_UNIFORM_COLOR shader.
2020-09-12Fix remaining GL calls/type preventing from building due to recent cleanupClément Foucault
2020-09-09Cleanup: reduce variable scopeJacques Lucke
2020-09-07Fix T79914: Grab active vertex using wrong coordinatesPablo Dobarro
This was introduced in the first commit of the cloth brush. In order to support the cloth brush deformations with subsurf modifiers, the sculpt API was changed to return the deformed coordinates from the PBVH instead of the mesh coordinates. When using grab active vertex and rendering the original mesh wireframe it should render the undeformed mesh coordinates when available. Reviewed By: sergey Maniphest Tasks: T79914 Differential Revision: https://developer.blender.org/D8630
2020-09-05GPUTexture: Change texture creation APIClément Foucault
This is to modernize the API: - Add meaningful name to all textures (except DRW textures). - Remove unused err_out argument: only used for offscreen python. - Add mipmap count to creation functions for future changes. - Clarify the data usage in creation functions. This is a cleanup commit, there is no functional change. # Conflicts: # source/blender/gpu/GPU_texture.h
2020-09-05Cleanup: GPUTexture: Remove use of GPU_texture_create_nDClément Foucault
Use creation + update function instead.
2020-09-05GPUTexture: Remove bind to edit callsClément Foucault
This is going to be unecessary after the GPU opengl texture backend refactor. For now add a save/restore mechanism to leave the state untouched. Also remove some calls where the caller would bind to particular binding point and set the shader uniform.
2020-08-20GPUState: Use explicit depth test enumClément Foucault
2020-08-18GPUState: Remove gpuPushAttr/gpuPopAttrClément Foucault
And use manual save/restore mechanism. The stack method is not used so much to be considered useful.
2020-08-18Cleanup: GPUState: remove double GPU_blend callsClément Foucault
2020-08-18GPUState: GPU_blend final API renamingClément Foucault
We now use GPU_blend for enabling / disabling blending and explicitly set the blend equation.
2020-08-18Cleanup: GPUState: remove use of GPU_blend_set_funcClément Foucault
2020-08-18Cleanup: GPU: Move towards an explicit Blend stateClément Foucault
This make use of the GLStateStack functions for: - `GPU_blend()` - `GPU_blend_set_func()` - `GPU_blend_set_func_separate()` The goal is to unify them using an explicit state setting. This will remove the need to use obscure blend functions
2020-08-18Cleanup: Remove unused code in the Paint CursorPablo Dobarro
This code was left here after the refactor, it was doing nothing and it was causing an assert. Reviewed By: sergey Differential Revision: https://developer.blender.org/D8579
2020-08-13Sculpt: Boundary Brush Falloff Types and OffsetPablo Dobarro
This adds the boundary_falloff_type and boundary_offset to control how the falloff of the Boundary Brush is applied. Boundary Origin Offset is the same concept as the Pose Origin offset in the Pose Brush. It is a multiplier that adds extra length to the brush radius to locate the deformation pivot further from the boundary without affecting the falloff. The Falloff type includes Constant (previous default), brush radius, loop and loop and invert. Loop and Loop and Invert can be used to create deformation patterns in a mesh. Reviewed By: sergey Differential Revision: https://developer.blender.org/D8526
2020-08-11Cleanup: spellingCampbell Barton
2020-08-10Sculpt: Boundary BrushPablo Dobarro
This brush includes a set of deformation modes designed to deform and control the shape of the mesh boundaries, which are really hard to do with regular sculpt brushes (and even in edit mode). This is useful for creating cloth assets and hard surface base meshes. The brush detects the mesh boundary closest to the active vertex and propagates the deformation using the brush falloff into the mesh. It includes bend, expand, inflate, grab and twist deform modes. The main use cases of this brush are the Bend and Expand deformation modes, which depend on a grid topology to create the best results. In order to do further adjustments and tweaks to the result of these deformation modes, the brush also includes the Inflate, Grab and Twist deformation modes, which do not depend that much on the topology. Grab and Inflate are the same operation that is implemented in the Grab and Inflate tools, they are also available in the boundary brush as producing deformations with regular brushes in these areas is very hard to control. Even if this brush can produce deformations in triangle meshes and meshes with a non-regular quad grid, the more regular and clean the topology is, the better. Most of the assets this brush is intended to deform are always created from a cylindrical or plane quad grid, so it should be fine. Also, its algorithms can be improved in future versions to handle more corner cases and topology patterns. Reviewed By: sergey Differential Revision: https://developer.blender.org/D8356
2020-08-08Cleanup: use array syntax for sizeof with fixed valuesCampbell Barton
Also order sizeof(..) first to promote other values to size_t.
2020-08-07Fix failing assert when entering Texture Paint modeJulian Eisel
Was unbinding the shader twice.
2020-08-07Cleanup: pass arrays const where possibleCampbell Barton