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
2020-08-31Cleanup: reduce variable scopeJacques Lucke
2020-08-31Cleanup: reduce variable scope and use LISTBASE_FOREACHJacques Lucke
2020-08-28IDTypeInfo: add .blend file io callbacksJacques Lucke
This is part of T76372. It adds the `blend_write`, `blend_read_data`, `blend_read_lib` and `blend_read_expand` which correspond to the various steps when reading and writing .blend files. Having these callbacks allows us to decentralize the blenloader code a lot more. This has the affect that code related to any specific ID type is less scattered. Reviewers: mont29 Differential Revision: https://developer.blender.org/D8670
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-07Cleanup: Nodes, silence Clang-Tidy readability-function-sizeSybren A. Stüvel
Add a `NOLINT` marker to explicitly silence a warning from Clang-Tidy's `readability-function-size` rule for the `node_type_base()` function. This function is indeed huge, but that is because a lot of macros are expanded. Before expansion things are still not small, but still understandable & expandable. No functional changes.
2020-08-07Cleanup: Blenkernel, Clang-Tidy else-after-return fixesSybren A. Stüvel
This addresses warnings from Clang-Tidy's `readability-else-after-return` rule in the `source/blender/blenkernel` module. No functional changes.
2020-08-02Particles: new Age Reached Event, Kill Particle and Random Float nodeJacques Lucke
The hardcoded age limit is now gone. The behavior can be implemented with an Age Reached Event and Kill Particle node. Other utility nodes to handle age limits of particles can be added later. Adding an Age Limit attribute to particles on birth will be useful for some effects, e.g. when you want to control the color or size of a particle over its life time. The Random Float node takes a seed currently. Different nodes will produce different values even with the same seed. However, the same node will generate the same random number for the same seed every time. The "Hash" of a particle can be used as seed. Later, we'd want to have more modes in the node to make it more user friendly. Modes could be: Per Particle, Per Time, Per Particle Per Time, Per Node Instance, ... Also a Random Vector node will be useful, as it currently has to be build using three Random Float nodes.
2020-07-27Particles: initial support for events and actionsJacques Lucke
The following nodes work now (although things can still be improved of course): Particle Birth Event, Praticle Time Step Event, Set Particle Attribute and Execute Condition. Multiple Set Particle Attribute nodes can be chained using the "Execute" sockets. They will be executed from left to right.
2020-07-23Simulation: add depsgraph relations for ids referenced by node treeJacques Lucke
I'll really have to refactor `ntreeUpdateTree` soon to avoid scanning all node trees multiple times.
2020-07-23Cleanup: remove incorrect commentJacques Lucke
2020-07-22Simulation: improve depsgraph integrationJacques Lucke
A simulation data block has an embedded node tree, which requires special handling in a couple of places. Some of those places were missing beforehand. This also adds a relation to make sure that the simulation is evaluated after animations on the embedded node tree are evaluated.
2020-07-21Particles: initial object socket and emitter node supportJacques Lucke
Object sockets work now, but only the new Object Transforms and the Particle Mesh Emitter node use it. The emitter does not actually use the mesh surface yet. Instead, new particles are just emitted around the origin of the object. Internally, handles to object data blocks are passed around in the network, instead of raw object pointers. Using handles has a couple of benefits: * The caller of the function has control over which handles can be resolved and therefore limit access to specific data. The set of data blocks that is accessed by a node tree should be known statically. This is necessary for a proper integration with the dependency graph. * When the pointer to an object changes (e.g. after restarting Blender), all handles are still valid. * When an object is deleted, the handle is invalidated without causing crashes. * The handle is just an integer that can be stored per particle and can be cached easily. The mapping between handles and their corresponding data blocks is stored in the Simulation data block.
2020-07-06Runtime cache preservation during undo: add support for nodes and embedded IDs.Bastien Montagne
2020-06-28Use const in nodeFindSocketAnkit
Since the function only iterates over the input members, and matches their identifiers, `bNode *`can be `const`. All other usages of the `nodeFindSocket` use it with other functions that modify the node. (e.g.: ``nodeAddLink` ) But an exporter needs the node to be a `const`, so this creates unnecessary and slightly unsafe design changes. Reviewed By: JacquesLucke Differential Revision: https://developer.blender.org/D8142
2020-06-23Cleanup: rename Library.filepath to filepath_absCampbell Barton
Make it clear that this is the absolute path, allow the 'name' to be renamed to 'filepath'. Rename is safe since this is only for run-time.
2020-05-11Merge branch 'blender-v2.83-release'Philipp Oeser
2020-05-11Fix T76538: Prevent nodesocket creation on certain nodesPhilipp Oeser
- no sockets on Frame nodes - no Input sockets on Group Input nodes - no Output sockets on Group Output nodes Maniphest Tasks: T76538 Differential Revision: https://developer.blender.org/D7671
2020-05-07Refactor: libquery: Add NodeTree foreach_id support.Bastien Montagne
2020-05-04Nodes: add Combine Strings and Group Instance ID node UIsJacques Lucke
Reviewers: brecht Differential Revision: https://developer.blender.org/D7494
2020-04-20Cleanup: rename "nested" to "embedded"Jacques Lucke
Reviewers: mont29 Differential Revision: https://developer.blender.org/D7476
2020-04-20Simulations: Add Boolean Math, Switch and Float Compare node UIJacques Lucke
Reviewers: brecht Differential Revision: https://developer.blender.org/D7424
2020-04-20Simulations: UI for core particle nodesJacques Lucke
This commit adds the initial set of particles nodes. These are fairly low level and are expected to be put into groups that we ship with Blender. See D7384 for a description of the individual nodes. Reviewers: brecht Differential Revision: https://developer.blender.org/D7384
2020-04-20Nodes: Add emitters, events, forces and control flow socket typesJacques Lucke
These socket types will be necessary for particle nodes. The way these sockets are drawn can be changed separately. Reviewers: brecht Differential Revision: https://developer.blender.org/D7349
2020-04-20Nodes: New Object and Image socket typesJacques Lucke
Those new socket types will be necessary for particle nodes. The main difficulty with adding these socket types is that they are the first that reference ID data in their `value`. Therefore, user counting code had to be added in a couple new places. Reviewers: brecht, mont29 Differential Revision: https://developer.blender.org/D7347
2020-04-20Simulations: Embed simulation node tree in simulation data blockJacques Lucke
This adds an embedded node tree to the simulation data block dna. The UI in the `Simulation Editor` has been updated to show a list of simulation data blocks, instead of individual node trees. The new `SpaceNodeEditor.simulation` property wraps the existing `SpaceNodeEditor.id` property. It allows scripts to get and set the simulation data block that is being edited. Reviewers: brecht, mont29 Differential Revision: https://developer.blender.org/D7301
2020-04-20Simulations: Add simulation node tree typeJacques Lucke
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
2020-04-03Code Quality: Replace for loops with LISTBASE_FOREACHDalai Felinto
Note this only changes cases where the variable was declared inside the for loop. To handle it outside as well is a different challenge. Differential Revision: https://developer.blender.org/D7320
2020-04-03Cleanup: Rename ExtensionRNA variables from ext to rna_extJulian Eisel
Makes it more clear that code using this is related to the RNA integration of a type. Part of T74432. Also ran clang-format on affected files.
2020-04-03Cleanup: Animation, move AnimData API to `anim_data.c`/`BKE_anim_data.h`Sybren A. Stüvel
The `BKE_animsys.h` and `anim_sys.c` files already had a an "AnimData API" section. The code in that section has now been split off, and placed into `BKE_anim_data.h` and `anim_data.c`. All files that used to include `BKE_animsys.h` have been adjusted to only include the animation headers they need (sometimes none). No functional changes.
2020-03-19Cleanup: `make format` after SortedIncludes changeDalai Felinto
2020-03-12Cleanup: remove unused node tree user counting functionsJacques Lucke
2020-03-11Cleanup: rename 'private' to 'embedded' for sub-data IDs.Bastien Montagne
'Private' can be a rather confusing term, especially when considering its meaning in programming languages. So now root node trees and master collections are 'embedded' IDs instead.
2020-03-09Cleanup: Move `BKE_animdata_free()` call out of each IDType free data.Bastien Montagne
This has been long standing TODO... Note that remaining usages of BKE_xxx_delete should all be carefully checked for and utilmately nuked in favor of `BKE_id_delete()`, think we still have quiet a few bugs hidden in those (code seems to usually assume those functions do a full ID deletion, which is not the case).
2020-03-06Cleanup: bNodeTree: Move to IDTypeInfo and remove unused BKE API.Bastien Montagne
2020-03-06Nodes: Support storing socket link limits in bNodeSocketTypeJacques Lucke
Currently the link limit of sockets is stored in bNodeSocket->limit. This allows for a lot of flexibility, but is also very redundant. In every case I've had to deal with so far, it would have "more correct" to set the link limit per socket type and not per socket. I did not enforce this constraint yet, because the link limit is exposed in the Python API, which I did not want to break here. In the future it might even make sense to only support only three kinds of link limits: a) no links, b) at most one link, c) an arbitrary number links links. The other link limits usually don't work well with tools (e.g. which link should be removed when a new one is connected?) and is not used in practice. However, that is for another day. Eventually, I would like to get rid of bNodeSocket->limit completely and replace it either with fixed link limits or a callback in bNodeSocketType. This patch consists of three parts: **1. Support defining link limit in socket type** This introduces a new `nodeSocketLinkLimit` function that serves as an indirection to hide where the link limit of a socket is defined. **2. Define link limits for builtin sockets on socket type** Data sockets: one input, many outputs Virtual sockets: one input, one output Undefined sockets: many inputs, many outputs (to avoid that links are removed when the type of the socket is not known) **3. Remove `bNodeSocketTemplate->limit`** This wasn't used anymore after the second commit. Removing it simplifies socket definitions in hundreds of places and removes a lot of redundancy. Differential Revision: https://developer.blender.org/D7038 Reviewers: brecht
2020-03-04Refactor ID make local to use a single flag parameter.Bastien Montagne
Instead of using anonymous booleans flags, also allows to keep the same behavior in all cases, without needing special handling from calling code for our beloved oddballs object proxies...
2020-03-04Cleanup: ID make local: remove `id_in_bmain` argument.Bastien Montagne
This info is now stored in ID tags themselves, so no need to pass an extra anonymous boolean parameter around, yay!
2020-03-04Cleanup: Rename 'make local' functions to new scheme.Bastien Montagne
Also removed some only used locally from the header, `BKE_lib_id.h` is already way too big, no need to overload it with unused things.
2020-02-28Nodes: Use destructor callbacks for bNodeSocketType and bNodeTypeJacques Lucke
Reviewers: brecht Differential Revision: https://developer.blender.org/D6963
2020-02-17Cycles: Vector Rotate Node using Axis and Angle methodCharlie Jolly
This node provides the ability to rotate a vector around a `center` point using either `Axis Angle` , `Single Axis` or `Euler` methods. Reviewed By: #cycles, brecht Differential Revision: https://developer.blender.org/D3789
2020-02-11Nodes: Add dynamic label support for Math NodesCharlie Jolly
Reviewed By: brecht Differential Revision: https://developer.blender.org/D6375
2020-02-10Cleanup/refactor: Rename `BKE_library` files to `BKE_lib`.Bastien Montagne
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.
2020-02-06NodeTree: Add access to the address of an ID's nodetree pointer.Bastien Montagne
2020-01-16Fix T70766 EEVEE: Performance drop with node tree in 2.81Clément Foucault
2020-01-05Fix (unreported) critical mistake in Node copying code.Maxim Vasiliev
Nice reversed-logic mistake in rB693721cc7e7d. How this could remain unnoticed for almost one year is fairly mysterious, this should have basically broke all node tree copying, would expect such bug to get reported within days, weeks at most... Probably because that function is not that much used in current code. Nice reminder also that those bloody nodetrees still need a lot of cleanup/refactor/simplification when it comes to ID management code. Reported/fixed as part of D6484, but this really needs its own commit.
2019-12-10Cycles: support for custom shader AOVsLukas Stockner
Custom render passes are added in the Shader AOVs panel in the view layer settings, with a name and data type. In shader nodes, an AOV Output node is then used to output either a value or color to the pass. Arbitrary names can be used for these passes, as long as they don't conflict with built-in passes that are enabled. The AOV Output node can be used in both material and world shader nodes. Implemented by Lukas, with tweaks by Brecht. Differential Revision: https://developer.blender.org/D4837
2019-12-07Fix ShaderNodeCustomGroup.copy method being called too oftenBrecht Van Lommel
This is only supposed to happen when copying nodes that are part of the user editable database, not temporary copies for the dependency graph. The LIB_ID_COPY_LOCALIZE test was wrong because it is a combination of multiple bitflags as pointed out by Bastien, and was actually redundant anyway since LIB_ID_CREATE_NO_MAIN is part of it.
2019-10-10Fix T70614 EEVEE: Bump with texture connected to other branches don't workClément Foucault
Was caused by the bump node not being evaluated because the other branch was evaluated before. To fix this, we use fromnode instead of tonode. Also we fix a potential issue with recursiveness because ntree_shader_copy_branch() also use nodeChainIterBackwards() which would reset the iter_flag in the middle of the parent iteration. Use iter_flag as a bitflag for each iteration to fix this.
2019-10-02Fix T70441: crash after deleting a material output nodePhilipp Oeser
Caused by 5c79f2d0fba7. If no valid node_start is provided, we can just skip (e.g. 'ntree_shader_bump_branches' is not done then, but this is not neccessary without a valid eevee output node anyways...). Maniphest Tasks: T70441 Reviewed By: fclem Differential Revision: https://developer.blender.org/D5969
2019-10-01Fix T70325 EEVEE: Performance regression with large nodetreesClément Foucault
This was caused by nodeChainIter which is not linear complexity. Introduce nodeChainIterBackwards to iterate backwards faster.