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

Method setMaterialList

Engine/source/ts/tsShapeInstance.cpp:235–257  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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