mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-20 03:45:26 +00:00
Merge pull request #2108 from Azaezel/reskinRedux
allows for arbitrary reskinning
This commit is contained in:
commit
1f2847bc11
5 changed files with 13 additions and 7 deletions
|
|
@ -307,18 +307,21 @@ void TSShapeInstance::reSkin( String newBaseName, String oldBaseName )
|
|||
{
|
||||
// Try changing base
|
||||
const String &pName = materialNames[i];
|
||||
if ( pName.compare( oldBaseName, oldBaseNameLength, String::NoCase ) == 0 )
|
||||
{
|
||||
String newName( pName );
|
||||
newName.replace( 0, oldBaseNameLength, newBaseName );
|
||||
pMatList->renameMaterial( i, newName );
|
||||
}
|
||||
String newName( String::ToLower(pName) );
|
||||
newName.replace( String::ToLower(oldBaseName), String::ToLower(newBaseName) );
|
||||
pMatList->renameMaterial( i, newName );
|
||||
}
|
||||
|
||||
// Initialize the material instances
|
||||
initMaterialList();
|
||||
}
|
||||
|
||||
void TSShapeInstance::resetMaterialList()
|
||||
{
|
||||
TSMaterialList* oMatlist = mShape->materialList;
|
||||
setMaterialList(oMatlist);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------
|
||||
// Render & detail selection
|
||||
//-------------------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -377,7 +377,7 @@ protected:
|
|||
}
|
||||
|
||||
void reSkin( String newBaseName, String oldBaseName = String::EmptyString );
|
||||
|
||||
void resetMaterialList();
|
||||
enum
|
||||
{
|
||||
MaskNodeRotation = 0x01,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue