* brushexport plugin: make comparison with 'Ignored materials' case insensitive
This commit is contained in:
parent
58c40278a8
commit
f990b5ed44
|
|
@ -12,7 +12,6 @@
|
||||||
// stuff from interface.cpp
|
// stuff from interface.cpp
|
||||||
void DestroyWindow();
|
void DestroyWindow();
|
||||||
|
|
||||||
//! TODO ignore: make case insensitive
|
|
||||||
//! TODO hide window on close
|
//! TODO hide window on close
|
||||||
namespace callbacks {
|
namespace callbacks {
|
||||||
|
|
||||||
|
|
@ -45,7 +44,10 @@ void OnExportClicked( GtkButton* button, gpointer choose_path ){
|
||||||
}
|
}
|
||||||
|
|
||||||
// get ignore list from ui
|
// get ignore list from ui
|
||||||
std::set<std::string> ignore;
|
StringSetWithLambda ignore
|
||||||
|
( []( const std::string& lhs, const std::string& rhs )->bool{
|
||||||
|
return string_less_nocase( lhs.c_str(), rhs.c_str() );
|
||||||
|
} );
|
||||||
|
|
||||||
GtkTreeView* view = GTK_TREE_VIEW( lookup_widget( GTK_WIDGET( button ), "t_materialist" ) );
|
GtkTreeView* view = GTK_TREE_VIEW( lookup_widget( GTK_WIDGET( button ), "t_materialist" ) );
|
||||||
GtkListStore* list = GTK_LIST_STORE( gtk_tree_view_get_model( view ) );
|
GtkListStore* list = GTK_LIST_STORE( gtk_tree_view_get_model( view ) );
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
class ExportData
|
class ExportData
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ExportData( const std::set<std::string>& ignorelist, collapsemode mode );
|
ExportData( const StringSetWithLambda& ignorelist, collapsemode mode );
|
||||||
virtual ~ExportData( void );
|
virtual ~ExportData( void );
|
||||||
|
|
||||||
virtual void BeginBrush( Brush& b );
|
virtual void BeginBrush( Brush& b );
|
||||||
|
|
@ -50,10 +50,10 @@ void GetShaderNameFromShaderPath( const char* path, std::string& name );
|
||||||
|
|
||||||
group* current;
|
group* current;
|
||||||
const collapsemode mode;
|
const collapsemode mode;
|
||||||
const std::set<std::string>& ignorelist;
|
const StringSetWithLambda& ignorelist;
|
||||||
};
|
};
|
||||||
|
|
||||||
ExportData::ExportData( const std::set<std::string>& _ignorelist, collapsemode _mode )
|
ExportData::ExportData( const StringSetWithLambda& _ignorelist, collapsemode _mode )
|
||||||
: mode( _mode ),
|
: mode( _mode ),
|
||||||
ignorelist( _ignorelist ){
|
ignorelist( _ignorelist ){
|
||||||
current = 0;
|
current = 0;
|
||||||
|
|
@ -160,7 +160,7 @@ const bool objs;
|
||||||
const bool weld;
|
const bool weld;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ExportDataAsWavefront( const std::set<std::string>& _ignorelist, collapsemode _mode, bool _expmat, bool _limNames, bool _objs, bool _weld )
|
ExportDataAsWavefront( const StringSetWithLambda& _ignorelist, collapsemode _mode, bool _expmat, bool _limNames, bool _objs, bool _weld )
|
||||||
: ExportData( _ignorelist, _mode ),
|
: ExportData( _ignorelist, _mode ),
|
||||||
expmat( _expmat ),
|
expmat( _expmat ),
|
||||||
limNames( _limNames ),
|
limNames( _limNames ),
|
||||||
|
|
@ -372,7 +372,7 @@ private:
|
||||||
ExportData& exporter;
|
ExportData& exporter;
|
||||||
};
|
};
|
||||||
|
|
||||||
bool ExportSelection( const std::set<std::string>& ignorelist, collapsemode m, bool exmat, const std::string& path, bool limNames, bool objs, bool weld ){
|
bool ExportSelection( const StringSetWithLambda& ignorelist, collapsemode m, bool exmat, const std::string& path, bool limNames, bool objs, bool weld ){
|
||||||
ExportDataAsWavefront exporter( ignorelist, m, exmat, limNames, objs, weld );
|
ExportDataAsWavefront exporter( ignorelist, m, exmat, limNames, objs, weld );
|
||||||
|
|
||||||
if( GlobalSelectionSystem().countSelected() == 0 ){
|
if( GlobalSelectionSystem().countSelected() == 0 ){
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,8 @@ enum collapsemode
|
||||||
COLLAPSE_NONE
|
COLLAPSE_NONE
|
||||||
};
|
};
|
||||||
|
|
||||||
bool ExportSelection( const std::set<std::string>& ignorelist, collapsemode m, bool exmat, const std::string& path, bool limitMatNames, bool objects, bool weld );
|
typedef std::set<std::string, bool (*)( const std::string&, const std::string& )> StringSetWithLambda;
|
||||||
|
|
||||||
|
bool ExportSelection( const StringSetWithLambda& ignorelist, collapsemode m, bool exmat, const std::string& path, bool limitMatNames, bool objects, bool weld );
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user