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-05-13 13:39:17 +0300
committerJacques Lucke <jacques@blender.org>2020-05-13 13:39:17 +0300
commitb55c78a289c600696282f97191d6e800a1c1ac34 (patch)
treea17132a55b05b0e90e5a1ed4ada7d153b9d4e116 /source/blender/depsgraph/intern/node
parent23fd95458c264dc53f5ce94cd2c65404a69d0f6f (diff)
Simulation: Add modifier to access simulation data
For now the "Simulation" modifier only exists for point cloud objects, because we need this for the particle system. Right now, the modifier is doing nothing. There is a new `DEG_add_simulation_relation` function that is used by the modifier to make sure that the simulation is evaluated before the modifier is executed. Reviewers: brecht, sergey Differential Revision: https://developer.blender.org/D7549
Diffstat (limited to 'source/blender/depsgraph/intern/node')
-rw-r--r--source/blender/depsgraph/intern/node/deg_node.cc4
-rw-r--r--source/blender/depsgraph/intern/node/deg_node.h2
-rw-r--r--source/blender/depsgraph/intern/node/deg_node_component.cc2
-rw-r--r--source/blender/depsgraph/intern/node/deg_node_component.h1
-rw-r--r--source/blender/depsgraph/intern/node/deg_node_operation.cc2
-rw-r--r--source/blender/depsgraph/intern/node/deg_node_operation.h3
6 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/depsgraph/intern/node/deg_node.cc b/source/blender/depsgraph/intern/node/deg_node.cc
index d95e05a6f4f..10760d3170b 100644
--- a/source/blender/depsgraph/intern/node/deg_node.cc
+++ b/source/blender/depsgraph/intern/node/deg_node.cc
@@ -114,6 +114,8 @@ const char *nodeTypeAsString(NodeType type)
return "ARMATURE";
case NodeType::GENERIC_DATABLOCK:
return "GENERIC_DATABLOCK";
+ case NodeType::SIMULATION:
+ return "SIMULATION";
/* Total number of meaningful node types. */
case NodeType::NUM_TYPES:
@@ -172,6 +174,7 @@ eDepsSceneComponentType nodeTypeToSceneComponent(NodeType type)
case NodeType::SHADING:
case NodeType::CACHE:
case NodeType::PROXY:
+ case NodeType::SIMULATION:
return DEG_SCENE_COMP_PARAMETERS;
}
BLI_assert(!"Unhandled node type, not suppsed to happen.");
@@ -245,6 +248,7 @@ eDepsObjectComponentType nodeTypeToObjectComponent(NodeType type)
case NodeType::BATCH_CACHE:
case NodeType::DUPLI:
case NodeType::SYNCHRONIZATION:
+ case NodeType::SIMULATION:
case NodeType::UNDEFINED:
case NodeType::NUM_TYPES:
return DEG_OB_COMP_PARAMETERS;
diff --git a/source/blender/depsgraph/intern/node/deg_node.h b/source/blender/depsgraph/intern/node/deg_node.h
index ad1eba2f7ba..f0ce38ddeae 100644
--- a/source/blender/depsgraph/intern/node/deg_node.h
+++ b/source/blender/depsgraph/intern/node/deg_node.h
@@ -127,6 +127,8 @@ enum class NodeType {
DUPLI,
/* Synchronization back to original datablock. */
SYNCHRONIZATION,
+ /* Simulation component. */
+ SIMULATION,
/* Total number of meaningful node types. */
NUM_TYPES,
diff --git a/source/blender/depsgraph/intern/node/deg_node_component.cc b/source/blender/depsgraph/intern/node/deg_node_component.cc
index e2c1f74ec46..f4d042fecf9 100644
--- a/source/blender/depsgraph/intern/node/deg_node_component.cc
+++ b/source/blender/depsgraph/intern/node/deg_node_component.cc
@@ -333,6 +333,7 @@ DEG_COMPONENT_NODE_DEFINE(Synchronization, SYNCHRONIZATION, 0);
DEG_COMPONENT_NODE_DEFINE(Audio, AUDIO, 0);
DEG_COMPONENT_NODE_DEFINE(Armature, ARMATURE, 0);
DEG_COMPONENT_NODE_DEFINE(GenericDatablock, GENERIC_DATABLOCK, 0);
+DEG_COMPONENT_NODE_DEFINE(Simulation, SIMULATION, 0);
/* Node Types Register =================================== */
@@ -362,6 +363,7 @@ void deg_register_component_depsnodes()
register_node_typeinfo(&DNTI_AUDIO);
register_node_typeinfo(&DNTI_ARMATURE);
register_node_typeinfo(&DNTI_GENERIC_DATABLOCK);
+ register_node_typeinfo(&DNTI_SIMULATION);
}
} // namespace DEG
diff --git a/source/blender/depsgraph/intern/node/deg_node_component.h b/source/blender/depsgraph/intern/node/deg_node_component.h
index 41d5c130ffd..ca37401d200 100644
--- a/source/blender/depsgraph/intern/node/deg_node_component.h
+++ b/source/blender/depsgraph/intern/node/deg_node_component.h
@@ -191,6 +191,7 @@ DEG_COMPONENT_NODE_DECLARE_GENERIC(Synchronization);
DEG_COMPONENT_NODE_DECLARE_GENERIC(Audio);
DEG_COMPONENT_NODE_DECLARE_GENERIC(Armature);
DEG_COMPONENT_NODE_DECLARE_GENERIC(GenericDatablock);
+DEG_COMPONENT_NODE_DECLARE_GENERIC(Simulation);
/* Bone Component */
struct BoneComponentNode : public ComponentNode {
diff --git a/source/blender/depsgraph/intern/node/deg_node_operation.cc b/source/blender/depsgraph/intern/node/deg_node_operation.cc
index d327e1da8a1..2381076161f 100644
--- a/source/blender/depsgraph/intern/node/deg_node_operation.cc
+++ b/source/blender/depsgraph/intern/node/deg_node_operation.cc
@@ -194,6 +194,8 @@ const char *operationCodeAsString(OperationCode opcode)
/* instancing/duplication. */
case OperationCode::DUPLI:
return "DUPLI";
+ case OperationCode::SIMULATION_EVAL:
+ return "SIMULATION_EVAL";
}
BLI_assert(!"Unhandled operation code, should never happen.");
return "UNKNOWN";
diff --git a/source/blender/depsgraph/intern/node/deg_node_operation.h b/source/blender/depsgraph/intern/node/deg_node_operation.h
index 2faf139ec93..865a25d2124 100644
--- a/source/blender/depsgraph/intern/node/deg_node_operation.h
+++ b/source/blender/depsgraph/intern/node/deg_node_operation.h
@@ -198,6 +198,9 @@ enum class OperationCode {
/* Duplication/instancing system. --------------------------------------- */
DUPLI,
+
+ /* Simulation. ---------------------------------------------------------- */
+ SIMULATION_EVAL,
};
const char *operationCodeAsString(OperationCode opcode);