Skip to content

Instantly share code, notes, and snippets.

@eliemichel
Created September 14, 2019 09:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eliemichel/805d8762918080df275779726296efac to your computer and use it in GitHub Desktop.
Save eliemichel/805d8762918080df275779726296efac to your computer and use it in GitHub Desktop.
Dummy Blender modifier
#include "BKE_modifier.h"
#include "DNA_mesh_types.h"
#include "DNA_modifier_types.h"
static Mesh *pizza_applyModifier(struct ModifierData *md,
const struct ModifierEvalContext *ctx,
struct Mesh *mesh)
{
printf("PIZZA is cooking on data @%p\n", md);
return mesh;
}
static void pizza_freeData(struct ModifierData *md)
{
printf("PIZZA is freed on data @%p\n", md);
}
ModifierTypeInfo modifierType_Pizza = {
/* name */ "Pizza",
/* structName */ "PizzaModifierData",
/* structSize */ sizeof(PizzaModifierData),
/* type */ eModifierTypeType_Constructive,
/* flags */ eModifierTypeFlag_AcceptsMesh,
/* copyData */ modifier_copyData_generic,
/* deformVerts */ NULL,
/* deformMatrices */ NULL,
/* deformVertsEM */ NULL,
/* deformMatricesEM */ NULL,
/* applyModifier */ pizza_applyModifier,
/* initData */ NULL,
/* requiredDataMask */ NULL,
/* freeData */ pizza_freeData,
/* isDisabled */ NULL,
/* updateDepsgraph */ NULL,
/* dependsOnTime */ NULL,
/* dependsOnNormals */ NULL,
/* foreachObjectLink */ NULL,
/* foreachIDLink */ NULL,
/* foreachTexLink */ NULL,
/* freeRuntimeData */ NULL,
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment