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
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2020-07-21 18:20:05 +0300
committerJacques Lucke <jacques@blender.org>2020-07-21 18:35:09 +0300
commit8369adabc0ec7a1fce248b688bf20860ae0434bb (patch)
treeaf767efe8c6765c5876391a5eb96923fc8d6ac68 /source/blender/functions/FN_multi_function_signature.hh
parent6c7e62ef9be564fbee279c7467c9b6adaf51b6c8 (diff)
Particles: initial object socket and emitter node support
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.
Diffstat (limited to 'source/blender/functions/FN_multi_function_signature.hh')
-rw-r--r--source/blender/functions/FN_multi_function_signature.hh10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/functions/FN_multi_function_signature.hh b/source/blender/functions/FN_multi_function_signature.hh
index af5f61fe2ee..26df7c98e4a 100644
--- a/source/blender/functions/FN_multi_function_signature.hh
+++ b/source/blender/functions/FN_multi_function_signature.hh
@@ -36,6 +36,7 @@ struct MFSignature {
RawVector<std::string> param_names;
RawVector<MFParamType> param_types;
RawVector<int> param_data_indices;
+ bool depends_on_context = false;
int data_index(int param_index) const
{
@@ -157,6 +158,15 @@ class MFSignatureBuilder {
break;
}
}
+
+ /* Context */
+
+ /** This indicates that the function accesses the context. This disables optimizations that
+ * depend on the fact that the function always performes the same operation. */
+ void depends_on_context()
+ {
+ data_.depends_on_context = true;
+ }
};
} // namespace blender::fn