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-07Cleanup: use C++ style casts in various placesJacques Lucke
2020-08-07Cleanup: Clang-Tidy else-after-return fixesSybren A. Stüvel
This addresses warnings from Clang-Tidy's `readability-else-after-return` rule. This should be the final commit of the series of commits that addresses this particular rule. 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-24BLI: add MultiValueMapJacques Lucke
This is a convenience wrapper for `Map<Key, Vector<Value>>`. It does not provide any performance benefits (yet). I need this kind of map in a couple of places and before I was duplicating the lookup logic in many places.
2020-07-23Cleanup: unify naming between different spansJacques Lucke
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-20Refactor: Update integer type usageJacques Lucke
This updates the usage of integer types in code I wrote according to our new style guides. Major changes: * Use signed instead of unsigned integers in many places. * C++ containers in blenlib use `int64_t` for size and indices now (instead of `uint`). * Hash values for C++ containers are 64 bit wide now (instead of 32 bit). I do hope that I broke no builds, but it is quite likely that some compiler reports slightly different errors. Please let me know when there are any errors. If the fix is small, feel free to commit it yourself. I compiled successfully on linux with gcc and on windows.
2020-07-18Simulation: cleanup deduplicating attribute input nodesJacques Lucke
2020-07-17Cleanup: avoid static initialization order issues when accessing CPPTypesJacques Lucke
Instead of depending on static initialization order of globals use static variables within functions. Those are initialized on first use. This is every so slighly less efficient, but avoids a full class of problems.
2020-07-16Nodes: support default function for partially implemented nodesJacques Lucke
2020-07-13Cleanup: fix clang tidy warningJacques Lucke
The code was actually correct, but clang tidy complaint about using the Vector after it was moved from.
2020-07-12Functions: minor improvementsJacques Lucke
2020-07-11Fix: incorrect attribute type in networkJacques Lucke
2020-07-10Functions: add utility to find dependencies of input socketsJacques Lucke
2020-07-10Functions: make constant folding work on unfinished networksJacques Lucke
2020-07-10Functions: use new is-equal and hash function of CPPTypeJacques Lucke
2020-07-10Cleanup: spellingCampbell Barton
2020-07-08Cleanup: remove unnecessary calls to as_spanJacques Lucke
This uses the new implicit conversions and constructors that have been committed in the previous commit. I tested these changes on Linux with gcc and on Windows.
2020-07-08Cleanup: use different internal socket nameJacques Lucke
2020-07-08Functions: implement common subnetwork elimination optimizationJacques Lucke
This was the last of the three network optimizations I developed in the functions branch. Common subnetwork elimination and constant folding together can get rid of most unnecessary nodes.
2020-07-08Functions: initial hash/equals implementation for constant multi-functionsJacques Lucke
2020-07-08Functions: add dead node removal and constant folding optimizationJacques Lucke
Those optimizations work on the multi-function network level. Not only will they make the network evaluation faster, but they also simplify the network a lot. That makes it easier to understand the exported dot graph.
2020-07-07Functions: cleanup loop that traverses the MFNetworkJacques Lucke
2020-07-07Functions: add generic functions that output constantsJacques Lucke
2020-07-07Functions: extend multi-function network apiJacques Lucke
2020-07-03Cleanup: use nested namespacesJacques Lucke
2020-07-03Cleanup: use trailing underscore for non-public data membersJacques Lucke
2020-06-30Functions: provide dummy multi functionJacques Lucke
Sometimes it is convenient to be able to return a reference to some dummy function.
2020-06-30Functions: add methods to multi-function network classesJacques Lucke
Those are necessary to query and modify the network.
2020-06-29Cleanup: rename namespace DotExport to dotJacques Lucke
2020-06-27Functions: add MutableAttributesRef data structureJacques Lucke
This will be used to reference the content of a CustomData structure in C++ code, that does not need to know who owns the data but only works with it.
2020-06-25Cleanup: spellingCampbell Barton
2020-06-23Functions: Multi Function NetworkJacques Lucke
A multi-function network is a graph data structure, where nodes are multi-functions (or dummies) and links represent data flow. New multi-functions can be derived from such a network. For that one just has to specify two sets of sockets in the network that represent the inputs and outputs of the new function. It is possible to do optimizations like constant folding on this data structure, but that is not implemented in this patch yet. In a next step, user generated node trees are converted into a MFNetwork, so that they can be evaluated efficiently for many particles. This patch also includes some tests that cover the majority of the code. However, this seems to be the kind of code that is best tested by some .blend files. Building graph structures in code is possible, but is not easy to understand afterwards. Reviewers: brecht Differential Revision: https://developer.blender.org/D8049
2020-06-16Functions: Multi FunctionJacques Lucke
This adds the `MultiFunction` type and some smallish utility types that it uses. A `MultiFunction` encapsulates a function that is optimized for throughput by always processing many elements at once. This is an important part of the new particle system, because it allows us to execute user generated node trees for many particles efficiently. Reviewers: brecht Differential Revision: https://developer.blender.org/D8030
2020-06-12Functions: Wrap into blender namespaceSergey Sharybin
Similar to previous commit, aims to resolve compilation on devtoolset-6.
2020-06-09BLI: put C++ data structures in "blender" namespace instead of "BLI"Jacques Lucke
We plan to use the "blender" namespace in other modules as well.
2020-06-08Functions: Run-time type system and index maskJacques Lucke
This adds a new `CPPType` that encapsulates information about how to handle instances of a specific data type. This is necessary for the function evaluation system, which will be used to evaluate most of the particle node trees. Furthermore, this adds an `IndexMask` class which offers a surprisingly useful abstraction over an array containing unsigned integers. It makes two assumptions about the underlying integer array: * The integers are in ascending order. * There are no duplicates. `IndexMask` will be used to "select" certain particles that will be processed in a data-oriented way. Sometimes, operations don't have to be applied to all particles, but only some, those that are in the indexed by the `IndexMask`. The two limitations imposed by an `IndexMask` allow for better performance. Reviewers: brecht Differential Revision: https://developer.blender.org/D7957