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

Method _onLoad

Engine/source/ts/tsShapeConstruct.cpp:509–545  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

507//-----------------------------------------------------------------------------
508
509void TSShapeConstructor::_onLoad(TSShape* shape)
510{
511 // Check if we should unload first
512 if (mShape)
513 _onUnload();
514
515#ifdef DEBUG_SPEW
516 Con::printf("[TSShapeConstructor] attaching to shape '%s'", getShapePath());
517#endif
518
519 mShape = shape;
520 mChangeSet.clear();
521 mLoadingShape = true;
522
523 // Add sequences defined using field syntax
524 for (S32 i = 0; i < mSequenceAssetIds.size(); i++)
525 {
526 if (mSequenceAssetIds[i] == StringTable->EmptyString())
527 continue;
528
529 AssetPtr<ShapeAnimationAsset> sequenceAsset = mSequenceAssetIds[i];
530
531 if (sequenceAsset.isNull())
532 continue;
533
534 // Split the sequence path from the target sequence name
535 String destName;
536 String srcPath(sequenceAsset->getAnimationPath());
537 SplitSequencePathAndName(srcPath, destName);
538
539 addSequence(srcPath, destName);
540 }
541
542 // Call script function
543 onLoad_callback();
544 mLoadingShape = false;
545}
546
547//-----------------------------------------------------------------------------
548

Callers 1

_onTSShapeLoadedMethod · 0.80

Calls 7

printfFunction · 0.85
SplitSequencePathAndNameFunction · 0.85
EmptyStringMethod · 0.80
getAnimationPathMethod · 0.80
clearMethod · 0.45
sizeMethod · 0.45
isNullMethod · 0.45

Tested by

no test coverage detected