Changeset View
Changeset View
Standalone View
Standalone View
source/blender/modifiers/intern/MOD_simulation.cc
| Show All 26 Lines | |||||
| #include "MEM_guardedalloc.h" | #include "MEM_guardedalloc.h" | ||||
| #include "BLI_float3.hh" | #include "BLI_float3.hh" | ||||
| #include "BLI_listbase.h" | #include "BLI_listbase.h" | ||||
| #include "BLI_string.h" | #include "BLI_string.h" | ||||
| #include "BLI_utildefines.h" | #include "BLI_utildefines.h" | ||||
| #include "DNA_defaults.h" | |||||
| #include "DNA_mesh_types.h" | #include "DNA_mesh_types.h" | ||||
| #include "DNA_meshdata_types.h" | #include "DNA_meshdata_types.h" | ||||
| #include "DNA_modifier_types.h" | #include "DNA_modifier_types.h" | ||||
| #include "DNA_object_types.h" | #include "DNA_object_types.h" | ||||
| #include "DNA_pointcloud_types.h" | #include "DNA_pointcloud_types.h" | ||||
| #include "DNA_scene_types.h" | #include "DNA_scene_types.h" | ||||
| #include "DNA_screen_types.h" | #include "DNA_screen_types.h" | ||||
| #include "DNA_simulation_types.h" | #include "DNA_simulation_types.h" | ||||
| Show All 16 Lines | |||||
| #include "DEG_depsgraph_build.h" | #include "DEG_depsgraph_build.h" | ||||
| #include "DEG_depsgraph_query.h" | #include "DEG_depsgraph_query.h" | ||||
| #include "MOD_modifiertypes.h" | #include "MOD_modifiertypes.h" | ||||
| #include "MOD_ui_common.h" | #include "MOD_ui_common.h" | ||||
| using blender::float3; | using blender::float3; | ||||
| static void initData(ModifierData *md) | |||||
| { | |||||
| SimulationModifierData *smd = (SimulationModifierData *)md; | |||||
| BLI_assert(MEMCMP_STRUCT_AFTER_IS_ZERO(smd, modifier)); | |||||
| MEMCPY_STRUCT_AFTER(smd, DNA_struct_default_get(SimulationModifierData), modifier); | |||||
| } | |||||
| static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx) | static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx) | ||||
| { | { | ||||
| SimulationModifierData *smd = reinterpret_cast<SimulationModifierData *>(md); | SimulationModifierData *smd = reinterpret_cast<SimulationModifierData *>(md); | ||||
| if (smd->simulation) { | if (smd->simulation) { | ||||
| DEG_add_simulation_relation(ctx->node, smd->simulation, "Accessed Simulation"); | DEG_add_simulation_relation(ctx->node, smd->simulation, "Accessed Simulation"); | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 112 Lines • ▼ Show 20 Lines | ModifierTypeInfo modifierType_Simulation = { | ||||
| /* deformMatrices */ NULL, | /* deformMatrices */ NULL, | ||||
| /* deformVertsEM */ NULL, | /* deformVertsEM */ NULL, | ||||
| /* deformMatricesEM */ NULL, | /* deformMatricesEM */ NULL, | ||||
| /* modifyMesh */ NULL, | /* modifyMesh */ NULL, | ||||
| /* modifyHair */ NULL, | /* modifyHair */ NULL, | ||||
| /* modifyPointCloud */ modifyPointCloud, | /* modifyPointCloud */ modifyPointCloud, | ||||
| /* modifyVolume */ NULL, | /* modifyVolume */ NULL, | ||||
| /* initData */ NULL, | /* initData */ initData, | ||||
| /* requiredDataMask */ NULL, | /* requiredDataMask */ NULL, | ||||
| /* freeData */ freeData, | /* freeData */ freeData, | ||||
| /* isDisabled */ isDisabled, | /* isDisabled */ isDisabled, | ||||
| /* updateDepsgraph */ updateDepsgraph, | /* updateDepsgraph */ updateDepsgraph, | ||||
| /* dependsOnTime */ NULL, | /* dependsOnTime */ NULL, | ||||
| /* dependsOnNormals */ NULL, | /* dependsOnNormals */ NULL, | ||||
| /* foreachObjectLink */ NULL, | /* foreachObjectLink */ NULL, | ||||
| /* foreachIDLink */ foreachIDLink, | /* foreachIDLink */ foreachIDLink, | ||||
| /* foreachTexLink */ NULL, | /* foreachTexLink */ NULL, | ||||
| /* freeRuntimeData */ NULL, | /* freeRuntimeData */ NULL, | ||||
| /* panelRegister */ panelRegister, | /* panelRegister */ panelRegister, | ||||
| /* blendWrite */ blendWrite, | /* blendWrite */ blendWrite, | ||||
| /* blendRead */ blendRead, | /* blendRead */ blendRead, | ||||
| }; | }; | ||||