closes https://github.com/assimp/assimp/issues/213: log an error instead of letting the fbx-importer crash.

pull/1545/head
Kim Kulling 2017-11-05 22:52:07 +01:00
parent b0e86d281b
commit 4a4f3fddc7
1 changed files with 10 additions and 4 deletions

View File

@ -645,7 +645,6 @@ void Converter::ConvertCameras( const Model& model )
} }
} }
void Converter::ConvertLight( const Model& model, const Light& light ) void Converter::ConvertLight( const Model& model, const Light& light )
{ {
lights.push_back( new aiLight() ); lights.push_back( new aiLight() );
@ -783,7 +782,6 @@ const char* Converter::NameTransformationComp( TransformationComp comp )
return NULL; return NULL;
} }
const char* Converter::NameTransformationCompProperty( TransformationComp comp ) const char* Converter::NameTransformationCompProperty( TransformationComp comp )
{ {
switch ( comp ) switch ( comp )
@ -2239,9 +2237,17 @@ void Converter::ConvertAnimations()
} }
} }
void Converter::RenameNode( const std::string& fixed_name, const std::string& new_name ) {
if ( node_names.find( fixed_name ) == node_names.end() ) {
FBXImporter::LogError( "Cannot rename node " + fixed_name + ", not existing.");
return;
}
if ( node_names.find( new_name ) != node_names.end() ) {
FBXImporter::LogError( "Cannot rename node " + fixed_name + " to " + new_name +", name already existing." );
return;
}
void Converter::RenameNode( const std::string& fixed_name, const std::string& new_name )
{
ai_assert( node_names.find( fixed_name ) != node_names.end() ); ai_assert( node_names.find( fixed_name ) != node_names.end() );
ai_assert( node_names.find( new_name ) == node_names.end() ); ai_assert( node_names.find( new_name ) == node_names.end() );