Clear the properties when clearing the scene, and also deactivate the buttons and comboboxes of the material widget.

--HG--
branch : gsoc2013-dfighter
hg/feature/gsoc2013-dfighter
dfighter1985 12 years ago
parent b776409cc8
commit e99c1e2785

@ -256,7 +256,7 @@ namespace MaterialEditor
void MaterialEditorWindow::onClearSceneClicked()
{
nl3dIface->clearScene();
materialSplitter->onShapeChanged();
materialSplitter->onSceneCleared();
viewPort->stopTimedUpdates();
}

@ -75,6 +75,12 @@ namespace MaterialEditor
materialWidget->onMaterialLoaded();
}
void MaterialSplitter::onSceneCleared()
{
materialWidget->onSceneCleared();
browserCtrl->onSceneCleared();
}
void MaterialSplitter::onShapeChanged()
{
materialWidget->onShapeChanged();

@ -44,6 +44,7 @@ namespace MaterialEditor
void onNewMaterial();
void onMaterialLoaded();
void onSceneCleared();
void onShapeChanged();
void onPassAdded( const char *name );
void onPassRemoved( const char *name );

@ -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();
@ -77,6 +88,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 );
if( subMatCB->count() > 1 )

@ -33,6 +33,7 @@ namespace MaterialEditor
MaterialWidget( QWidget *parent = NULL );
~MaterialWidget();
void onSceneCleared();
void onNewMaterial();
void onMaterialLoaded();
void onShapeChanged();

@ -43,7 +43,11 @@
<item row="3" column="0">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QComboBox" name="passCB"/>
<widget class="QComboBox" name="passCB">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="passButton">
@ -74,6 +78,9 @@
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QComboBox" name="shaderCB">
<property name="enabled">
<bool>false</bool>
</property>
<item>
<property name="text">
<string/>

@ -255,6 +255,11 @@ namespace MaterialEditor
this, SLOT( onValueChanged( QtProperty*, const QVariant& ) ) );
}
void CPropBrowserCtrl::onSceneCleared()
{
clearProps();
}
void CPropBrowserCtrl::onPropsChanged()
{
clearProps();

@ -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 );

Loading…
Cancel
Save