SimpleOSMToWSMObject::SimpleOSMToWSMObject(SimpleMod *m) { mod = NULL; pblock = NULL; ivalid.SetEmpty(); MakeRefByID(FOREVER,0,m); MakeRefByID(FOREVER, 1, CreateParameterBlock(descObjVer1, PBLOCK_LENGTH, 1)); }
WaveMod::WaveMod(INode *node,WaveObject *obj) { //MakeRefByID(FOREVER,SIMPWSMMOD_OBREF,obj); MakeRefByID(FOREVER,SIMPWSMMOD_NODEREF,node); MakeRefByID(FOREVER, SIMPWSMMOD_PBLOCKREF, CreateParameterBlock(descModVer0, MODPBLOCK_LENGTH, CURRENT_MODVERSION)); obRef = NULL; pblock->SetValue(PB_FLEX, TimeValue(0), DEF_FLEX); }
MirrorMod::MirrorMod() { tmControl = NULL; pblock = NULL; MakeRefByID( FOREVER, PBLOCK_REF, CreateParameterBlock( descVer1, PBLOCK_LENGTH, CURRENT_VERSION)); MakeRefByID(FOREVER,TM_REF,NewDefaultMatrix3Controller()); splineMethod = SPLINE_NOREVERSE; }
AFRMod::AFRMod() { MakeRefByID( FOREVER, PBLOCK_REF, CreateParameterBlock( descVer0, PBLOCK_LENGTH, CURRENT_VERSION)); p1 = p2 = NULL; MakeRefByID(FOREVER,POINT1_REF,NewDefaultPoint3Controller()); MakeRefByID(FOREVER,POINT2_REF,NewDefaultPoint3Controller()); sel[0] = sel[1] = 0; pblock->SetValue(PB_FALLOFF,0,20.0f); Point3 pt(0,0,25); p2->SetValue(0,&pt); }
WaveOMod::WaveOMod() { MakeRefByID(FOREVER, SIMPMOD_PBLOCKREF, CreateParameterBlock(descOModVer0, OMODPBLOCK_LENGTH, CURRENT_OMODVERSION)); pblock->SetValue(PB_WAVELEN,0,50.0f); }
SWrapMod::SWrapMod(INode *node,SWrapObject *obj) { // MakeRefByID(FOREVER,SIMPWSMMOD_OBREF,obj); MakeRefByID(FOREVER,SIMPWSMMOD_NODEREF,node); pblock = NULL; obRef=NULL; }
StretchMod::StretchMod() : SimpleMod() { MakeRefByID(FOREVER, SIMPMOD_PBLOCKREF, CreateParameterBlock(descVer, PBLOCK_LENGTH, 0)); pblock->SetValue(PB_AXIS, TimeValue(0), 2/*Z*/); }
SkewMod::SkewMod() : SimpleMod() { MakeRefByID(FOREVER, SIMPMOD_PBLOCKREF, CreateParameterBlock(descVer0, PBLOCK_LENGTH, CURRENT_VERSION)); pblock->SetValue(PB_AXIS, TimeValue(0), 2/*Z*/); }
PinObject::PinObject() { int FToTick=(int)((float)TIME_TICKSPERSEC/(float)GetFrameRate()); MakeRefByID(FOREVER, 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); }
PBombMod::PBombMod(INode *node,PBombObject *obj) { //MakeRefByID(FOREVER,SIMPWSMMOD_OBREF,obj); MakeRefByID(FOREVER,SIMPWSMMOD_NODEREF,node); seed=12345; pblock = NULL; obRef = NULL; }
SingleSampler::SingleSampler() { MakeRefByID(FOREVER, 0, CreateParameterBlock(pbDesc, PBLOCK_LENGTH, CURRENT_VERSION)); DbgAssert(pParamBlk); pParamBlk->SetValue(PB_QUALITY, 0, 0 ); n = 1; setMask( mask, ALL_ONES ); }
EllipseObject::EllipseObject() : SimpleSpline() { ReadyInterpParameterBlock(); // Build the interpolations parameter block in SimpleSpline MakeRefByID(FOREVER, USERPBLOCK, CreateParameterBlock(descVer0, PBLOCK_LENGTH, CURRENT_VERSION)); assert(pblock); pblock->SetValue(PB_LENGTH,0,crtLength); pblock->SetValue(PB_WIDTH,0,crtWidth); }
TriPatchObject::TriPatchObject() { MakeRefByID(FOREVER, 0, CreateParameterBlock(descVer1, PBLOCK_LENGTH, CURRENT_VERSION)); pblock->SetValue(PB_LENGTH,0,crtLength); pblock->SetValue(PB_WIDTH,0,crtWidth); pblock->SetValue(PB_TEXTURE,0,dlgTexture); ivalid.SetEmpty(); creating = 0; }
bool PFOperatorMaterialStatic::SetMaterial(Mtl* mtl) { if (mtl == NULL) { return DeleteReference(kMaterialStatic_reference_material) == REF_SUCCEED; } else { if (material()) return ReplaceReference(kMaterialStatic_reference_material, mtl) == REF_SUCCEED; else return MakeRefByID(FOREVER, kMaterialStatic_reference_material, mtl) == REF_SUCCEED; } }
OptMod::OptMod() { MakeRefByID(FOREVER, 0, CreateParameterBlock(descVer2, PBLOCK_LENGTH, CURRENT_VERSION)); pblock->SetValue(PB_FACETHRESH1,0,DegToRad(4.0f)); pblock->SetValue(PB_EDGETHRESH1,0,DegToRad(1.0f)); pblock->SetValue(PB_BIAS1,0,0.1f); pblock->SetValue(PB_FACETHRESH2,0,DegToRad(4.0f)); pblock->SetValue(PB_EDGETHRESH2,0,DegToRad(1.0f)); pblock->SetValue(PB_BIAS2,0,0.1f); pblock->SetValue(PB_MANUPDATE,0,0); forceUpdate = FALSE; }
TouchSensorObject::TouchSensorObject() : HelperObject() { IParamBlock* pb = CreateParameterBlock(descVer0, PB_TS_LENGTH, CURRENT_VERSION); pb->SetValue(PB_TS_SIZE, 0, 0.0f); pb->SetValue(PB_TS_ENABLED, 0, TRUE); pb->SetValue(PB_TS_NUMOBJS, 0, 0); MakeRefByID(FOREVER, 0, pb); assert(pblock); previousMode = NULL; triggerObject = NULL; objects.SetCount(0); BuildObjectList(this); }
HelixObject::HelixObject() : SimpleShape() { ReadyGeneralParameters(); // Build the general parameter block in SimpleShape MakeRefByID(FOREVER, USERPBLOCK, CreateParameterBlock(descVer0, PBLOCK_LENGTH, CURRENT_VERSION)); assert(pblock); pblock->SetValue(PB_RADIUS1,0,crtRadius1); pblock->SetValue(PB_RADIUS2,0,crtRadius2); pblock->SetValue(PB_HEIGHT,0,crtHeight); pblock->SetValue(PB_TURNS,0,dlgTurns); pblock->SetValue(PB_BIAS,0,dlgBias); pblock->SetValue(PB_DIRECTION,0,dlgDirection); interpValid.SetEmpty(); }
AudioP3Dlg::AudioP3Dlg(AudioP3Control *cont, ParamDimensionBase *dim, IObjParam *ip, HWND hParent) { this->cont = cont; this->ip = ip; this->dim = dim; valid = FALSE; // Create a reference to the controller MakeRefByID(FOREVER,0,cont); // Create the dialog box hWnd = CreateDialogParam( hInstance, MAKEINTRESOURCE(IDD_AUDIOPOINT3PARAMS), hParent, AudioP3DlgProc, (LPARAM)this); }
SWrapObject::SWrapObject() { TimeValue tpf=GetTicksPerFrame(); MakeRefByID(FOREVER, 0, CreateParameterBlock(SWrapdescVer0, PBLOCK_LENGTH, CURRENT_VERSION)); assert(pblock); cmValid.SetEmpty(); srand(12345); custname=TSTR(_T(" ")); custnode=NULL; cmesh=NULL; tm.IdentityMatrix(); vnorms.ZeroCount(); fnorms.ZeroCount(); pblock->SetValue(PB_KIDEFAULT,0,0.0f); pblock->SetValue(PB_USESELVERTS,0,0); pblock->SetValue(PB_STANDOFF,0,1.0f); }
PBombObject::PBombObject() { int FToTick=(int)((float)TIME_TICKSPERSEC/(float)GetFrameRate()); MakeRefByID(FOREVER, 0, CreateParameterBlock(descVer1, PBLOCK_LENGTH, CURRENT_VERSION)); assert(pblock); ff = NULL; mf = NULL; pblock->SetValue(PB_SYMMETRY,0,0); pblock->SetValue(PB_CHAOS,0,0.10f); pblock->SetValue(PB_STARTTIME,0,FToTick*30); pblock->SetValue(PB_LASTSFOR,0,FToTick); pblock->SetValue(PB_DELTA_V,0,1.0f); pblock->SetValue(PB_DECAY,0,1000.0f); pblock->SetValue(PB_DECAYTYPE,0,1); srand(12345); }
BackgroundObject::BackgroundObject() : HelperObject() { IParamBlock* pb = CreateParameterBlock(descVer0, PB_BG_LENGTH, CURRENT_VERSION); pb->SetValue(PB_SKY_NUM_COLORS, 0, 0); pb->SetValue(PB_SKY_COLOR1 , 0, Point3(0.0f, 0.0f, 1.0f)); pb->SetValue(PB_SKY_COLOR2 , 0, Point3(1.0f, 0.0f, 0.0f)); pb->SetValue(PB_SKY_COLOR3 , 0, Point3(0.0f, 1.0f, 0.0f)); pb->SetValue(PB_SKY_COLOR2_ANGLE, 0, float(PI/4.0)); pb->SetValue(PB_SKY_COLOR3_ANGLE, 0, float(PI/2.0)); pb->SetValue(PB_GROUND_NUM_COLORS, 0, 0); pb->SetValue(PB_GROUND_COLOR1 , 0, Point3(0.7f, 0.4f, 0.3f)); pb->SetValue(PB_GROUND_COLOR2 , 0, Point3(1.0f, 0.0f, 0.0f)); pb->SetValue(PB_GROUND_COLOR3 , 0, Point3(0.0f, 1.0f, 0.0f)); pb->SetValue(PB_GROUND_COLOR2_ANGLE, 0, float(PI/4.0)); pb->SetValue(PB_GROUND_COLOR3_ANGLE, 0, float(PI/2.0)); MakeRefByID(FOREVER, 0, pb); assert(pblock); }
ChCylinderObject::ChCylinderObject() { MakeRefByID(FOREVER, 0, CreateParameterBlock(chcyldescVer0, PBLOCK_LENGTH, CURRENT_VERSION)); pblock->SetValue(PB_RADIUS,0,crtRadius); pblock->SetValue(PB_HEIGHT,0,crtHeight); pblock->SetValue(PB_FILLET,0,crtFillet); pblock->SetValue(PB_HSEGS,0,dlgHSegs); pblock->SetValue(PB_FSEGS,0,dlgFSegs); pblock->SetValue(PB_SIDES,0,dlgSides); pblock->SetValue(PB_CSEGS,0,dlgCSegs); pblock->SetValue(PB_SMOOTHON,0,dlgSmooth); pblock->SetValue(PB_SLICEON,0,dlgSlice); pblock->SetValue(PB_SLICEFROM,0,crtSliceFrom); pblock->SetValue(PB_SLICETO,0,crtSliceTo); pblock->SetValue(PB_GENUVS,0,TRUE); increate=FALSE; }
Cal3DObject::Cal3DObject() : HelperObject() { scale = 1.0f; coreHelper = NULL; cal3d_cfg = _T(""); if (cores == NULL) cores = new Cal3DCoreHelpers(); pblock = NULL; IParamBlock *pb = CreateParameterBlock(descVer0, PB_CAL_LENGTH, CURRENT_VERSION); pb->SetValue(PB_CAL_SIZE, 0, 1.0f); pb->SetValue(PB_CAL_ANIM, 0, 0); pb->SetValue(PB_CAL_ACTION, 0, 1); #if MAX_PRODUCT_VERSION_MAJOR > 8 ReplaceReference(0, pb); #else MakeRefByID(FOREVER, 0, pb); #endif assert(pblock); previousMode = NULL; }
SwitchObject::SwitchObject() : HelperObject() { pblock = NULL; IParamBlock *pb = CreateParameterBlock(descVer0, PB_S_LENGTH, CURRENT_VERSION); pb->SetValue(PB_S_SIZE, 0, 0.0f); pb->SetValue(PB_S_NUMOBJS, 0, 0); pb->SetValue(PB_S_DEFAULT, 0, -1); pb->SetValue(PB_S_ALLOW_NONE, 0, TRUE); #if MAX_PRODUCT_VERSION_MAJOR > 8 ReplaceReference(0, pb); #else MakeRefByID(FOREVER, 0, pb); #endif assert(pblock); previousMode = NULL; // triggerObject = NULL; objects.SetCount(0); BuildObjectList(this); needsScript = true; }
WaveObject::WaveObject() { MakeRefByID(FOREVER, 0, CreateParameterBlock(descObjVer1, OBJPBLOCK_LENGTH, CURRENT_OBJVERSION)); assert(pblock); }
int CreateSWrapObjectProc::proc(HWND hwnd,int msg,int point,int flag, IPoint2 m ) { int res=TRUE; ViewExp *vpx = createInterface->GetViewport(hwnd); assert( vpx ); #ifdef _3D_CREATE DWORD snapdim = SNAP_IN_3D; #else DWORD snapdim = SNAP_IN_PLANE; #endif switch ( msg ) { case MOUSE_POINT: switch ( point ) { case 0: assert( SWrapObj ); vpx->CommitImplicitGrid(m, flag ); if ( createInterface->SetActiveViewport(hwnd) ) { return FALSE; } if (createInterface->IsCPEdgeOnInView()) { res = FALSE; goto done; } if ( attachedToNode ) { // send this one on its way #ifdef _OSNAP SWrapObj->ClearAFlag(A_OBJ_LONG_CREATE); #endif SWrapObj->EndEditParams( (IObjParam*)createInterface, 0, NULL); if (SWrapNode) { theHold.Suspend(); DeleteReference(0); theHold.Resume(); } // new object CreateNewObject(); // creates SWrapObj } theHold.Begin(); // begin hold for undo mat.IdentityMatrix(); // link it up SWrapNode = createInterface->CreateObjectNode( SWrapObj); attachedToNode = TRUE; assert( SWrapNode ); createCB = NULL; createInterface->SelectNode( SWrapNode ); // Reference the new node so we'll get notifications. theHold.Suspend(); MakeRefByID( FOREVER, 0, SWrapNode); theHold.Resume(); mat.IdentityMatrix(); default: res = createmethod(vpx,msg,point,flag,m,mat); createInterface->SetNodeTMRelConstPlane(SWrapNode, mat); if (res==CREATE_ABORT) goto abort; if (res==CREATE_STOP){ #ifdef _OSNAP SWrapObj->ClearAFlag(A_OBJ_LONG_CREATE); #endif theHold.Accept(GetString(IDS_AP_CREATE)); } createInterface->RedrawViews(createInterface->GetTime()); break; } break; case MOUSE_MOVE: res = createmethod(vpx,msg,point,flag,m,mat); createInterface->SetNodeTMRelConstPlane(SWrapNode, mat); if (res==CREATE_ABORT) goto abort; if (res==CREATE_STOP){ #ifdef _OSNAP SWrapObj->ClearAFlag(A_OBJ_LONG_CREATE); #endif theHold.Accept(GetString(IDS_AP_CREATE)); } createInterface->RedrawViews(createInterface->GetTime()); break; /* res = createmethod(vpx,msg,point,flag,m,mat); createInterface->SetNodeTMRelConstPlane(SWrapNode, mat); if (res==CREATE_ABORT) goto abort; if (res==CREATE_STOP) theHold.Accept(GetString(IDS_AP_CREATE)); createInterface->RedrawViews(createInterface->GetTime()); break;*/ case MOUSE_PROPCLICK: createInterface->SetStdCommandMode(CID_OBJMOVE); break; case MOUSE_ABORT: abort: assert( SWrapObj ); #ifdef _OSNAP SWrapObj->ClearAFlag(A_OBJ_LONG_CREATE); #endif SWrapObj->EndEditParams( (IObjParam*)createInterface,0,NULL); theHold.Cancel(); // deletes both the object and target. if (theHold.GetGlobalPutCount()!=lastPutCount) GetSystemSetting(SYSSET_CLEAR_UNDO); SWrapNode = NULL; createInterface->RedrawViews(createInterface->GetTime()); CreateNewObject(); attachedToNode = FALSE; res = FALSE; break; case MOUSE_FREEMOVE: SetCursor(LoadCursor(hInstance, MAKEINTRESOURCE(IDC_CROSS_HAIR))); #ifdef _OSNAP //PREVIEW SNAP res = createmethod(vpx,msg,point,flag,m,mat); #endif vpx->TrackImplicitGrid(m); break; } done: if ((res == CREATE_STOP)||(res==CREATE_ABORT)) vpx->ReleaseImplicitGrid(); createInterface->ReleaseViewport(vpx); return res; }
SpherifyMod::SpherifyMod() { MakeRefByID(FOREVER, 0, CreateParameterBlock(descVer0, PBLOCK_LENGTH, CURRENT_VERSION)); pblock->SetValue(PB_PERCENT, 0, 100.0f); }