//----------------------------------------------------------------------------- void MySample::Create() { CreateResources(); ImGui_ImplDX11_Init(GetHWnd(), GetDevice(), GetContext()); CPUTWindowWin::SetWinProcOverride(MySample_WndProcCallback); int windowWidth, windowHeight; mpWindow->GetClientDimensions(&windowWidth, &windowHeight); SampleUtil_Init(); MenuGlob_Init(); MenuGlob_SetScreenDim(windowWidth, windowHeight); MenuController_Init(); std::string userDir = GetUserDataDirectory(); #ifndef DISABLE_RSSDK MenuController_PushMenu(gMenu_Scan); // go directly to the face mapping menu //std::string debugFace; //CPUTFileSystem::CombinePath(userDir, "joe.obj", &debugFace); //gMenu_FaceMapping->LoadFace(debugFace); //MenuController_PushMenu(gMenu_FaceMapping); // Go directly to the face scan preview menu //gMenu_FaceScanPreview->LoadFaceObj("", true); //gMenu_FaceScanPreview->SetFaceScanMode( FaceScanPreviewMode_ApproveScan ); //MenuController_PushMenu(gMenu_FaceScanPreview); #else std::string debugFace; CPUTFileSystem::CombinePath(userDir, "joe_sr300_1.obj", &debugFace); gMenu_FaceMapping->LoadFace( debugFace ); MenuController_PushMenu(gMenu_FaceMapping); // go directly to the face preview menu //gMenu_FaceScanPreview->LoadFaceObj("", true); //MenuController_PushMenu(gMenu_FaceScanPreview); // go to the edit landmark menu //static CFaceModel faceModel; //faceModel.LoadObjFilename(debugFace); //gMenu_LandmarkEdit->SetInput(&faceModel.Landmarks, &faceModel.Landmarks, NULL, &faceModel); //MenuController_PushMenu(gMenu_LandmarkEdit); #endif MenuGlob_GUI()->SetActivePanel(MENU_CPUT_PANEL_ID); }
void Menu_FaceMapping::ActivationChanged(bool active) { MenuBase::ActivationChanged(active); if (active) { CPUTGuiController *pGUI = MenuGlob_GUI(); pGUI->CreateButton("Load Scan", FaceMappingMenuId_LoadScan, MENU_CPUT_PANEL_ID); pGUI->CreateButton("New Scan", FaceMappingMenuId_ScanNewFace, MENU_CPUT_PANEL_ID); pGUI->CreateButton("Save Sculpted Obj", FaceMappingMenuId_SaveSculptedObj, MENU_CPUT_PANEL_ID); pGUI->CreateButton("Show RS Mesh", FaceMappingMenuId_ShowRSMesh, MENU_CPUT_PANEL_ID); pGUI->CreateSlider("Scaling", FaceMappingMenuId_SliderScale, MENU_CPUT_PANEL_ID, &mScalingSlider, 1.0f); pGUI->CreateSlider("Yaw", FaceMappingMenuId_SliderYaw, MENU_CPUT_PANEL_ID, &mSlider_FaceYaw, 1.0f); pGUI->CreateSlider("Pitch", FaceMappingMenuId_SliderPitch, MENU_CPUT_PANEL_ID, &mSlider_FacePitch, 1.0f); pGUI->CreateSlider("Roll", FaceMappingMenuId_SliderRoll, MENU_CPUT_PANEL_ID, &mSlider_FaceRoll, 1.0f); pGUI->CreateSlider("Z Displace", FaceMappingMenuId_SliderPhysicalDisplaceOffset, MENU_CPUT_PANEL_ID, &mSlider_FacePhysicalDisplaceOffsetZ, 1.0f); pGUI->CreateButton("Select Color", FaceMappingMenuId_BaseColor, MENU_CPUT_PANEL_ID); pGUI->CreateButton("Select Color 2", FaceMappingMenuId_BaseColor2, MENU_CPUT_PANEL_ID); pGUI->CreateSlider("Hair Style", FaceMappingMenuId_SliderHairType, MENU_CPUT_PANEL_ID, &mSlider_HairType, 1.0f); mSlider_HairType->SetScale(0, (float)mHairList.size(), (int)mHairList.size()+1); pGUI->CreateButton("Reset", FaceMappingMenuId_ResetTweaks, MENU_CPUT_PANEL_ID); mScalingSlider->SetScale(0.5f, 1.5f, 21); mSlider_FaceYaw->SetScale(-20, 20, 41); mSlider_FacePitch->SetScale(-20, 20, 41); mSlider_FaceRoll->SetScale(-20, 20, 41); mSlider_FacePhysicalDisplaceOffsetZ->SetScale(-1, 1, 21); UpdateGUIFromTweaks(); } }