void CSceneEditorView::OnEditsceneAddscenenode() { CChildSceneNodeDlg ChildSceneNodeDlg; if (IDOK == ChildSceneNodeDlg.DoModal()) { HTREEITEM Selected = m_SceneManagerDlg->m_SceneTree.GetSelectedItem(); m_SceneManagerDlg->m_SceneTree.InsertItem(ChildSceneNodeDlg.m_NodeName, Selected); m_SceneManagerDlg->m_SceneTree.Expand(Selected, TVE_EXPAND); m_SceneManager->getRootSceneNode()->createChildSceneNode(Ogre::String(ChildSceneNodeDlg.m_NodeName)); if (m_Root != NULL) { m_Root->renderOneFrame(); } } }
void CSceneEditorView::OnEditsceneAddscenenode() { CChildSceneNodeDlg ChildSceneNodeDlg; if (IDOK == ChildSceneNodeDlg.DoModal()) { HTREEITEM Selected = m_SceneManagerDlg->m_SceneTree.GetSelectedItem(); Ogre::String name = m_SceneManagerDlg->m_SceneTree.GetItemText(Selected); bool entity = m_SceneManager->hasEntity(name); if(name == "Scene" && !entity) { m_SceneManagerDlg->m_SceneTree.InsertItem(ChildSceneNodeDlg.m_NodeName, Selected); m_SceneManagerDlg->m_SceneTree.Expand(Selected, TVE_EXPAND); m_SceneManager->getRootSceneNode()->createChildSceneNode(Ogre::String(ChildSceneNodeDlg.m_NodeName),Ogre::Vector3(ChildSceneNodeDlg.x,ChildSceneNodeDlg.y,ChildSceneNodeDlg.z)); } else { MessageBox("Root node not selected!","Error",0); } } }