Bool BlinkerTrack::Animate(CTrack *track, const CAnimInfo *info, Bool *chg, void *data) { if ((!info->k1 && !info->k2) || !info->op->IsInstanceOf(Obase)) return TRUE; GeData res; BaseTime t; Real p1=0.0,p2=0.0,number=0.0; if (info->k1 && info->k1->GetParameter(DescLevel(BLINKERKEY_NUMBER),res,DESCFLAGS_GET_0)) p1=res.GetReal(); if (info->k2 && info->k2->GetParameter(DescLevel(BLINKERKEY_NUMBER),res,DESCFLAGS_GET_0)) p2=res.GetReal(); if (info->k1 && info->k2) number = p1*(1.0-info->rel)+p2*info->rel; else if (info->k1) number = p1; else if (info->k2) number = p2; LONG mode; Real v=Sin(number*info->fac*pi2); if (v>=0.0) mode=MODE_ON; else mode=MODE_OFF; ((BaseObject*)info->op)->SetEditorMode(mode); return TRUE; }
Filename ApplinkExporter::getParameterFilename(C4DAtom& atom, LONG paramID) { GeData parameter; if (atom.GetParameter(DescLevel(paramID), parameter, DESCFLAGS_GET_0)) { return parameter.GetFilename(); } return NULL; }
Bool BlinkerTrack::FillKey(CTrack *track, BaseDocument *doc, BaseList2D *bl, CKey *key) { //BaseContainer *data = ((BaseSequence*)track)->GetDataInstance(); key->SetParameter(DescLevel(BLINKERKEY_NUMBER),1.0,DESCFLAGS_SET_0); return TRUE; }
Real ApplinkExporter::getParameterReal(C4DAtom& atom, LONG paramID, Real preset) { GeData parameter; if (atom.GetParameter(DescLevel(paramID), parameter, DESCFLAGS_GET_0) && (parameter.GetType() != DA_NIL)) { return parameter.GetReal(); } return preset; }
LONG ApplinkExporter::getParameterLong(BaseMaterial& mat, LONG paramID) { GeData parameter; if (mat.GetParameter(DescLevel(paramID), parameter, DESCFLAGS_GET_0)) { return parameter.GetLong(); } return 0; }
String ApplinkExporter::getParameterString(BaseTag& tag, LONG paramID) { GeData parameter; if (tag.GetParameter(DescLevel(paramID), parameter, DESCFLAGS_GET_0)) { return parameter.GetString(); } return ""; }
Bool PickObjectTool::GetDDescription(BaseDocument* doc, BaseContainer& data, Description* description, DESCFLAGS_DESC& flags) { Bool res = DescriptionToolData::GetDDescription(doc, data, description, flags); if (flags & DESCFLAGS_DESC_LOADED) { BaseContainer* bc; Int32 mode = data.GetInt32(MDATA_PICKOBJECT_MODE); bc = description->GetParameterI(DescLevel(MDATA_PICKOBJECT_CIRCLE_RAD), nullptr); if (bc) bc->SetInt32(DESC_HIDE, mode != MDATA_PICKOBJECT_MODE_CIRCLE); bc = description->GetParameterI(DescLevel(MDATA_PICKOBJECT_RECT_W), nullptr); if (bc) bc->SetInt32(DESC_HIDE, mode == MDATA_PICKOBJECT_MODE_CIRCLE); bc = description->GetParameterI(DescLevel(MDATA_PICKOBJECT_RECT_H), nullptr); if (bc) bc->SetInt32(DESC_HIDE, mode == MDATA_PICKOBJECT_MODE_CIRCLE); } return res; }
BaseList2D* ApplinkExporter::getParameterLink(GeListNode& node, LONG paramID, LONG instanceOf) { GeData parameter; if (node.GetParameter(DescLevel(paramID), parameter, DESCFLAGS_GET_0)) { BaseLink* link = parameter.GetBaseLink(); if (link) { return link->GetLink(node.GetDocument(), instanceOf); } } return 0; }
//The grab brush does not support the Point Radial Symmetry mode so this has to be disabled. Bool ExampleSculptGrabBrush::GetDDescription(BaseDocument* doc, BaseContainer& data, Description* description, DESCFLAGS_DESC& flags) { //Call the parent method so that the description data gets loaded in. if (!SculptBrushToolData::GetDDescription(doc, data, description, flags)) return false; //Now find and remove the Point mode from the Radial settings. AutoAlloc<AtomArray> arr; BaseContainer* cycle = description->GetParameterI(DescLevel(MDATA_SCULPTBRUSH_MIRRORING_RADIAL_MODE, DTYPE_LONG, 0), arr); if (cycle) { BaseContainer* items = cycle->GetContainerInstance(DESC_CYCLE); if (items) { items->RemoveData(MDATA_SCULPTBRUSH_MIRRORING_RADIAL_MODE_POINT); //This removes the Point radio button } } return true; }