MCPcopy Create free account
hub / github.com/GarageGames/Torque3D / setMaterialList

Method setMaterialList

Engine/source/ts/tsShapeInstance.cpp:233–255  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

231}
232
233void TSShapeInstance::setMaterialList( TSMaterialList *matList )
234{
235 // get rid of old list
236 if ( mOwnMaterialList )
237 delete mMaterialList;
238
239 mMaterialList = matList;
240 mOwnMaterialList = false;
241
242 // If the material list is already be mapped then
243 // don't bother doing the initializing a second time.
244 // Note: only check the last material instance as this will catch both
245 // uninitialised lists, as well as initialised lists that have had new
246 // materials appended
247 if ( mMaterialList && !mMaterialList->getMaterialInst( mMaterialList->size()-1 ) )
248 {
249 mMaterialList->setTextureLookupPath( mShapeResource.getPath().getPath() );
250 mMaterialList->mapMaterials();
251 Material::sAllowTextureTargetAssignment = true;
252 initMaterialList();
253 Material::sAllowTextureTargetAssignment = false;
254 }
255}
256
257void TSShapeInstance::cloneMaterialList( const FeatureSet *features )
258{

Callers 1

refreshShapeMethod · 0.80

Calls 5

getMaterialInstMethod · 0.80
setTextureLookupPathMethod · 0.80
mapMaterialsMethod · 0.80
sizeMethod · 0.45
getPathMethod · 0.45

Tested by

no test coverage detected