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
path: root/source
AgeCommit message (Collapse)Author
2022-01-24Cleanup: clang-formatCampbell Barton
2022-01-24Geometry Nodes: Extrude Mesh NodeHans Goudey
This patch introduces an extrude node with three modes. The vertex mode is quite simple, and just attaches new edges to the selected vertices. The edge mode attaches new faces to the selected edges. The faces mode extrudes patches of selected faces, or each selected face individually, depending on the "Individual" boolean input. The default value of the "Offset" input is the mesh's normals, which can be scaled with the "Offset Scale" input. **Attribute Propagation** Attributes are transferred to the new elements with specific rules. Attributes will never change domains for interpolations. Generally boolean attributes are propagated with "or", meaning any connected "true" value that is mixed in for other types will cause the new value to be "true" as well. The `"id"` attribute does not have any special handling currently. Vertex Mode - Vertex: Copied values of selected vertices. - Edge: Averaged values of selected edges. For booleans, edges are selected if any connected edges are selected. Edge Mode - Vertex: Copied values of extruded vertices. - Connecting edges (vertical): Average values of connected extruded edges. For booleans, the edges are selected if any connected extruded edges are selected. - Duplicate edges: Copied values of selected edges. - Face: Averaged values of all faces connected to the selected edge. For booleans, faces are selected if any connected original faces are selected. - Corner: Averaged values of corresponding corners in all faces connected to selected edges. For booleans, corners are selected if one of those corners are selected. Face Mode - Vertex: Copied values of extruded vertices. - Connecting edges (vertical): Average values of connected selected edges, not including the edges "on top" of extruded regions. For booleans, edges are selected when any connected extruded edges were selected. - Duplicate edges: Copied values of extruded edges. - Face: Copied values of the corresponding selected faces. - Corner: Copied values of corresponding corners in selected faces. Individual Face Mode - Vertex: Copied values of extruded vertices. - Connecting edges (vertical): Average values of the two neighboring edges on each extruded face. For booleans, edges are selected when at least one neighbor on the extruded face was selected. - Duplicate edges: Copied values of extruded edges. - Face: Copied values of the corresponding selected faces. - Corner: Copied values of corresponding corners in selected faces. **Differences from edit mode** In face mode (non-individual), the behavior can be different than the extrude tools in edit mode-- this node doesn't handle keeping the back- faces around in the cases that the edit mode tools do. The planned "Solidify" node will handle that use case instead. Keeping this node simpler and faster is preferable at this point, especially because that sort of "smart" behavior is not that predictable and makes less sense in a procedural context. In the future, an "Even Offset" option could be added to this node hopefully fairly simply. For now it is left out in order to keep the patch simpler. **Implementation** For the implementation, the `Mesh` data structure is used directly rather than converting to `BMesh` and back like D12224. This optimizes for large extrusion operations rather than many sequential extrusions. While this is potentially more verbose, it has some important benefits: First, there is no conversion to and from `BMesh`. The code only has to fill arrays and it can do that all at once, making each component of the algorithm much easier to optimize. It also makes the attribute interpolation more explicit, and likely faster. Only limited topology maps must be created in most cases. While there are some necessary loops and allocations with the size of the entire mesh, I tried to keep everything I could on the order of the size of the selection rather than the size of the mesh. In that respect, the individual faces mode is the best, since there is no topology information necessary, and the amount of work just depends on the size of the selection. Modifying an existing mesh instead of generating a new one was a bit of a toss-up, but has a few potential benefits: - Avoids manually copying over attribute data for original elements. - Avoids some overhead of creating a new mesh. - Can potentially take advantage of future ammortized mesh growth. This could be changed easily if it turns out to be the wrong choice. Differential Revision: https://developer.blender.org/D13709
2022-01-24Cleanup: Grammar: its self vs. itselfHans Goudey
2022-01-24Cleanup: spelling in commentsCampbell Barton
2022-01-24Cleanup: avoid positional struct initializationCampbell Barton
When moving to C++ field for initialization was removed. Favor assignments to field names as it reads better and avoids bugs if files are ever re-arranged as well as mistakes (see T94784). Note that the generated optimized output is identical with GCC11.
2022-01-23Geometry Nodes: Triangulate Node - Add Selection InputJohnny Matthews
This adds a selection field input to the node, faces that are selected and meet the minimum vertex count threshold will be triangulated. Differential Revision: https://developer.blender.org/D13804
2022-01-23Geometry Nodes: Relative Handle Position ModeJohnny Matthews
Add a boolean option to have the Curve Handle Position input node return the position of the handle relative to each point position. Differential Revision: https://developer.blender.org/D12947
2022-01-23Cleanup: separate function for Alembic edge crease readingKévin Dietrich
2022-01-23Cleanup: Improvements to mesh to bmesh conversionHans Goudey
- Use `Array` and `Span` instead of raw pointers. - Declare variables in smaller scope. - Use references instead of pointers.
2022-01-22Fix T94760: Crash building BMesh when opening fileHans Goudey
A large polygon in the file from the report caused `alloca` to exceed the maximum stack size, causing a crash. Instead of using `alloca`, use `blender::Array` with an inline buffer. Based on a patch by Germano Cavalcante (@mano-wii). Differential Revision: https://developer.blender.org/D13898
2022-01-22LineArt: Option to keep contour when using face mark filtering.YimingWu
When enabled, it will keep contour around the object instead of hide them by rule of face mark, so the object can always have full contour while filtering out some of the feature lines inside certain regions. Reviewed By: Antonio Vazquez (antoniov), Aleš Jelovčan (frogstomp) Differential Revision: https://developer.blender.org/D13847
2022-01-22LineArt: Back face cullingYimingWu
Option to discard back faced triangles, this speeds up calculation especially for when you only want to show visible feature lines. Reviewed By: Antonio Vazquez (antoniov), Aleš Jelovčan (frogstomp) Differential Revision: https://developer.blender.org/D13848
2022-01-22LineArt: Noise tolerant chaining.YimingWu
Instead of splitting it at each occlusion change, it tolerates short segments of "zig-zag" occlusion incoherence and doesn't split the chain at these points, thus creating a much smoother result. Reviewed By: Antonio Vazquez (antoniov), Aleš Jelovčan (frogstomp) Differential Revision: https://developer.blender.org/D13851
2022-01-22BMesh: merge normal and tessellation calculation on undoCampbell Barton
This gives a modest speedup as calculating tessellation and face normals at the same time can be more efficiently multi-threaded. Also avoids calculating face normals twice, oversight in d590e223daf6e20d462f2b197d32606d69873051.
2022-01-22Fix linking in debug modeCampbell Barton
b7878a4d457a59d4a42f8ac0f428ea336562d75a seems to have caused linking issues building debug mode on Linux. Using extern "C" resolves.
2022-01-22Cleanup: Move bmesh_mesh_convert.c to C++Hans Goudey
Useful for a simpler bug fix, code clarity, and easier possible optimizations in the future.
2022-01-22Fix T13879 new OBJ exporter not saving files with Unicode characters.Aras Pranckevicius
Need to use BLI_fopen instead of fopen.
2022-01-22Cleanup: Use references, const variablesHans Goudey
2022-01-22Curves: Improve accuracy and clarity of NURBS knots calculationLaurynas Duburas
This commit improves NURBS knot generation by adding proper support for the combination of the Bezier and cyclic options. In other cases the resulting knot doesn't change. This cyclic Bezier knot is used to create accurate accurate "Nurbs Circle", "Nurbs Cylinder" primitives. "Nurbs Sphere" and "Nurbs Torus" primitives are also improved by tweaking the spin operator. The knot vector in 3rd order NURBS curve with Bezier option turned on (without cyclic) is changed in comparison to previous calculations, although it doesn't change the curve shape itself. The accuracy of the of NURBS circle is fixed, which can be checked by comparing with mesh circle. Tessellation spacing differences in circular NURBS is also fixed, which is observable with the NURBS cylinder and sphere primitives. These were causing seam-like effects. This commit contains comments from Piotr Makal (@pmakal). Differential Revision: https://developer.blender.org/D11664
2022-01-22Fix T94974: Invalid normals in edit modeHans Goudey
Normal layers currently aren't stored in the undo step mesh storage, since they are not stored in files at all. However, the edit mesh expects normals to be fully calculated, and does not keep track of a dirty state. This patch updates the normals in the BMesh created by loading an undo step. Another option would be calculating the normals on the undo mesh first, which might be better if Mesh normal calculation is faster than BMesh calculation, but the preferred method to access vertex normals fails in this case, because the mesh runtime mutexes are not initialized for undo-state meshes. Differential Revision: https://developer.blender.org/D13859
2022-01-22Fix T94967: Sculpt mode crashes with missing normalsHans Goudey
From an error in rBcfa53e0fbeed, the vertex normals in `SculptSession` seem to be used, but in the case when no "pbvh" is used, the value of the pointer is never assigned. Normals were not generally dirty before this "ensure" function with regular sculpting operations, so this addition shouldn't have any cost. Differential Revision: https://developer.blender.org/D13854
2022-01-22Fix T95097: Attribute Capture node UI inconsistencyHans Goudey
All other nodes with data type and domain choices have the domain below the data type. Generally that order makes sense, because it's consistent with nodes that have no domain drop-down.
2022-01-22Fix: Applying object transform can create normal layersHans Goudey
Because this operator is used on original objects, it's best to tag the normals dirty instead of explicitly calculating them, to avoid unnecessarily storing normal layers on an original object (since they might have to be recalculated during evaluation anyway). There may be other places this change is helpful, but being conservative is likely better for now. Related to T95125
2022-01-21Fix std::optional value() build error on older macOS SDKBrecht Van Lommel
No longer happens on the buildbot, but for users building with an older Xcode we still need to avoid using value().
2022-01-21Distribute Points on Faces: Fix missing minimum value for density socketAaron Carlisle
Negative number density is not a part of this reality.
2022-01-21Fix new OBJ exporter to handle instancing.Howard Trickey
The new OBJ exporter did not handle object instances. The fix is to use a dependency graph iterator, asking for instances. Unfortunately that iterator makes a temporary copy of instance objects that does not persist past the iteration, but we need to save all the objects and meshes to write later, so the Object has to be copied now. This changed some unit tests. Even though the tests don't have instancing, the iterator also picks up some Text objects as Mesh ones (which is a good thing), resulting in two more objects in the all_objects.obj file output.
2022-01-21Cmake/Deps: Freetype 2.11.0 / brotli 1.0.9Ray Molenkamp
The UI team requested adding woff2 support to freetype. this required a new dependency brotli. This changes adds brotili to the builder and bumps freetype to version 2.11.0 As freetype now depends on other libraries, for consistency all use of ${FREETYPE_LIBRARY} in cmake has been updated to use ${FREETYPE_LIBRARIES} adjustments have been made in the windows platform file, all other platforms use cmake's FindFreeType.cmake which already sets this variable. reviewed by: brecht Differential Revision: https://developer.blender.org/D13448
2022-01-21UI: Clarify Active Movie Clip tooltipAaron Carlisle
See T92299
2022-01-21Geometry Nodes: new Scale Elements nodesJacques Lucke
This node can scale individual edges and faces. When multiple selected faces/edges share the same vertices, they are scaled together. The center and scaling factor is averaged in this case. For some examples see D13757. Differential Revision: https://developer.blender.org/D13757
2022-01-21Geometry Nodes: Flip Faces NodeAlan Babu
Currently there is no way to flip normals in geometry nodes. This node makes that possible by flipping the winding order of selected faces. The node is purposely not called "Flip Normals", because normals are derived data, changing them is only a side effect. The real change is that the vertex and edge indices in the face corners of every selected polygon are reversed, and face corner attribute data is reversed. While there are existing utilities to flip a polygon and its custom data, this node aims to process an attribute's data together instead of processing all attributes separately for each index. Differential Revision: https://developer.blender.org/D13809
2022-01-21Geometry Nodes: Mesh Island Node - Rename Index SocketJohnny Matthews
Rename 'Index' Socket to 'Island Index' to make it more consistent with 'Island Count' Differential Revision: https://developer.blender.org/D13893
2022-01-21Geometry Nodes: New Output for Number of Mesh IslandsJohnny Matthews
Adds a second output to the Mesh Islands node that shows the total number of islands as a field. Differential Revision: https://developer.blender.org/D13700
2022-01-21Fix error in previous commit.Jeroen Bakker
2022-01-21GPU: Disable create info for 2d image overlay merge.Jeroen Bakker
This shader needs to use the same interface as the OCIO shader. On Linux and Windows this seems to be the case. On MacOS however there is a mismatch that makes the overlay texture to be completely black when switching to workbench in the Shader workspace. This is just a temporarily work-around as this should be solved. Due to the poor GPU debugging facilities on Mac we haven't been able to pin-point the root cause.
2022-01-21Attributes: add operator to convert generic attributes to other typesJacques Lucke
Editing of generic attributes on the original objects in edit modes is still very limited. However, when applying a geometry nodes modifier that generates new attributes. These attributes will show up in the Attributes panel. Currently, our exporters are not capable of exporting generic attributes. Therefore, for the time being, a work around is to apply geometry nodes and then convert a generic attribute to a task specific attribute like a uv map, vertex group or vertex color layer. Once more parts of Blender support generic attributes, this will become less important. Currently, only meshes are supported by the operator. However, it would be relatively easy to extend it to other geometry types. Differential Revision: https://developer.blender.org/D13838
2022-01-21.obj: simplify templates in FileHandler, add commentsAnkit Meel
- Remove redundant template from `FormattingSyntax`. - Replace one enable_if with static assert for readability - Add comments No functional change expected. Reviewed by: jacqueslucke Differential Revision: https://developer.blender.org/D13882
2022-01-21GPU: Remove unused resources in shader create info.Jeroen Bakker
When adding the shader create infos some additional resources where defined that doesn't exist in the shader itself. This commit will remove them.
2022-01-21Cleanup: struct/class mismatch.Jeroen Bakker
2022-01-21UI: exclude "Undo History" from menu searchCampbell Barton
Undo history was showing in menu search since converting undo history to a menu from a popup, see: 0e1bb232e68ce71f4c3dd331ed6331665238a065.
2022-01-21Fix T95078: Setting digits as modifier in keymap doesn't workCampbell Barton
Allow any non-modifier keyboard events to be used. Note that the existing check for >= EVT_AKEY allowed NDOF and other non-keyboard events (including modifiers, which didn't work).
2022-01-21Cleanup: event type values & definesCampbell Barton
- Use defines instead of magic numbers for F-Key & NDOF range checks. - Use explicit values for NDOF event types. - Minor clarification to doc-strings. - Use doxy-sections.
2022-01-21Fix: Node link drag search doesn't list shader socketsHans Goudey
Shader sockets were only available when dragging from inputs.
2022-01-21Cleanup: Resolve unused variable warning, make function staticHans Goudey
2022-01-21Fix Python API docs build errorHans Goudey
There is probably a better solution that's possible, but the few other things I tried didn't work, and the build error should be resolved for the buildbots. This is similar to the "breaks" in the namespace for functions declared in `ED_node.h`.
2022-01-20Fix T93520: wrong subframe motion blur with rigid body physicsBrecht Van Lommel
The code here was using velocity based interpolation copied from particles. However there is no velocity cached in the rigid body point cache so the results were non-sensical.
2022-01-20Geometry Nodes: Curve Primitive ArcCharlie Jolly
This adds a new curve primitive to generate arcs. Radius mode (default): Generates a fixed radius arc on XY plane with controls for Angle, Sweep and Invert. Points mode: Generates a three point curve arc from Start to End via Middle with an Angle Offset and option to invert the arc. There are also outputs for arc center, radius and normal direction relative to the Z-axis. This patch is based on previous patches D11713 and D13100 from @guitargeek. Thank you. Reviewed By: HooglyBoogly Differential Revision: https://developer.blender.org/D13640
2022-01-20Fix continuous stream of thumbnail notifiers after redoJulian Eisel
This fixes a similar issue as the previous commit, but this time the continuous notifiers would be sent after redoing. E.g. after moving an object, and then modifying the transform in the "Adjust Last Operation" panel.
2022-01-20Fix file/asset thumbnails causing constant stream of notifiersJulian Eisel
The thumbnail caching continuously sends `ND_SPACE_FILE_PREVIEW` notifiers via a timer. But this timer was never ended properly after thumbnails are fully loaded into the cache. Wouldn't actually cause a refresh or redraw, send and process the notifiers. I already tried to avoid this for the asset view template, but apparently that wasn't working correctly. For the File/Asset Browser I never applied that fix to avoid possible regressions before the release.
2022-01-20Cleanup: Move node editor files to proper namespaceHans Goudey
This commit moves code in all node editor files to the `blender::ed::space_node` namespace, except for C API functions defined in `ED_node.h`, which can only be moved once all areas calling them are moved to C++. The change is fairly straightforward, I just moved a couple of "ED_" code blocks around to make the namespace more contiguous, and there's the method for adding a pointer to a struct in a C++ namespace in DNA. Differential Revision: https://developer.blender.org/D13871
2022-01-20Fix T94726: crash with GPU subdivision on a custom bone shapeKévin Dietrich
Custom bones are drawn by instancing the GPUBatch of the base object. To access the mesh and its GPUBatch, `BKE_object_get_evaluated_mesh` was used. However, since GPU subdivision support, this will return a subdivision wrapper which will never be drawn, and thus will have an invalid batch, which caused the crash. `BKE_object_get_evaluated_mesh_no_subsurf` should be used instead, to return the mesh that will be drawn, and have the subdivision evaluated on the GPU. Note that the rest of the draw code is already using this function.