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

Method _onLoad

Engine/source/ts/tsShapeConstruct.cpp:396–427  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

394//-----------------------------------------------------------------------------
395
396void TSShapeConstructor::_onLoad(TSShape* shape)
397{
398 // Check if we should unload first
399 if ( mShape )
400 _onUnload();
401
402 #ifdef DEBUG_SPEW
403 Con::printf( "[TSShapeConstructor] attaching to shape '%s'", mShapePath.c_str() );
404 #endif
405
406 mShape = shape;
407 mChangeSet.clear();
408 mLoadingShape = true;
409
410 // Add sequences defined using field syntax
411 for ( S32 i = 0; i < mSequences.size(); i++ )
412 {
413 if ( mSequences[i].isEmpty() )
414 continue;
415
416 // Split the sequence path from the target sequence name
417 String destName;
418 String srcPath( mSequences[i] );
419 SplitSequencePathAndName( srcPath, destName );
420
421 addSequence( srcPath, destName );
422 }
423
424 // Call script function
425 onLoad_callback();
426 mLoadingShape = false;
427}
428
429//-----------------------------------------------------------------------------
430

Callers 1

_onTSShapeLoadedMethod · 0.80

Calls 6

printfFunction · 0.85
SplitSequencePathAndNameFunction · 0.85
c_strMethod · 0.45
clearMethod · 0.45
sizeMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected