Sorry, forgot to add it.
//SLICE FUNCTION
void TimberBoarding_mod::SlicePolyObject(MNMesh & mesh, Point3 & N, float offset) {
mesh.SetFlag(MN_MESH_TEMP_1);
mesh.Slice(N, offset, 0, false, true);
mesh.ClearFlag(MN_MESH_TEMP_1);
}
/*************************************************************************************************
*
ModifyObject will do all the work in a full modifier
This includes casting objects to their correct form, doing modifications
changing their parameters, etc
*
************************************************************************************************/
//MAIN MOD ACTION ON MESH
void TimberBoarding_mod::ModifyObject(TimeValue t, ModContext& mc, ObjectState* os, INode* node)
{
//#pragma message(TODO(“Add the code for actually modifying the object”))
/**/
Interval valid = GetValidity(t);
//SEE CHANLED USED
valid &= os->obj->ChannelValidity(t, GEOM_CHAN_NUM);
valid &= os->obj->ChannelValidity(t, TOPO_CHAN_NUM);
//operations on mesh
float tention;
pblock->GetValue(pb_spin, t, tention, valid);
if (os->obj->CanConvertToType(polyObjectClassID))
{
PolyObject *triObj = (PolyObject *)os->obj->ConvertToType(t, polyObjectClassID);
MNMesh &mesh = triObj->GetMesh();
//error on slice function
SlicePolyObject(mesh, Point3(0.0f, 0.0f, 1.0f), tention);
}
//update velidity
NotifyDependents(Interval(t, t), PART_GEOM &PART_TOPO, REFMSG_CHANGE);
os->obj->UpdateValidity(PART_GEOM &PART_TOPO, valid);
//END
}