| 507 | //----------------------------------------------------------------------------- |
| 508 | |
| 509 | void 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 |
no test coverage detected