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
2021-12-07Revert moving all shader nodes to c++Jacques Lucke
This reverts to following commits: * rB5cad004d716da02f511bd34983ac7da820308676 * rB97e3a2d935ba9b21b127eda7ca104d4bcf4e48bd * rBf60b95b5320f8d6abe6a629fe8fc4f1b94d0d91c * rB0bd3cad04edf4bf9b9d3b1353f955534aa5e6740 * rBf72cc47d8edf849af98e196f721022bacf86a5e7 * rB3f7014ecc9d523997062eadd62888af5fc70a2b6 * rB0578921063fbb081239439062215f2538a31af4b * rBc20098e6ec6adee874a12e510aa4a56d89f92838 * rBd5efda72f501ad95679d7ac554086a1fb18c1ac0 The original move to c++ that the other commits depended upon had some issues that should be fixed before committing it again. The issues were reported in T93797, T93809 and T93798. We should also find a better rule for not using c-style casts going forward, although that wouldn't have been reason enough to revert the commits. Introducing something like a `MEM_new<T>` and `MEM_delete<T>` function might help with the the most common case of casting the return type of `MEM_malloc`. Going forward, I recommend first committing the changes that don't require converting files to c++. Then convert the shading node files in smaller chunks. Especially don't mix fairly low risk changes like moving some simple nodes, with higher risk changes.
2021-12-07Fix T93797, T93809: Crash/undefined-behavior when opening demo fileJulian Eisel
Error in d5efda72f501. Was changing an iteration that would free items to an iterator that is not safe for use in such cases. There still seem to be significant issues with the rendering, but that's a separate issue to be fixed.
2021-12-07Fix memory leak when loading large asset librariesJulian Eisel
2021-12-07Fix crash when switching back from render preview.Jeroen Bakker
Issue is that external engine uses the gpu info. but overwrote the instance data. The draw manager would then detect instance data and required the engine type to have a instance free callback. The solution is to save some space in the engine data to hold an empty and unused instance_data attribute to comply with `ViewportEngineData` struct.
2021-12-07DrawManager: Engine Instance Data.Jeroen Bakker
In the original design draw engines had to copy with a limitation that they were not allowed to reuse complex data structures between drawing calls. Data that could be reused were limited to: - GPUFramebuffers - GPUTextures - Memory that could be removed calling MEM_freeN (storage list) - DRWPass This is fine when the storage list contains arrays or structs but when more complex data types (vectors, maps) etc wasn't possible. This patch adds instance_data that can be reused between drawing calls. The instance_data is controlled by the draw engine and doesn't need to be limited as described above. When an engines stores instance_data it must implement the `DrawEngineType.instance_free` callback to free the data. The patch originates from eevee rewrite. But was added to master as the image engine rewrite also has a need for it. Reviewed By: fclem Differential Revision: https://developer.blender.org/D13425
2021-12-07Cleanup: Use rcti marking dirty regions when texture painting.Jeroen Bakker
Dirty regions when painting are not using rcti. Meaning less understandable code. Found issue when refactoring the image_gpu partial update. In a future change gpu partial update API will be using rcti also what makes the code even cleaner. Reviewed By: campbellbarton Differential Revision: https://developer.blender.org/D13260
2021-12-07Cleanup: note that functions in BKE_node.h aren't part of blenkernelCampbell Barton
2021-12-07Cleanup: remove BKE_ptcache_removeCampbell Barton
No longer needed as the temporary directory is cleared on exit.
2021-12-07Cleanup: sort DNA renamingCampbell Barton
Add note at the beginning & end so it's not overlooked.
2021-12-07Cleanup: clang-formatCampbell Barton
2021-12-07Cleanup: clarify source/destination args for BKE_spacedata_copylistCampbell Barton
2021-12-07Cleanup: remove incorrect/unhelpful commentsCampbell Barton
2021-12-07Cleanup: replace int with bool typeCampbell Barton
2021-12-07Cleanup: move public doc-strings into headers for 'blenkernel'Campbell Barton
- Added space below non doc-string comments to make it clear these aren't comments for the symbols directly below them. - Use doxy sections for some headers. - Minor improvements to doc-strings. Ref T92709
2021-12-07Cleanup: Fix various source typosluzpaz
This is a continuation of D13462 to clean up source typos. Differential Revision: https://developer.blender.org/D13471
2021-12-07Cleanup: clang formatAaron Carlisle
2021-12-07Shader Nodes: Migrate shader category to new node socket declaration APIAaron Carlisle
No functional changes, tests passed and I double checked the nodes by hand.
2021-12-07Fix: Remove line from common invokeChristoph Lendenfeld
The line that sets the factor_prop in graph_slider_ops.c has been left in the common invoke function by accident. Reviewed by: Sybren A. Stüvel Differential Revision: https://developer.blender.org/D13477 Ref: D13477
2021-12-07Cleanup: renames in graph_slider_opsChristoph Lendenfeld
rename percentage_prop to factor_prop rename remove_ratio to factor remove "graphkeys" prefix from functions Reviewed by: Sybren A. Stüvel Differential Revision: https://developer.blender.org/D13476 Ref: D13476
2021-12-07Cleanup: Use C++ types for multi input socket sortingHans Goudey
The algorithm used is still quite inefficient, but at least the code is easier to read and a little bit simpler now.
2021-12-07Cleanup: Remove unused includesHans Goudey
2021-12-07Cleanup: Remove unused node flagHans Goudey
2021-12-07Cleanup: Remove unnecessary generic includes from headersHans Goudey
2021-12-06Fix: Compile error in field inputHans Goudey
Instead of essentially hashing a bool, just use a ternary operator. Differential Revision: https://developer.blender.org/D13494
2021-12-06macOS: Fix build error in hash functionsAnkit Meel
Remove unneeded recent static_cast attempt. Reviewed By: HooglyBoogly Differential Revision: https://developer.blender.org/D13492
2021-12-06Shader Nodes: Split each node into own fileAaron Carlisle
This improves both code finding, for example "color ramp" now has its own file. And now each node has its own namespace so function names can be simplified similar to rBfab39440e94 This commit also makes all file names use snake case instead of camel case. Reviewed By: HooglyBoogly Differential Revision: https://developer.blender.org/D13482
2021-12-06Cleanup: Fix warnings about copied Map loop variablesHans Goudey
The `Map::items()` iterator does not return references.
2021-12-06Fix: Attempt to fix build error on macOSHans Goudey
2021-12-06Nodes: Add function to set compact socket flag for vectorsAaron Carlisle
This flag is currently only used for vector sockets so the function is limited to the vector builder. The flag is only used by two shader nodes at the moment and this is needed to port them over to the new socket declaration API. Reviewed By: JacquesLucke Differential Revision: https://developer.blender.org/D13490
2021-12-06Geometry Nodes: reduce code duplication with new GeometyrFieldInputJacques Lucke
Most of our field inputs are currently specific to geometry. This patch introduces a new `GeometryFieldInput` that reduces the overhead of adding new geometry field input. Differential Revision: https://developer.blender.org/D13489
2021-12-06Geometry Nodes: 4 Field Inputs for Mesh Topology DataJohnny Matthews
Creates 4 new nodes which provide topology information for the mesh. Values are interpolated from the primary domain in each case using basic attribute interpolation. Vertex Neighbors - Vertex Count - Face Count Face Neighbors - Vertex Count - Neighboring Face Count Edge Vertices - Vertex Index 1 - Vertex Index 2 - Position 1 - Position 2 Face Area - Face Area Differential Revision: https://developer.blender.org/D13343
2021-12-06Fix T93521: Single point NURBS crash in resample nodeHans Goudey
The resample node didn't handle the case of when a spline didn't have any evaluated points. For poly and Bezier splines we should never hit this case, but it is expected when the number of NURBS control points is smaller than its order, so we have to handle the case here. It's not that obvious what to do in this case, there are a few options: - Remove the bad splines from the result - Generate empty splines for those inputs - Skip resampling the bad splines, copy them to the result - Arbitrarily generate single point splines I chose option three, just skipping the "bad" splines. Since the node already has a selection input, this can be described by just extending that. "Splines with no evaluated points are implicitly deselected." The first option would probably be valid too though. Differential Revision: https://developer.blender.org/D13434
2021-12-06Nodes: Add Shader Socket to new decleration APIAaron Carlisle
This commit adds the shader socket type to the new socket builder api. As a test, this commit also converts the Add Shader node to the new API Reviewed By: JacquesLucke Differential Revision: https://developer.blender.org/D13485
2021-12-06Shader Nodes: Unity BuildAaron Carlisle
- Create a new `bf_nodes_shader` library - Enable unity builds for `bf_nodes_shader`, gives abount a 2.7x speed up for compile times Reviewed By: JacquesLucke Differential Revision: https://developer.blender.org/D13484
2021-12-06Disable asset indexing in the Asset ListSybren A. Stüvel
Asset indexing should be disabled, but this was overlooked in the asset list (used for the pose library in the 3D View).
2021-12-06Asset Indexer: use fixed-length string for ID codeSybren A. Stüvel
Use fixed-length string to convert `char[2]` to `std::string`. Otherwise `strlen()` is called, which is problematic as the `char[2]` is not zero-terminated.
2021-12-06Cleanup: remove unnecessary extern template implementationsJacques Lucke
This technique isn't really necessary anymore, because unity builds avoid instantiating the same template too many times already.
2021-12-06Fix T93314: Thumbnails not drawn with default scaleRichard Antalik
Decrease threshold for drawing thumbnails. This was unintended change in daaa43232d34 that was overlooked.
2021-12-06VSE: Fix strip with mask modifier not blendingRichard Antalik
Set `ibuf->planes` to `R_IMF_PLANES_RGBA` because mask modifier adds transparent areas to image.
2021-12-06Fix T93707: Dragging the tweaked NLA strip causes crashSybren A. Stüvel
Earlier code assumed that the active strip was on the active track. This commit detects when this assumption doesn't hold, and adds a more thorough search of the active strip.
2021-12-06Fix T93611: Curve modifier crash in editmode in certain situationsPhilipp Oeser
Caused by {rB3b6ee8cee708} Above commit was trying to get the vertexgroup from the mesh that is passed into `deformVertsEM` (but that can be NULL). When can it be NULL, when is is non-NULL? `editbmesh_calc_modifiers` only passes in a non-NULL mesh to `deformVertsEM` under certain conditions: - a non-deform-only modifier is handled currently - a non-deform-only modifier preceeds the current modifier - a deform-only modifier preceeds the current modifier (and the current one depends on normals) So the passed-in mesh cannot be relied on, now get the vertex group from the context object data (like it was before the culprit commit). Related commit: rB8f22feefbc20 Maniphest Tasks: T93611 Differential Revision: https://developer.blender.org/D13487
2021-12-06Cleanup: remove some temp dev asserts in new link/append code.Bastien Montagne
No longer needed now that all code uses that new BKE_blendfile_link_append module, and that instantiation code in BLO_readfile has been removed.
2021-12-06Fix T93388: dropping object on grid in orthogonal view misses the floor planeGermano Cavalcante
`ED_view3d_win_to_3d_on_plane` does not use the `clip_start` and `clip_end` values of the scene, so the `do_clip` option can be misleading especially in the orthographic view where the `clip_start` is negative. For now, don't use the `do_clip` option in orthographic view.
2021-12-06Fix T93732: Snap Cursor not working after changing Add Object settingsGermano Cavalcante
`g_data_intern.state_default.gzgrp_type` is a very specific member and cannot be set to default.
2021-12-06Shader Nodes: Declare nodes in their own namespaceAaron Carlisle
Follow up on rB1df8abff257030ba79bc23dc321f35494f4d91c5 This puts all static functions in geometry node files into a new namespace. This allows using unity build which can improve compile times significantly - The namespace name is derived from the file name. That makes it possible to write some tooling that checks the names later on. The filename extension (cc) is added to the namespace name as well. This also possibly simplifies tooling but also makes it more obvious that this namespace is specific to a file. - In the register function of every node, I added a namespace alias namespace `file_ns = blender::nodes::node_shader_*_cc`;. This avoids some duplication of the file name and may also simplify tooling, because this line is easy to detect. The name `file_ns` stands for "file namespace" and also indicates that this namespace corresponds to the current file. In the future some nodes will be split up to separate files and given their own namespace This will allow function names to be simplified similar to rBfab39440e94 Reviewed By: HooglyBoogly Differential Revision: https://developer.blender.org/D13480
2021-12-06Cleanup: Remove unused next and prev pointers in bNodeTypeHans Goudey
2021-12-06Cleanup: Remove unnecesary node type draw callbackHans Goudey
As a followup to 338c1060d5d7, apply the same change to the node drawing callback. This helps to simplify code when the complexity of a callback isn't necessary right now.
2021-12-06Cleanup: Remove unnecessary node type callbacks for drawingHans Goudey
Currently there are a few callbacks on `bNodeType` that do the same thing for every node type except reroutes and frame nodes. Having a callback for basic things complicates code and makes it harder to understand, and reroutes and frames are special cases in larger way. Arguably frame nodes shouldn't even be drawn like regular nodes, given that it adds a case of O(N^2) looping through all nodes. "Unrolling" the callbacks makes it easier to see what's happening, and therefore easier to optimize. Differential Revision: https://developer.blender.org/D13463
2021-12-06Cleanup: clang-tidy: modernize-redundant-void-argAaron Carlisle
This change follows up on recent c --> c++ conversions
2021-12-05Cleanup: Add missing includeAaron Carlisle
Fixes compilation errors after rBd5efda72f501 Re sorted some includes.