MorphByBone::MorphByBone() { suspendUI = FALSE; currentBone = -1; currentMorph = -1; editMorph = FALSE; pauseAccessor = FALSE; pasteMode = FALSE; pblock = NULL; MorphByBoneDesc.MakeAutoParamBlocks(this); ICurveCtl* curveCtl = (ICurveCtl *) CreateInstance(REF_MAKER_CLASS_ID,CURVE_CONTROL_CLASS_ID); pblock->SetValue(pb_selectiongraph,0,curveCtl); curveCtl->RegisterResourceMaker((ReferenceMaker *)this); DWORD flags = CC_NONE; flags |= CC_DRAWBG ; flags |= CC_DRAWGRID ; flags |= CC_DRAWUTOOLBAR ; flags |= CC_AUTOSCROLL ; flags |= CC_RCMENU_MOVE_XY ; flags |= CC_RCMENU_MOVE_X ; flags |= CC_RCMENU_MOVE_Y ; flags |= CC_RCMENU_SCALE ; flags |= CC_RCMENU_INSERT_CORNER ; flags |= CC_RCMENU_INSERT_BEZIER ; flags |= CC_RCMENU_DELETE ; curveCtl->SetCCFlags(flags); ResetSelectionGraph(); }
BlurMgr::BlurMgr() : pbMaster(NULL), pbBlurData(NULL), pbSelData(NULL), mp_CCtl(NULL), m_lastBMModifyID(0xFFFFFFFF), m_imageW(0), m_imageH(0), m_imageSz(0), m_compValid(false) // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- { m_blurs[idBlurUnif] = new BlurUniform(this); m_blurs[idBlurDir] = new BlurDirectional(this); m_blurs[idBlurRadial] = new BlurRadial(this); m_sels[idSelImage] = new SelImage(this); m_sels[idSelIBack] = new SelIgnBack(this); m_sels[idSelLum] = new SelLum(this); m_sels[idSelMask] = new SelMaps(this); m_sels[idSelObjIds] = new SelObjIds(this); m_sels[idSelMatIds] = new SelMatIds(this); // this added to allow extension of seltypes -- adding new param active ids breaks the original sequential enumeration // i should have enumerated the param ids sparsely to allow for extensibility. // if they are added sequentially, it changes the value of old param ids and will break loading of old versions m_selActiveIds[idSelImage] = prmImageActive; m_selActiveIds[idSelIBack] = prmIBackActive; m_selActiveIds[idSelLum] = prmLumActive; m_selActiveIds[idSelMask] = prmMaskActive; m_selActiveIds[idSelObjIds] = prmObjIdsActive; m_selActiveIds[idSelMatIds] = prmMatIdsActive; // set default blur radial origin to coincide with current render settings pbdBlurData.ParamOption(prmRadialXOrig, p_default, GetCOREInterface()->GetRendWidth()/2); pbdBlurData.ParamOption(prmRadialYOrig, p_default, GetCOREInterface()->GetRendHeight()/2); blurMgrCD.MakeAutoParamBlocks(this); assert( pbMaster && pbBlurData && pbSelData); // create a curve control and reference it ICurveCtl *pICurveCtl = (ICurveCtl*)CreateInstance(REF_MAKER_CLASS_ID, CURVE_CONTROL_CLASS_ID); assert (pICurveCtl); ReplaceReference(idSelCurveCtrl, pICurveCtl); pICurveCtl->RegisterResourceMaker(this); pICurveCtl->SetCCFlags(CC_DRAWUTOOLBAR | CC_CONSTRAIN_Y | CC_SHOWRESET/*| CC_RCMENU_MOVE_XY | CC_RCMENU_MOVE_X | CC_RCMENU_MOVE_Y | CC_RCMENU_SCALE | CC_RCMENU_INSERT_CORNER | CC_RCMENU_INSERT_BEZIER | CC_RCMENU_DELETE*/); pICurveCtl->SetXRange(0.0f,1.0f); pICurveCtl->SetYRange(0.0f,1.0f); BitArray ba; ba.SetSize(32); ba.Set(0); ba.Clear(1); pICurveCtl->SetDisplayMode(ba); pICurveCtl->SetNumCurves(2); pICurveCtl->SetScrollValues(2, -44); pICurveCtl->SetZoomValues(133, 117); }
void MorphByBone::BringUpGraph(int whichBone, int whichMorph) { if ((whichBone < 0) || (whichBone >= boneData.Count()) || (whichMorph < 0) || (whichMorph >= boneData[whichBone]->morphTargets.Count())) { return; } //see if we need to create a graph if (boneData[whichBone]->morphTargets[whichMorph]->externalFalloffID==-1) boneData[currentBone]->morphTargets[currentMorph]->CreateGraph(this,pblock); //get the ref ReferenceTarget *ref = NULL; int refID = boneData[whichBone]->morphTargets[whichMorph]->externalFalloffID; if ((refID < 0) || (refID >= pblock->Count(pb_falloffgraphlist))) return; pblock->GetValue(pb_falloffgraphlist,0,ref,FOREVER,refID); if (ref == NULL) return; ICurveCtl *graph = (ICurveCtl *) ref; //rename the window to the morph name graph->SetTitle(boneData[currentBone]->morphTargets[currentMorph]->name); graph->SetCustomParentWnd(GetDlgItem(rollupPropHWND, IDC_EDITGRAPH)); graph->SetMessageSink(rollupPropHWND); //pop it up graph->SetCCFlags(CC_ASPOPUP|CC_DRAWBG|CC_DRAWSCROLLBARS|CC_AUTOSCROLL|CC_DRAWUTOOLBAR| CC_DRAWRULER|CC_DRAWGRID|CC_DRAWLTOOLBAR|CC_SHOW_CURRENTXVAL|CC_ALL_RCMENU|CC_SINGLESELECT|CC_NOFILTERBUTTONS); if (graph->IsActive()) graph->SetActive(FALSE); else { graph->SetActive(TRUE); graph->ZoomExtents(); } }
INT_PTR MorphByBoneParamsMapDlgProcSoftSelection::DlgProc(TimeValue t,IParamMap2 *map,HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam) { switch (msg) { case WM_INITDIALOG: { ICurveCtl *curveCtl = mod->GetCurveCtl(); curveCtl->SetCustomParentWnd(GetDlgItem(hWnd, IDC_CURVE)); curveCtl->SetMessageSink(hWnd); curveCtl->SetActive(TRUE); break; } case WM_COMMAND: { switch (LOWORD(wParam)) { case IDC_LOOP_BUTTON: { macroRecorder->FunctionCall(_T("$.modifiers[#Skin_Morph].skinMorphOps.loop"), 0, 0); mod->EdgeSel(TRUE); break; } case IDC_RING_BUTTON: { macroRecorder->FunctionCall(_T("$.modifiers[#Skin_Morph].skinMorphOps.ring"), 0, 0); mod->EdgeSel(FALSE); break; } case IDC_SHRINK_BUTTON: { macroRecorder->FunctionCall(_T("$.modifiers[#Skin_Morph].skinMorphOps.shrink"), 0, 0); mod->GrowVerts(FALSE); break; } case IDC_GROW_BUTTON: { macroRecorder->FunctionCall(_T("$.modifiers[#Skin_Morph].skinMorphOps.grow"), 0, 0); mod->GrowVerts(TRUE); break; } case IDC_RESETGRAPH_BUTTON: { macroRecorder->FunctionCall(_T("$.modifiers[#Skin_Morph].skinMorphOps.resetSelectionGraph"), 0, 0); mod->ResetSelectionGraph(); break; } } break; } } return FALSE; }