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-01-05Cleanup: Use new socket builder APIAaron Carlisle
2022-01-05Nodes: Consistent link drag search for math and vector math nodesHans Goudey
Previously operations for the math node when connecting to outputs weren't added. It also used a different method to check whether the link would be valid.
2022-01-05Cleanup: Make shade node util header CPP onlyAaron Carlisle
Now that all shader nodes are converted to CPP this header can now be made into a CPP header.
2022-01-04Cleanup: Dont use relative includeAaron Carlisle
Instead let cmake determine the path for file includes
2022-01-04Cleanup: Nodes: Convert generic shader node files to c++Aaron Carlisle
Along with the general changes to CPP this commit does the following - Use static casts where possible - Use new CPP MEM library functions instead of cast - Use listbase macros where possible - Declare variables where initialized Reviewed By: HooglyBoogly, JacquesLucke Differential Revision: https://developer.blender.org/D13718
2022-01-04Fix T94546: Remove soft limit for the Clamp Node value socket.Thomas Dinges
2022-01-04Shader Nodes: Unity BuildAaron Carlisle
Enable unity builds for `bf_nodes_shader`, gives about a 2.7x speedup of total compile times when just building `bf_nodes_shader`. On my machine, this equates to saving about 30 seconds. Differential Revision: https://developer.blender.org/D13720
2022-01-04Cleanup: Move node storage macro inside file namespaceAaron Carlisle
Must have been a mistake in previous commits, this fix is needed to enable unity builds.
2022-01-04Cleanup: Remove bNodeType flag from base registration functionsAaron Carlisle
This flag is only used a few small cases, so instead of setting the flag for every node only set the required flag for the nodes that require it. Mostly the flag is used to set `ntype.flag = NODE_PREVIEW` For nodes that should have previews by default which is only some compositor nodes and some texture nodes. The frame node also sets the `NODE_BACKGROUND` flag. All other nodes were setting a flag of 0 which has no purpose. Reviewed By: JacquesLucke Differential Revision: https://developer.blender.org/D13699
2022-01-03Cleanup: Clang tidyHans Goudey
2022-01-03Nodes: Convert several shader nodes to c++Aaron Carlisle
Also add file namespace This is needed to use new node APIs Differential Revision: https://developer.blender.org/D13690
2021-12-31Nodes: Add Compare node operations to link drag search menuCharlie Jolly
Exposes compare operations via rna emums. This uses the rna enum to build the search list using named operations linked to socket A. This also weights the Math Node comparison operations lower for geometry node trees. Differential Revision: https://developer.blender.org/D13695
2021-12-31Cleanup: Silence warning for wrong const char comparisonCharlie Jolly
Incorrectly used comparison for empty string. Reported in chat by @jacqueslucke.
2021-12-31Nodes: Weight drag link search for Math nodesCharlie Jolly
As @hooglyboogly suggested in D13680, this patch adds weighting to the search results. Dragging from a vector/rgba socket weights the Vector Math node higher than a float Math node, and vice versa. Reviewed By: HooglyBoogly Differential Revision: https://developer.blender.org/D13691
2021-12-31Fix (unreported): remove menu separators from drag link searchCharlie Jolly
Search was picking up the menu separator entries. Add check for these which are defined by empty identifier strings.
2021-12-31Cleanup: Use switch to get gpu shader nameAaron Carlisle
Rather than using the array syntax that doesnt work in C++, use a switch state which is also much easier to read.
2021-12-30Nodes: Convert several shader nodes to c++Aaron Carlisle
Also add file namespace This is needed to use new node APIs Differential Revision: https://developer.blender.org/D13690
2021-12-30Nodes: Improve link drag search for Math and Vector Math nodesCharlie Jolly
Exposes math operations via rna emums. This uses the rna enum to build the search list. Differential Revision: https://developer.blender.org/D13680
2021-12-30Nodes: Convert shader, texture category nodes to c++Aaron Carlisle
Also add/correct file namespace This is needed to use new node APIs Differential Revision: https://developer.blender.org/D13688
2021-12-29Nodes: Cleanup: Remove no op registration functionsAaron Carlisle
All these function paramaters are set to NULL so they arent necessary. Reviewed By: HooglyBoogly, JacquesLucke Differential Revision: https://developer.blender.org/D13686
2021-12-29Nodes: Convert shader, shader category nodes to c++Aaron Carlisle
Also add file namespace This is needed to use new node APIs Differential Revision: https://developer.blender.org/D13684
2021-12-28Nodes: Split shader color ramp into its own fileAaron Carlisle
2021-12-28Nodes: Declare shader nodes in individual file namespaceAaron Carlisle
To be used in the future to support unity builds
2021-12-25Shader Nodes: Convert bump node to use new socket builderAaron Carlisle
This node is a bit special in that it uses two internal sockets for a hack for Eevee; see rBffd5e1e6acd296a187e7af016f9d7f8a9f209f87 As a result, the `SOCK_UNAVAIL` flag is exposed to socket builder API. Reviewed By: JacquesLucke, fclem Differential Revision: https://developer.blender.org/D13496
2021-12-25Cleanup: use new c++ guarded allocator API in nodesAaron Carlisle
Also simplify the allocation name to `__func__` Reviewed By: JacquesLucke Differential Revision: https://developer.blender.org/D13665
2021-12-25Cleanup: Define node tree icon in register functionAaron Carlisle
I suppose this was done to reduce then dependencies. However, most nodes already depend on UI code so this isnt too useful.
2021-12-24Nodes: Migrate bump shader node to cppAaron Carlisle
Needed for D13496
2021-12-23Nodes: Add link drag search support for map range nodeHans Goudey
Previously only the float version of the node was connected to. This adds connection operations for vector sockets, and exposes the "Steps" socket properly when it's selected.
2021-12-22Nodes: Refactor to remove node and socket "new" pointersHans Goudey
These pointers point to the new nodes when duplicating, and their even used to point to "original" nodes for "localized" trees. They're just a bad design decision that make code confusing and buggy. Instead, node copy functions now optionally add to a map of old to new socket pointers. The case where the compositor abused these pointers as "original" pointers are handled by looking up the string node names. Differential Revision: https://developer.blender.org/D13518
2021-12-21Nodes: refactor node tree update handlingJacques Lucke
Goals of this refactor: * More unified approach to updating everything that needs to be updated after a change in a node tree. * The updates should happen in the correct order and quadratic or worse algorithms should be avoided. * Improve detection of changes to the output to avoid tagging the depsgraph when it's not necessary. * Move towards a more declarative style of defining nodes by having a more centralized update procedure. The refactor consists of two main parts: * Node tree tagging and update refactor. * Generally, when changes are done to a node tree, it is tagged dirty until a global update function is called that updates everything in the correct order. * The tagging is more fine-grained compared to before, to allow for more precise depsgraph update tagging. * Depsgraph changes. * The shading specific depsgraph node for node trees as been removed. * Instead, there is a new `NTREE_OUTPUT` depsgrap node, which is only tagged when the output of the node tree changed (e.g. the Group Output or Material Output node). * The copy-on-write relation from node trees to the data block they are embedded in is now non-flushing. This avoids e.g. triggering a material update after the shader node tree changed in unrelated ways. Instead the material has a flushing relation to the new `NTREE_OUTPUT` node now. * The depsgraph no longer reports data block changes through to cycles through `Depsgraph.updates` when only the node tree changed in ways that do not affect the output. Avoiding unnecessary updates seems to work well for geometry nodes and cycles. The situation is a bit worse when there are drivers on the node tree, but that could potentially be improved separately in the future. Avoiding updates in eevee and the compositor is more tricky, but also less urgent. * Eevee updates are triggered by calling `DRW_notify_view_update` in `ED_render_view3d_update` indirectly from `DEG_editors_update`. * Compositor updates are triggered by `ED_node_composite_job` in `node_area_refresh`. This is triggered by calling `ED_area_tag_refresh` in `node_area_listener`. Removing updates always has the risk of breaking some dependency that no one was aware of. It's not unlikely that this will happen here as well. Adding back missing updates should be quite a bit easier than getting rid of unnecessary updates though. Differential Revision: https://developer.blender.org/D13246
2021-12-20Cleanup: Remove more no-op node preview codeHans Goudey
This is a follow-up to rB43875e8dd1d76ee, removing some processing of non-existent node previews in the shader and texture nodes systems.
2021-12-16Fix various cases of incorrect filtering in node link drag searchHans Goudey
Some nodes didn't check the type of the link's socket for filtering. Do this with a combination of manually calling the node tree's validate links function and using the helper function for declarations. Also clean up a few cases that added geometry sockets manually when they can use the simpler helper function.
2021-12-15Node Editor: Link Drag Search MenuHans Goudey
This commit adds a search menu when links are dragged above empty space. When releasing the drag, a menu displays all compatible sockets with the source link. The "main" sockets (usually the first) are weighted above other sockets in the search, so they appear first when you type the name of the node. A few special operators for creating a reroute or a group input node are also added to the search. Translation is started after choosing a node so it can be placed quickly, since users would likely adjust the position after anyway. A small "+" is displayed next to the cursor to give a hint about this. Further improvements are possible after this first iteration: - Support custom node trees. - Better drawing of items in the search menu. - Potential tweaks to filtering of items, depending on user feedback. Thanks to Juanfran Matheu for developing an initial patch. Differential Revision: https://developer.blender.org/D8286
2021-12-15Cleanup: unused variable warningCampbell Barton
2021-12-14Nodes: Add vector support to Map Range nodeCharlie Jolly
This replaces lost functionality from the old GN Attribute Map Range node. This also adds vector support to the shader version of the node. Notes: This breaks forward compatibility as this node now uses data storage. Reviewed By: HooglyBoogly, brecht Differential Revision: https://developer.blender.org/D12760
2021-12-11Cleanup: Use const argumentsHans Goudey
Also remove unnecessary function to set a node type's label function that duplicated its definition, and make another function static.
2021-12-08Cleanup: clang-formatAaron Carlisle
2021-12-08Cleanup: Nodes: clang-tidy modernize-redundant-void-argAaron Carlisle
2021-12-08Shader Nodes: Use camel case for file namesAaron Carlisle
Recommits part of rBf60b95b5320f8d6abe6a629fe8fc4f1b94d0d91c
2021-12-07Shader Nodes: Create a new bf_nodes_shader libraryAaron Carlisle
Re commits rBf72cc47d8edf849af98e196f721022bacf86a5e7 but without the unity build
2021-12-07Cleanup: Add macro and functions for node storageHans Goudey
The `node_storage` functions to retrieve const and mutable structs from a node are generated by a short macro that can be placed at the top of each relevant file. I use this in D8286 to make code snippets in the socket declarations much shorter, but I thought it would be good to use it consistently everywhere else too. The functions are also useful to avoid copy and paste errors, like the one corrected in the cylinder node in this commit. Differential Revision: https://developer.blender.org/D13491
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-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-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-07Cleanup: Remove unused node flagHans Goudey
2021-12-07Cleanup: Remove unnecessary generic includes from headersHans Goudey
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-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