mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-01-19 20:24:49 +00:00
Merge pull request #2108 from Azaezel/reskinRedux
allows for arbitrary reskinning
This commit is contained in:
commit
1f2847bc11
|
|
@ -1953,6 +1953,7 @@ void Player::reSkin()
|
|||
{
|
||||
if ( isGhost() && mShapeInstance && mSkinNameHandle.isValidString() )
|
||||
{
|
||||
mShapeInstance->resetMaterialList();
|
||||
Vector<String> skins;
|
||||
String(mSkinNameHandle.getString()).split( ";", skins );
|
||||
|
||||
|
|
|
|||
|
|
@ -3689,6 +3689,7 @@ void ShapeBase::reSkin()
|
|||
{
|
||||
if ( isGhost() && mShapeInstance && mSkinNameHandle.isValidString() )
|
||||
{
|
||||
mShapeInstance->resetMaterialList();
|
||||
Vector<String> skins;
|
||||
String(mSkinNameHandle.getString()).split( ";", skins );
|
||||
|
||||
|
|
|
|||
|
|
@ -537,6 +537,7 @@ void TSStatic::reSkin()
|
|||
{
|
||||
if ( isGhost() && mShapeInstance && mSkinNameHandle.isValidString() )
|
||||
{
|
||||
mShapeInstance->resetMaterialList();
|
||||
Vector<String> skins;
|
||||
String(mSkinNameHandle.getString()).split( ";", skins );
|
||||
|
||||
|
|
|
|||
|
|
@ -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…
Reference in a new issue