| 429 | } |
| 430 | |
| 431 | void GuiShapeEdPreview::setThreadSequence(GuiShapeEdPreview::Thread& thread, TSShapeInstance* shape, const char* seqName, F32 duration, F32 pos, bool play) |
| 432 | { |
| 433 | thread.seqName = seqName; |
| 434 | |
| 435 | S32 seq = shape->getShape()->findSequence( thread.seqName ); |
| 436 | if ( thread.key && ( shape->getSequence(thread.key) == seq ) ) |
| 437 | return; |
| 438 | |
| 439 | if ( seq == -1 ) |
| 440 | { |
| 441 | // This thread is now set to an invalid sequence, so the key must be |
| 442 | // removed, but we keep the thread info around in case the user changes |
| 443 | // back to a valid sequence |
| 444 | if ( thread.key ) |
| 445 | { |
| 446 | shape->destroyThread( thread.key ); |
| 447 | thread.key = NULL; |
| 448 | } |
| 449 | } |
| 450 | else |
| 451 | { |
| 452 | // Add a TSThread key if one does not already exist |
| 453 | if ( !thread.key ) |
| 454 | { |
| 455 | thread.key = shape->addThread(); |
| 456 | shape->setTimeScale( thread.key, mTimeScale * thread.direction ); |
| 457 | } |
| 458 | |
| 459 | // Transition to slider or synched position? |
| 460 | if ( pos == -1.0f ) |
| 461 | pos = shape->getPos( thread.key ); |
| 462 | |
| 463 | if ( duration == 0.0f ) |
| 464 | { |
| 465 | // No transition => go straight to new sequence |
| 466 | shape->setSequence( thread.key, seq, pos ); |
| 467 | } |
| 468 | else |
| 469 | { |
| 470 | // Get the current position if transitioning to the sync position |
| 471 | shape->setTimeScale( thread.key, thread.direction >= 0 ? 1 : -1 ); |
| 472 | shape->transitionToSequence( thread.key, seq, pos, duration, play ); |
| 473 | shape->setTimeScale( thread.key, mTimeScale * thread.direction ); |
| 474 | } |
| 475 | } |
| 476 | } |
| 477 | |
| 478 | const char* GuiShapeEdPreview::getThreadSequence() const |
| 479 | { |
nothing calls this directly
no test coverage detected