本文整理汇总了C++中TStageObject类的典型用法代码示例。如果您正苦于以下问题:C++ TStageObject类的具体用法?C++ TStageObject怎么用?C++ TStageObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TStageObject类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setKeyframes
void TKeyframeSelection::setKeyframes() {
TApp *app = TApp::instance();
TXsheetHandle *xsheetHandle = app->getCurrentXsheet();
TXsheet *xsh = xsheetHandle->getXsheet();
TStageObjectId cameraId = xsh->getStageObjectTree()->getCurrentCameraId();
if (isEmpty()) return;
Position pos = *m_positions.begin();
int row = pos.first;
int col = pos.second;
TStageObjectId id = col < 0 ? cameraId : TStageObjectId::ColumnId(col);
TStageObject *pegbar = xsh->getStageObject(id);
if (!pegbar) return;
if (pegbar->isKeyframe(row)) {
TStageObject::Keyframe key = pegbar->getKeyframe(row);
pegbar->removeKeyframeWithoutUndo(row);
UndoRemoveKeyFrame *undo =
new UndoRemoveKeyFrame(id, row, key, xsheetHandle);
undo->setObjectHandle(app->getCurrentObject());
TUndoManager::manager()->add(undo);
} else {
pegbar->setKeyframeWithoutUndo(row);
UndoSetKeyFrame *undo = new UndoSetKeyFrame(id, row, xsheetHandle);
undo->setObjectHandle(app->getCurrentObject());
TUndoManager::manager()->add(undo);
}
TApp::instance()->getCurrentScene()->setDirtyFlag(true);
TApp::instance()->getCurrentObject()->notifyObjectIdChanged(false);
}
示例2: visit
void Stage::visit(Visitor &visitor, const VisitArgs &args) {
ToonzScene *scene = args.m_scene;
TXsheet *xsh = args.m_xsh;
int row = args.m_row;
int col = args.m_col;
const OnionSkinMask *osm = args.m_osm;
bool camera3d = args.m_camera3d;
int xsheetLevel = args.m_xsheetLevel;
bool isPlaying = args.m_isPlaying;
StageBuilder sb;
sb.m_vs = &visitor.m_vs;
TStageObjectId cameraId = xsh->getStageObjectTree()->getCurrentCameraId();
TStageObject *camera = xsh->getStageObject(cameraId);
TAffine cameraAff = camera->getPlacement(row);
double z = camera->getZ(row);
sb.m_cameraPlacement = ZPlacement(cameraAff, z);
sb.m_camera3d = camera3d;
sb.m_currentColumnIndex = col;
sb.m_xsheetLevel = xsheetLevel;
sb.m_onionSkinMask = *osm;
Player::m_onionSkinFrontSize = 0;
Player::m_onionSkinBackSize = 0;
sb.addFrame(sb.m_players, scene, xsh, row, 0, args.m_onlyVisible,
args.m_checkPreviewVisibility);
updateOnionSkinSize(sb.m_players);
sb.visit(sb.m_players, visitor, isPlaying);
}
示例3: assert
//-----------------------------------------------------------------------------
// data <- xsheet
void TKeyframeData::setKeyframes(std::set<Position> positions, TXsheet *xsh)
{
if (positions.empty())
return;
TStageObjectId cameraId = xsh->getStageObjectTree()->getCurrentCameraId();
std::set<Position>::iterator it = positions.begin();
int r0 = it->first;
int c0 = it->second;
for (++it; it != positions.end(); ++it) {
r0 = std::min(r0, it->first);
c0 = std::min(c0, it->second);
}
for (it = positions.begin(); it != positions.end(); ++it) {
int row = it->first;
int col = it->second;
TStageObject *pegbar = xsh->getStageObject(col >= 0 ? TStageObjectId::ColumnId(col) : cameraId);
assert(pegbar);
m_isPegbarsCycleEnabled[col] = pegbar->isCycleEnabled();
if (pegbar->isKeyframe(row)) {
Position p(row - r0, col - c0);
TStageObject::Keyframe k = pegbar->getKeyframe(row);
m_keyData[p] = k;
}
}
}
示例4: getStageObject
bool ViewerKeyframeNavigator::hasPrev() const {
TStageObject *pegbar = getStageObject();
if (!pegbar) return false;
int r0, r1;
pegbar->getKeyframeRange(r0, r1);
return r0 <= r1 && getCurrentFrame() > r0;
}
示例5: storeColumn
void TColumnDataElement::storeColumn(TXsheet *xsh, int index, int fxFlags)
{
if (index < 0)
return;
bool doClone = (fxFlags & eDoClone);
bool resetFxDagPositions = (fxFlags & eResetFxDagPositions);
// Fetch the specified column (if none, return)
TStageObject *obj = xsh->getStageObject(TStageObjectId::ColumnId(index));
assert(obj);
TXshColumn *column = xsh->getColumn(index);
if (!column)
return;
TFx *fx = column->getFx();
TPointD dagPos;
if (fx)
dagPos = fx->getAttributes()->getDagNodePos();
if (doClone)
column = column->clone(); // Zerary fxs clone the associated fx (drawn levels do not)
if (fx && !resetFxDagPositions)
column->getFx()->getAttributes()->setDagNodePos(dagPos);
m_column = column;
storeObject(obj->getId(), xsh);
}
示例6: magicLink
void SkeletonTool::magicLink(int index)
{
if (index < 0 || index >= (int)m_magicLinks.size())
return;
HookData h0 = m_magicLinks[index].m_h0;
HookData h1 = m_magicLinks[index].m_h1;
TTool::Application *app = TTool::getApplication();
TXsheet *xsh = app->getCurrentXsheet()->getXsheet();
int columnIndex = app->getCurrentColumn()->getColumnIndex();
TStageObjectId id = TStageObjectId::ColumnId(columnIndex);
TStageObject *obj = xsh->getStageObject(id);
int parentColumnIndex = h1.m_columnIndex;
TStageObjectId parentId = TStageObjectId::ColumnId(parentColumnIndex);
std::string parentHandle = h1.getHandle();
std::string handle = "";
if (h0.m_columnIndex < 0) {
handle = obj->getHandle();
} else {
handle = h0.getHandle();
}
//TUndoManager *undoManager = TUndoManager::manager();
//undoManager->beginBlock();
TStageObjectCmd::setHandle(id, handle, app->getCurrentXsheet());
TStageObjectCmd::setParent(id, parentId, parentHandle, app->getCurrentXsheet());
//undoManager->endBlock();
}
示例7: getStageObject
bool ViewerKeyframeNavigator::isFullKeyframe() const
{
TStageObject *pegbar = getStageObject();
if (!pegbar)
return false;
return pegbar->isFullKeyframe(getCurrentFrame());
}
示例8: addBoneId
void addBoneId(const TStageObjectId &id)
{
TStageObject *stageObject = getXsheet()->getStageObject(id);
if (stageObject) {
TStageObject::Keyframe k = stageObject->getKeyframe(m_frame);
m_keyframes.push_back(std::make_pair(id, k));
}
}
示例9: onSplineChanged
void TApp::onSplineChanged()
{
if (m_currentObject->isSpline()) {
TXsheet *xsh = m_currentXsheet->getXsheet();
TStageObject *currentObject = xsh->getStageObject(m_currentObject->getObjectId());
currentObject->setOffset(currentObject->getOffset()); //invalidate currentObject
}
}
示例10: storeObject
void TStageObjectDataElement::storeObject(const TStageObjectId &objId, TXsheet *xsh)
{
// Search the object in the xsheet (false = don't create a new one)
TStageObject *obj = xsh->getStageObjectTree()->getStageObject(objId, false);
assert(obj);
m_params = obj->getParams();
m_dagPos = obj->getDagNodePos();
}
示例11: storeCamera
void TCameraDataElement::storeCamera(const TStageObjectId &selectedObj, TXsheet *xsh)
{
TStageObject *obj = xsh->getStageObjectTree()->getStageObject(selectedObj, false);
assert(obj);
m_params = obj->getParams();
m_camera = *(obj->getCamera());
m_dagPos = obj->getDagNodePos();
}
示例12: selectCellKeyframe
void TCellKeyframeSelection::selectCellKeyframe(int row, int col) {
m_cellSelection->selectCell(row, col);
TXsheet *xsh = m_xsheetHandle->getXsheet();
TStageObjectId id =
col < 0 ? TStageObjectId::CameraId(0) : TStageObjectId::ColumnId(col);
TStageObject *stObj = xsh->getStageObject(id);
m_keyframeSelection->clear();
if (stObj->isKeyframe(row)) m_keyframeSelection->select(row, col);
}
示例13: onObjectSwitched
void TApp::onObjectSwitched() {
if (m_currentObject->isSpline()) {
TXsheet *xsh = m_currentXsheet->getXsheet();
TStageObject *currentObject =
xsh->getStageObject(m_currentObject->getObjectId());
TStageObjectSpline *ps = currentObject->getSpline();
m_currentObject->setSplineObject(ps);
} else
m_currentObject->setSplineObject(0);
onImageChanged();
}
示例14: assert
void StageBuilder::addFrame(PlayerSet &players, ToonzScene *scene, TXsheet *xsh,
int row, int level, bool includeUnvisible,
bool checkPreviewVisibility) {
int columnCount = xsh->getColumnCount();
unsigned int maskCount = m_masks.size();
std::vector<std::pair<double, int>> shuffle;
for (int c = 0; c < columnCount; c++) {
TXshColumnP column = xsh->getColumn(c);
assert(column);
TStageObject *pegbar = xsh->getStageObject(TStageObjectId::ColumnId(c));
double columnSO = pegbar->getSO(row);
shuffle.push_back(std::make_pair(columnSO, c));
}
std::stable_sort(shuffle.begin(), shuffle.end(), StackingOrder());
for (int i = 0; i < columnCount; i++) {
int c = shuffle[i].second;
if (CameraTestCheck::instance()->isEnabled() && c != m_currentColumnIndex)
continue;
if (level == 0) {
// m_isCurrentColumn = (c == m_currentColumnIndex);
m_ancestorColumnIndex = c;
}
TXshColumn *column = xsh->getColumn(c);
bool isMask = false;
if (column && !column->isEmpty()) {
if (!column->isPreviewVisible() && checkPreviewVisibility) continue;
if (column->isCamstandVisible() ||
includeUnvisible) // se l'"occhietto" non e' chiuso
{
if (column->isMask()) // se e' una maschera (usate solo in tab pro)
{
isMask = true;
std::vector<int> saveMasks;
saveMasks.swap(m_masks);
int maskIndex = m_maskPool.size();
PlayerSet *mask = new PlayerSet();
m_maskPool.push_back(mask);
addCellWithOnionSkin(*mask, scene, xsh, row, c, level);
std::stable_sort(mask->begin(), mask->end(), PlayerLt());
saveMasks.swap(m_masks);
m_masks.push_back(maskIndex);
} else
addCellWithOnionSkin(players, scene, xsh, row, c, level);
}
}
if (!isMask) {
while (m_masks.size() > maskCount) m_masks.pop_back();
}
}
if (level == 0) std::stable_sort(players.begin(), players.end(), PlayerLt());
}
示例15: isMeshDeformed
static inline bool isMeshDeformed(TXsheet *xsh, TStageObject *obj,
const ImagePainter::VisualSettings *vs) {
const TStageObjectId &parentId = obj->getParent();
if (parentId.isColumn() && obj->getParentHandle()[0] != 'H') {
TStageObject *parentObj = xsh->getStageObject(parentId);
if (!parentObj->getPlasticSkeletonDeformation()) return false;
TXshColumn *parentCol = xsh->getColumn(parentId.getIndex());
return (parentCol->getColumnType() == TXshColumn::eMeshType) &&
(parentCol != vs->m_plasticVisualSettings.m_showOriginalColumn);
}
return false;
}