void ClustMod::Move( TimeValue t, Matrix3& partm, Matrix3& tmAxis, Point3& val, BOOL localOrigin) { #ifdef DESIGN_VER t=0; #endif if (tmControl==NULL) { ReplaceReference(0,NewDefaultMatrix3Controller()); NotifyDependents(FOREVER,0,REFMSG_CONTROLREF_CHANGE); } if (ip && ip->GetSubObjectLevel()==1) { SetXFormPacket pckt(val,partm,tmAxis); tmControl->SetValue(t,&pckt,TRUE,CTRL_RELATIVE); } else { if (posControl==NULL) { ReplaceReference(1,NewDefaultPositionController()); NotifyDependents(FOREVER,0,REFMSG_CONTROLREF_CHANGE); } Matrix3 ptm = partm; Interval valid; if (tmControl) tmControl->GetValue(t,&ptm,valid,CTRL_RELATIVE); posControl->SetValue(t,-VectorTransform(tmAxis*Inverse(ptm),val),TRUE,CTRL_RELATIVE); SetXFormPacket pckt(val,partm,tmAxis); tmControl->SetValue(t,&pckt,TRUE,CTRL_RELATIVE); } }
BombMod::BombMod(INode *node,BombObject *obj) { obRef = NULL; nodeRef = NULL; ReplaceReference(OB_REF,obj); ReplaceReference(NODE_REF,node); }
void CellTex::Init() { if (xyzGen) xyzGen->Reset(); else ReplaceReference(1, GetNewDefaultXYZGen()); if (texout) texout->Reset(); else ReplaceReference(2, GetNewDefaultTextureOutput()); RegisterDistanceDefault(_T("Cellular Params"), _T("Size"), 5.0f, IN_TO_M(5.0f)); float size = GetDistanceDefault(_T("Cellular Params"), _T("Size")); pblock->SetValue(cellular_size,0,size); /* pblock->SetValue(PB_CELLCOL,0,Point3(1,1,1)); pblock->SetValue(PB_DIVCOL1,0,Point3(.5f,.5f,.5f)); pblock->SetValue(PB_DIVCOL2,0,Point3(0,0,0)); pblock->SetValue(PB_SIZE,0,5.0f); pblock->SetValue(PB_SPREAD,0,0.5f); pblock->SetValue(PB_LOW,0,0.0f); pblock->SetValue(PB_MID,0,0.5f); pblock->SetValue(PB_HIGH,0,1.0f); pblock->SetValue(PB_FRACT,0,0); pblock->SetValue(PB_ITER,0,3.0f); pblock->SetValue(PB_USECELLMAP,0,1); pblock->SetValue(PB_USEDIV1MAP,0,1); pblock->SetValue(PB_USEDIV2MAP,0,1); pblock->SetValue(PB_SMOOTH,0,0.1f); pblock->SetValue(PB_ADAPT,0,1); if (paramDlg) paramDlg->pmap->SetParamBlock(pblock); */ fract = 0; ivalid.SetEmpty(); }
void Noise::Init() { if (xyzGen) xyzGen->Reset(); else ReplaceReference( XYZGEN_REF, GetNewDefaultXYZGen()); if (texout) texout->Reset(); else ReplaceReference( TEXOUT_REF, GetNewDefaultTextureOutput()); ivalid.SetEmpty(); cacheValid.SetEmpty(); macroRecorder->Disable(); // disable macrorecorder during reset SetColor(0, Color(0.0f,0.0f,0.0f), TimeValue(0)); SetColor(1, Color(1.0f,1.0f,1.0f), TimeValue(0)); noiseType = NOISE_REGULAR; #ifndef RENDER_VER RegisterDistanceDefault(_T("Noise Params"), _T("Size"), DEFAULT_NOISE_SIZE, IN_TO_M(DEFAULT_NOISE_SIZE)); float size = GetDistanceDefault(_T("Noise Params"), _T("Size")); SetSize(size, TimeValue(0)); #else SetSize(DEFAULT_NOISE_SIZE, TimeValue(0)); #endif SetPhase(.0f,TimeValue(0)); SetLevels(3.0f,TimeValue(0)); pblock->SetValue(noise_hithresh,0,1.0f); macroRecorder->Enable(); for (int i=0; i<NSUBTEX; i++) mapOn[i] = 1; }
SimpleOSMToWSMObject::SimpleOSMToWSMObject(SimpleMod *m) { mod = NULL; pblock = NULL; ivalid.SetEmpty(); ReplaceReference(0, m); ReplaceReference(1, CreateParameterBlock(descObjVer1, PBLOCK_LENGTH, 1)); }
FExtrudeMod::FExtrudeMod() { base = NULL; pblock = NULL; ReplaceReference(PBLOCK_REF, CreateParameterBlock(descVer0, PBLOCK_LENGTH, CURRENT_VERSION)); ReplaceReference(POINT_REF,NewDefaultPoint3Controller()); pblock->SetValue(PB_SCALE,0,100.0f); }
void Gradient::Init() { if (uvGen) uvGen->Reset(); else ReplaceReference( UVGEN_REF, GetNewDefaultUVGen()); if (texout) texout->Reset(); else ReplaceReference( TEXOUT_REF, GetNewDefaultTextureOutput()); ivalid.SetEmpty(); }
void M3Mat::Reset() { // char s[25]; DeleteReference(101); for(int i=0;i<100;i++) { DeleteReference(i); mTex[i] = NULL; // ReplaceReference(i,NewDefaultStdMat()); // sprintf(s,GetString(IDS_MTL_CNAME),i+1); // mTex[i]->SetName(s); } ReplaceReference(100,NewDefaultStdMat()); mTex[100]->SetName(GetString(IDS_MTL_BASE)); ParamBlockDescID *descVer = new ParamBlockDescID[101]; for(int x=0;x<100;x++){ ParamBlockDescID add; add.type=TYPE_FLOAT; add.user=NULL; add.animatable=TRUE; add.id=x; descVer[x] = add; } ParamBlockDescID add; add.type=TYPE_INT; add.user=NULL; add.animatable=FALSE; add.id=x; descVer[x] = add; // x == 100 we guess? IParamBlock *pblockMat = (IParamBlock*)CreateParameterBlock(descVer,101,1); ReplaceReference(101,pblockMat); //ReplaceReference(102,NULL); delete [] descVer; pblockMat->SetValue(100,0,0); // set param [100], the mystery param }
SampleKFCtrl::SampleKFCtrl() { // Create default X & Y controllers. These classes are // implementations of the Control class that generate float values. mpXCtrl = NULL; mpYCtrl = NULL; ReplaceReference(kXCtrlRef, NewDefaultFloatController()); ReplaceReference(kYCtrlRef, NewDefaultFloatController()); }
CExtObject::CExtObject(BOOL loading) { ReplaceReference(0, CreateParameterBlock(CExtdescVer0, PBLOCK_LENGTH, CURRENT_VERSION)); pblock->SetValue(PB_TSEGS,0,dlgTSegs); pblock->SetValue(PB_SSEGS,0,dlgSSegs); pblock->SetValue(PB_BSEGS,0,dlgBSegs); pblock->SetValue(PB_WSEGS,0,dlgWSegs); pblock->SetValue(PB_HSEGS,0,dlgHSegs); pblock->SetValue(PB_TOPLENGTH,0,crtTopLength); pblock->SetValue(PB_SIDELENGTH,0,crtSideLength); pblock->SetValue(PB_BOTLENGTH,0,crtBotLength); pblock->SetValue(PB_TOPWIDTH,0,crtTopWidth); pblock->SetValue(PB_SIDEWIDTH,0,crtSideWidth); pblock->SetValue(PB_BOTWIDTH,0,crtBotWidth); pblock->SetValue(PB_HEIGHT,0,crtHeight); pblock->SetValue(PB_GENUVS,0,TRUE); increate=FALSE;createmeth=0; #ifdef PHYSICAL_SCALE_UVS if (!loading && !GetPhysicalScaleUVsDisabled()) SetUsePhysicalScaleUVs(true); #endif }
BOOL AFRMod::AssignController(Animatable *control,int subAnim) { ReplaceReference(subAnim,(Control*)control); NotifyDependents(FOREVER,PART_GEOM,REFMSG_CHANGE); NotifyDependents(FOREVER,0,REFMSG_SUBANIM_STRUCTURE_CHANGED); return TRUE; }
void Output::Init() { ivalid.SetEmpty(); if (texout) texout->Reset(); else ReplaceReference( 1, GetNewDefaultTextureOutput()); texout->SetRollupOpen(1); mapOn[0] = 1; }
FExtrudeMod::FExtrudeMod() { mp_base = NULL; mp_pblock = NULL; ReplaceReference (kFEX_POINT_REF, NewDefaultPoint3Controller()); fextrudeDesc.MakeAutoParamBlocks(this); }
void OrientConstRotation::Copy(Control *from) { if(GetLocked()==false) { Quat fvalRot; if (from->ClassID()==ClassID()) { OrientConstRotation *ctrl = (OrientConstRotation*)from; // a copy will construct its own pblock to keep the pblock-to-owner 1-to-1. ReplaceReference(ORIENT_ROT_PBLOCK_REF, CloneRefHierarchy(ctrl->pblock)); curRot = ctrl->curRot; baseRotQuatLocal = ctrl->baseRotQuatLocal; baseRotQuatWorld = ctrl->baseRotQuatWorld; flags = ctrl->flags; mLocked = ctrl->mLocked; } else { if(from&&GetLockedTrackInterface(from)) mLocked = GetLockedTrackInterface(from)->GetLocked(); from->GetValue(GetCOREInterface()->GetTime(), &fvalRot, Interval(0, 0)); // to know the object orientation before the firstTimeFlag = 1; baseRotQuatLocal = fvalRot; baseRotQuatLocal.Normalize(); // current controller was active } ivalid.SetEmpty(); NotifyDependents(FOREVER,PART_ALL,REFMSG_CHANGE); } }
// This method is called to reset the texmap back to its default values. void Planet::Init() { // Reset the XYZGen or allocate a new one if (xyzGen) xyzGen->Reset(); else ReplaceReference(0, GetNewDefaultXYZGen()); // ReplaceReference(1, CreateParameterBlock(pbdesc, // PB_LENGTH, PLANET_PB_VERSION)); // if (paramDlg) // paramDlg->pmap->SetParamBlock(pblock); // Set the inital parameters // {10,20,80},{10,30,80},{10,40,90},{10,100,12}, // {100,80,12},{80,20,8},{100,80,50},{100,100,100} SetColor(0, Color(0.04f, 0.08f, 0.31f), TimeValue(0)); SetColor(1, Color(0.04f, 0.12f, 0.31f), TimeValue(0)); SetColor(2, Color(0.04f, 0.16f, 0.31f), TimeValue(0)); SetColor(3, Color(0.04f, 0.39f, 0.05f), TimeValue(0)); SetColor(4, Color(0.39f, 0.31f, 0.05f), TimeValue(0)); SetColor(5, Color(0.31f, 0.08f, 0.03f), TimeValue(0)); SetColor(6, Color(0.39f, 0.31f, 0.20f), TimeValue(0)); SetColor(7, Color(0.39f, 0.39f, 0.39f), TimeValue(0)); SetSize(40.0f, TimeValue(0)); SetIsland(0.5f, TimeValue(0)); SetPercent(60.0f, TimeValue(0)); SetSeed(12345, TimeValue(0)); blend = 1; // Set the validity interval of the texture to empty texValidity.SetEmpty(); }
void MatCustAttrib::SetSubTexmap(int i, Texmap *m) { if (i==0) { ReplaceReference(MAP_REF,m); param_blk.InvalidateUI(ca_color); } }
ScaleMC::ScaleMC() { ReplaceReference(0,CreateInterpScale()); bind[0] = bind[1] = bind[2] = NULL; base = Point3(1,1,1); data = NULL; }
MatMod::MatMod() { pblock = NULL; ReplaceReference(0, CreateParameterBlock(descVer0, PBLOCK_LENGTH, CURRENT_VERSION)); pblock->SetValue(PB_MATID,0,1); version = MATMOD_CURRENT_VERSION; }
HRESULT StdDualVSImp::Initialize(MNMesh *mnmesh, INode *node) { HRESULT hr; hr = S_OK; if(!node) return E_FAIL; int index = FindNodeIndex(node); if( index < 0) { caches.SetCount(caches.Count()+1); caches[caches.Count()-1] = NULL; ReplaceReference(caches.Count()-1,node); index = caches.Count()-1; } if(forceInvalid || !caches[index]->GetValid()) { forceInvalid = false; caches[index]->SetValid(true); hr = callb->InitValid(mnmesh, node); } return hr; }
void M3Mat::SetSubMtl(int i, Mtl *m) { if(m && morphp ) { if( m->ClassID() == M3MatClassID ) { M3Mat *m3m = static_cast<M3Mat *> (m); MorphR3 *mp = m3m->morphp; if(mp){ for(int j=101; j<=200; j++){ for(int k=101; k<=200; k++){ if( morphp->GetReference(j) && morphp->GetReference(j) == mp->GetReference(k) ) { if(morphp->hMaxWnd) { TSTR cyclic; cyclic = GetString(IDS_CYCLIC_MATERIAL); MessageBox(morphp->hMaxWnd,cyclic,GetString(IDS_CLASS_NAME),MB_OK); } return; } } } } } } ReplaceReference(i,m); if (matDlg) matDlg->UpdateSubMtlNames(); }
RotationMC::RotationMC() { ReplaceReference(0,CreateInterpRotation()); bind[0] = bind[1] = bind[2] = NULL; base = Point3(0,0,0); data = NULL; }
SymmetryMod::SymmetryMod() { mp_pblock = NULL; mp_mirror = NULL; mUseRampageWeldMath = false; ReplaceReference ( kSYM_MIRROR_REF, NewDefaultMatrix3Controller()); symDesc.MakeAutoParamBlocks(this); }
FloatMC::FloatMC() { ReplaceReference(0,CreateInterpFloat()); bind = NULL; base = 0.0f; data = NULL; }
ExtrudeMod::ExtrudeMod(BOOL create) { //watje new mapping ver < 4 of this modifier use the old mapping ver = 4; pblock = NULL; ReplaceReference(0, CreateParameterBlock(descVer6, PBLOCK_LENGTH, CURRENT_VERSION)); pblock->SetValue(PB_AMOUNT, TimeValue(0), dlgAmount); pblock->SetValue(PB_SEGS, TimeValue(0), dlgSegs); pblock->SetValue(PB_CAPSTART, TimeValue(0), dlgCapStart); pblock->SetValue(PB_CAPEND, TimeValue(0), dlgCapEnd); pblock->SetValue(PB_CAPTYPE, TimeValue(0), dlgCapType); pblock->SetValue(PB_OUTPUT, TimeValue(0), dlgOutput); pblock->SetValue(PB_MAPPING, TimeValue(0), dlgMapping); pblock->SetValue(PB_GEN_MATIDS, TimeValue(0), dlgGenMatIDs); pblock->SetValue(PB_USE_SHAPEIDS, TimeValue(0), dlgUseShapeIDs); pblock->SetValue(PB_SMOOTH, TimeValue(0), dlgSmooth); dlgProc.SetMod(this); #ifdef PHYSICAL_SCALE_UVS if (create) if (!GetPhysicalScaleUVsDisabled()) SetUsePhysicalScaleUVs(true); #endif }
MorphObject::MorphObject(BOOL loading) { sel = -1; morphCont = NULL; if (!loading) ReplaceReference(0,newDefaultMorphControl()); }
void CreateMorphMode::Begin(INode *n,IObjParam *i) { ReplaceReference(0,n); svNode = node; assert(node); ip = i; proc.Init(ip); theHold.Begin(); theHold.Put(new CreateMorphRestore); obj = new MorphObject; theHold.Put(new CreateMorphNotify(obj,1)); TSTR name = TSTR(_T("M_")) + node->GetName(); SetMorphTargetPacket pckt(node->GetObjectRef(),name); obj->morphCont->SetValue(0,&pckt); node->SetObjectRef(obj); theHold.Put(new CreateMorphNotify(obj,0)); theHold.Accept(IDS_DS_CREATE); obj->BeginEditParams(i,BEGIN_EDIT_CREATE,NULL); }
PinObject::PinObject() { int FToTick=(int)((float)TIME_TICKSPERSEC/(float)GetFrameRate()); ReplaceReference(0,CreateParameterBlock(descPinVer0, PBLOCK_LENGTH, CURRENT_VERSION)); assert(pblock); pblock->SetValue(PB_ONTIME,0,0); pblock->SetValue(PB_OFFTIME,0,FToTick*100); pblock->SetValue(PB_PINTYPE,0,0); }
void DonutObject::Init() { ReadyInterpParameterBlock(); // Build the interpolations parameter block in SimpleSpline ReplaceReference(USERPBLOCK, CreateParameterBlock(descVer0, PBLOCK_LENGTH, CURRENT_VERSION)); assert(pblock); pblock->SetValue(PB_RADIUS1,0,crtRadius1); pblock->SetValue(PB_RADIUS2,0,crtRadius2); }
//From MtlBase void SampleShaderPlugin::Reset() { if (uvGen) uvGen->Reset(); else ReplaceReference( 0, GetNewDefaultUVGen()); //TODO: Reset texmap back to its default values ivalid.SetEmpty(); }
void VDM::SetSubTexmap(int i, Texmap *m) { ReplaceReference(i+1,m); if(i==0) { vdm_param_blk.InvalidateUI(vdm_map_vector); ivalid.SetEmpty(); } }