Age | Commit message (Collapse) | Author |
|
This just moves a couple of files in `space_node` to C++ and fixes
related errors.
The goal is to be able to use C++ data structures to simplify the code.
Differential Revision: https://developer.blender.org/D11451
|
|
This is especially useful when trying to add a node group instance, e.g. via
drag & drop from the Outliner or Asset Browser.
Previously this would just silently fail, with no information why. This is a
source of confusion, e.g. earlier, it took me a moment to realize I was
dragging a node group into itself, which failed of course.
Blender should always try to help the user with useful error messages.
Adds error messages like: "Nesting a node group inside of itself is not
allowed", "Not a compositor node tree", etc.
Adds a disabled hint return argument to node and node tree polling functions.
On error the hint is reported, or could even be shown in advance (e.g. if
checked via an operator poll option).
Differential Revision: https://developer.blender.org/D10422
Reviewed by: Jacques Lucke
|
|
This Patch removes the auto sorting from Multi-Input Sockets and allows
the links to be sorted by drag and drop instead.
As a minor related change, it fixes the drawing of the mute line to
connect to the first input instead of the socket's center.
|
|
Adds `NODE_OT_add_group` operator to add a node group from a given name, and
uses that to register a node editor drop-box.
When dropping a node-group asset, the ID will be appended. This is what we do
for other ID assets too.
Should the node group insertion fail (e.g. the group is not compatible with the
current tree, as checked by the poll), the appended data-block is removed.
Differential Revision: https://developer.blender.org/D10405
Reviewed by: Jacques Lucke
|
|
|
|
This is the initial merge from the geometry-nodes branch.
Nodes:
* Attribute Math
* Boolean
* Edge Split
* Float Compare
* Object Info
* Point Distribute
* Point Instance
* Random Attribute
* Random Float
* Subdivision Surface
* Transform
* Triangulate
It includes the initial evaluation of geometry node groups in the Geometry Nodes modifier.
Notes on the Generic attribute access API
The API adds an indirection for attribute access. That has the following benefits:
* Most code does not have to care about how an attribute is stored internally.
This is mainly necessary, because we have to deal with "legacy" attributes
such as vertex weights and attributes that are embedded into other structs
such as vertex positions.
* When reading from an attribute, we generally don't care what domain the
attribute is stored on. So we want to abstract away the interpolation that
that adapts attributes from one domain to another domain (this is not
actually implemented yet).
Other possible improvements for later iterations include:
* Actually implement interpolation between domains.
* Don't use inheritance for the different attribute types. A single class for read
access and one for write access might be enough, because we know all the ways
in which attributes are stored internally. We don't want more different internal
structures in the future. On the contrary, ideally we can consolidate the different
storage formats in the future to reduce the need for this indirection.
* Remove the need for heap allocations when creating attribute accessors.
It includes commits from:
* Dalai Felinto
* Hans Goudey
* Jacques Lucke
* Léo Depoix
|
|
|
|
|
|
Reviewers: ISS
Differential Revision: https://developer.blender.org/D9236
|
|
|
|
|
|
Those were only shallow wrappers around `BKE_id_copy`, barely used (even
fully unused in some cases), and we want to get rid of those ID-specific
helpers for the common ID management tasks. Also prevents weird custom
behaviors (like `BKE_object_copy`, who was the only basic ID copy
function to reset user count of the new copy to zero).
Part of 71219.
|
|
|
|
Reviewers: sybren, sergey
Differential Revision: https://developer.blender.org/D8464
|
|
This flag specifies that even when the socket is not connected,
the node should not display the input field for the constant input
value. This is useful for inputs like Normal, which have special
handling for the missing input case and don't use a constant value.
Currently there is no way to change this flag from Python, and
through UI it can only be done by re-creating the socket.
This patch exposes the flag through RNA and UI, makes sure it
is properly updated when changed, and adds special handling to
ensure that it is correctly set when creating a node group from
a node set that includes reroute nodes.
Differential Revision: https://developer.blender.org/D8395
|
|
Instead of assuming the node width, compute the actual right bound.
Otherwise BSDF nodes tend to be too wide, and intersect Output.
Differential Revision: https://developer.blender.org/D8395
|
|
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/editors/space_node` module.
No functional changes.
|
|
This implements a new builtin node tree type called `SimulationNodeTree`.
It is not yet embedded in the `Simulation` data block.
The node tree will initially be used for the new particle nodes system.
When the cmake option `WITH_NEW_SIMULATION_TYPE` is enabled, a new
`Simulation Editor` is shown in the editors menu (which is just a node editor).
This patch does not add entries to the Add Node menu, so it is empty.
Reviewers: brecht
Differential Revision: https://developer.blender.org/D7287
|
|
Existing code for ungrouping did not correctly handle user counters:
- counter for the group was not decremented
- counters for containing nodes were not incremented
The latter resulted in losing some nodes after orphan cleaning or several save/reload cycles.
The bug did not have destructive consequences until recently,
because it was compensated by another bug (fixed in rBe993667a46c2).
Maniphest Tasks: T74665, T74682
Differential Revision: https://developer.blender.org/D7332
|
|
|
|
Note that `BKE_library.h`/`library.c` were renamed to
`BKE_lib_id.h`/`lib_id.c` to avoid having a too generic name here.
Part of T72604.
|
|
|
|
|
|
At the moment, grouping a single node that has hidden sockets, exposes all
sockets in the node group. This patch just filters hidden sockets, so that
the node group's interface remains the same as the node being grouped.
Differential Revision: https://developer.blender.org/D5533
|
|
When the result isn't used, prefer post increment/decrement
(already used nearly everywhere in Blender).
|
|
reference."
This reverts commits 54fd8176d7e91, 4c5becb6b1 and 8f578150e.
Those kind of commits must be reviewed and approved by project owners.
That one:
* Broke Collada building by not properly updating all calls to modified
function.
* Broke *whole* ID management by not properly updating library_query.c.
And in general, I am strongly against backward ID pointers, those are
*always* a serious PITA for ID management. Sometimes they cannot be
avoided, but in general other ways to get that kind of info should be
investigated first.
|
|
NodeTree structures of materials and some other data blocks are
effectively node group data block objects that are contained inside
the parent block. Thus, direct references to them are only valid
while blender is running, and are lost on save.
Fix Copy As New Driver to create a reference that goes through
the owner data block, by adding a new runtime field to bNodeTree.
|
|
|
|
The root of the problem goes to the fact that node tree copying
uses source tree and nodes for a temporary storage.
This makes it so multiple dependency graphs can not be reliably
evaluated from different threads if they are using same original
node tree.
Solved by doing the following:
- Commonly used tree copying function (which is used by library
manager) keeps source tree, nodes and sockets untouched.
- All the related areas (like node tree's callback) now have
const qualifier on the input.
- Areas which needs to have those temporary pointers assigned are
now using explicit function.
Would be really cool to get rid of those temporary pointers
completely, but this is a bit tricky due to hairy nature of the
code. Can happen any time now though: is easy enough to generalize
the new pointers mapping.
Note that this change is only intended to solve the crash.
The fact that icons shouldn't be updated on playback will be fixed
as a separate change.
Reviewers: brecht, fclem
Reviewed By: brecht, fclem
Subscribers: brecht, fclem
Differential Revision: https://developer.blender.org/D5002
|
|
On file read we need to update group nodes in case the group they refer to
has changed its inputs and outputs. This had O(n^2) time complexity and was
updating all datablocks even if they did not change.
|
|
Apply clang format as proposed in T53211.
For details on usage and instructions for migrating branches
without conflicts, see:
https://wiki.blender.org/wiki/Tools/ClangFormat
|
|
|
|
|
|
User counting now happens before init() and after free() methods, so that
the ID users are in a valid state when Python might modify them. ID user
counting was moved into node.c and simplified.
Patch by Miguel with further refactoring by Brecht. Ref D4370.
|
|
While \file doesn't need an argument, it can't have another doxy
command after it.
|
|
Nuke away old nodeCopyNode(), much better to use new BKE_node_copy_ex(),
which behaves as expected for the various optional flags that can be passed.
This also removes the need to handle ID refcounting in calling code
(ugly!) and allows us to remove an even uglier name from our codebase! :D
Note that this fixes three related issues actually, that bug was also
affecting copy/paste of nodes, and 'Separate with copy' operator (the
latter being actually fully wrong, since it was not refcounting
anything, not even node->id pointer...).
|
|
Move \ingroup onto same line to be more compact and
make it clear the file is in the group.
|
|
Needed for clan-format not to wrap onto one line.
|
|
BF-admins agree to remove header information that isn't useful,
to reduce noise.
- BEGIN/END license blocks
Developers should add non license comments as separate comment blocks.
No need for separator text.
- Contributors
This is often invalid, outdated or misleading
especially when splitting files.
It's more useful to git-blame to find out who has developed the code.
See P901 for script to perform these edits.
|
|
|
|
Prevents clang-format wrapping text before comments.
|
|
|
|
|
|
Need to rebuild dependency graph when we add or remove nodes from a tree...
|
|
|
|
The easy ones - there some much, much trickier to tackle there...
|
|
|
|
|
|
Practically all access to enum data is read-only.
|
|
|