MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / reSkin

Method reSkin

Engine/source/T3D/shapeBase.cpp:3674–3712  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3672//----------------------------------------------------------------------------
3673
3674void ShapeBase::reSkin()
3675{
3676 if (isGhost() && mShapeInstance)
3677 {
3678 if (mSkinNameHandle.isValidString())
3679 {
3680 mShapeInstance->resetMaterialList();
3681 Vector<String> skins;
3682 String(mSkinNameHandle.getString()).split(";", skins);
3683
3684 for (S32 i = 0; i < skins.size(); i++)
3685 {
3686 String oldSkin(mAppliedSkinName.c_str());
3687 String newSkin(skins[i]);
3688
3689 // Check if the skin handle contains an explicit "old" base string. This
3690 // allows all models to support skinning, even if they don't follow the
3691 // "base_xxx" material naming convention.
3692 S32 split = newSkin.find('='); // "old=new" format skin?
3693 if (split != String::NPos)
3694 {
3695 oldSkin = newSkin.substr(0, split);
3696 newSkin = newSkin.erase(0, split + 1);
3697 }
3698 else
3699 {
3700 oldSkin = "";
3701 }
3702 mShapeInstance->reSkin(newSkin, oldSkin);
3703 mAppliedSkinName = newSkin;
3704 }
3705 }
3706 else
3707 {
3708 mShapeInstance->reSkin("", mAppliedSkinName);
3709 mAppliedSkinName = "";
3710 }
3711 }
3712}
3713
3714void ShapeBase::setCurrentWaterObject( WaterObject *obj )
3715{

Callers

nothing calls this directly

Calls 10

isValidStringMethod · 0.80
resetMaterialListMethod · 0.80
splitMethod · 0.80
substrMethod · 0.80
StringClass · 0.50
getStringMethod · 0.45
sizeMethod · 0.45
c_strMethod · 0.45
findMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected