diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/material_editor_window.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/material_editor_window.cpp index 77116381a..afc0b3db0 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/material_editor_window.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/material_editor_window.cpp @@ -256,7 +256,7 @@ namespace MaterialEditor void MaterialEditorWindow::onClearSceneClicked() { nl3dIface->clearScene(); - materialSplitter->onShapeChanged(); + materialSplitter->onSceneCleared(); viewPort->stopTimedUpdates(); } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/material_splitter.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/material_splitter.cpp index 76c6ac6ad..8647c7c55 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/material_splitter.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/material_splitter.cpp @@ -75,6 +75,12 @@ namespace MaterialEditor materialWidget->onMaterialLoaded(); } + void MaterialSplitter::onSceneCleared() + { + materialWidget->onSceneCleared(); + browserCtrl->onSceneCleared(); + } + void MaterialSplitter::onShapeChanged() { materialWidget->onShapeChanged(); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/material_splitter.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/material_splitter.h index 7bf7b96b9..784245fc2 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/material_splitter.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/material_splitter.h @@ -44,6 +44,7 @@ namespace MaterialEditor void onNewMaterial(); void onMaterialLoaded(); + void onSceneCleared(); void onShapeChanged(); void onPassAdded( const char *name ); void onPassRemoved( const char *name ); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/material_widget.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/material_widget.cpp index c5f4f9911..87fcfea96 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/material_widget.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/material_widget.cpp @@ -40,6 +40,17 @@ namespace MaterialEditor matPropWidget = NULL; } + void MaterialWidget::onSceneCleared() + { + passCB->clear(); + subMatCB->clear(); + passCB->setEnabled( false ); + subMatCB->setEnabled( false ); + shaderCB->setEnabled( false ); + passButton->setEnabled( false ); + shaderButton->setEnabled( false ); + } + void MaterialWidget::onNewMaterial() { passCB->clear(); @@ -76,6 +87,11 @@ namespace MaterialEditor for( unsigned long i = 1; i < c; i++ ) subMatCB->addItem( QString::number( i ) ); + + passCB->setEnabled( true ); + shaderCB->setEnabled( true ); + passButton->setEnabled( true ); + shaderButton->setEnabled( true ); subMatCB->setCurrentIndex( 0 ); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/material_widget.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/material_widget.h index c69fbfead..e8a9ba0d7 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/material_widget.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/material_widget.h @@ -33,6 +33,7 @@ namespace MaterialEditor MaterialWidget( QWidget *parent = NULL ); ~MaterialWidget(); + void onSceneCleared(); void onNewMaterial(); void onMaterialLoaded(); void onShapeChanged(); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/material_widget.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/material_widget.ui index ccf56a214..a87614b23 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/material_widget.ui +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/material_widget.ui @@ -43,7 +43,11 @@ - + + + false + + @@ -74,6 +78,9 @@ + + false + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/prop_browser_ctrl.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/prop_browser_ctrl.cpp index 5f08ae604..bcaa88a67 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/prop_browser_ctrl.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/prop_browser_ctrl.cpp @@ -255,6 +255,11 @@ namespace MaterialEditor this, SLOT( onValueChanged( QtProperty*, const QVariant& ) ) ); } + void CPropBrowserCtrl::onSceneCleared() + { + clearProps(); + } + void CPropBrowserCtrl::onPropsChanged() { clearProps(); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/prop_browser_ctrl.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/prop_browser_ctrl.h index 6d2540123..b298a6079 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/prop_browser_ctrl.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/prop_browser_ctrl.h @@ -40,6 +40,7 @@ namespace MaterialEditor void setBrowser( QtTreePropertyBrowser *b ); void setNel3DIface( CNel3DInterface *iface ); void setupConnections(); + void onSceneCleared(); void onPropsChanged(); void clearProps(); void loadPropsForPass( const QString &pass );