本文整理汇总了C++中LLFloaterAnimPreview类的典型用法代码示例。如果您正苦于以下问题:C++ LLFloaterAnimPreview类的具体用法?C++ LLFloaterAnimPreview怎么用?C++ LLFloaterAnimPreview使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了LLFloaterAnimPreview类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onCommitName
//-----------------------------------------------------------------------------
// onCommitName()
//-----------------------------------------------------------------------------
void LLFloaterAnimPreview::onCommitName(LLUICtrl* ctrl, void* data)
{
LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)data;
if (!previewp->getEnabled())
return;
LLVOAvatar* avatarp;
if (previewp->mInWorld)
{
if (!gAgent.getAvatarObject())
{
return;
}
avatarp = gAgent.getAvatarObject();
}
else
{
if (!previewp->mAnimPreview)
{
return;
}
avatarp = previewp->mAnimPreview->getDummyAvatar();
}
LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(previewp->mMotionID);
if (motionp)
{
motionp->setName(previewp->childGetValue("name_form").asString());
}
LLFloaterNameDesc::doCommit(ctrl, data);
}
示例2: onCommitLoopOut
//-----------------------------------------------------------------------------
// onCommitLoopOut()
//-----------------------------------------------------------------------------
void LLFloaterAnimPreview::onCommitLoopOut(LLUICtrl* ctrl, void* data)
{
LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)data;
if (!previewp->getEnabled())
return;
LLVOAvatar* avatarp;
if (previewp->mInWorld)
{
if (!gAgent.getAvatarObject())
{
return;
}
avatarp = gAgent.getAvatarObject();
}
else
{
if (!previewp->mAnimPreview)
{
return;
}
avatarp = previewp->mAnimPreview->getDummyAvatar();
}
LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(previewp->mMotionID);
if (motionp)
{
motionp->setLoopOut((F32)previewp->childGetValue("loop_out_point").asReal() * 0.01f * motionp->getDuration());
previewp->resetMotion();
previewp->childSetValue("loop_check", LLSD(TRUE));
onCommitLoop(ctrl, data);
}
}
示例3: onCommitBaseAnim
//-----------------------------------------------------------------------------
// onCommitBaseAnim()
//-----------------------------------------------------------------------------
void LLFloaterAnimPreview::onCommitBaseAnim(LLUICtrl* ctrl, void* data)
{
LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)data;
if (!previewp->getEnabled())
return;
if (previewp->mAnimPreview)
{
LLVOAvatar* avatarp = previewp->mAnimPreview->getDummyAvatar();
BOOL paused = avatarp->areAnimationsPaused();
// stop all other possible base motions
avatarp->stopMotion(ANIM_AGENT_STAND, TRUE);
avatarp->stopMotion(ANIM_AGENT_WALK, TRUE);
avatarp->stopMotion(ANIM_AGENT_SIT, TRUE);
avatarp->stopMotion(ANIM_AGENT_HOVER, TRUE);
previewp->resetMotion();
if (!paused)
{
previewp->mPauseRequest = NULL;
}
}
}
示例4: validateLoopOut
//-----------------------------------------------------------------------------
// validateLoopOut()
//-----------------------------------------------------------------------------
BOOL LLFloaterAnimPreview::validateLoopOut(LLUICtrl* spin, void* data)
{
LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)data;
if (!previewp->getEnabled())
return FALSE;
F32 loop_out_value = (F32)previewp->childGetValue("loop_out_point").asReal();
F32 loop_in_value = (F32)previewp->childGetValue("loop_in_point").asReal();
if (loop_out_value < 0.f)
{
loop_out_value = 0.f;
}
else if (loop_out_value > 100.f)
{
loop_out_value = 100.f;
}
else if (loop_out_value < loop_in_value)
{
loop_out_value = loop_in_value;
}
previewp->childSetValue("loop_out_point", LLSD(loop_out_value));
return TRUE;
}
示例5: onBtnStop
//-----------------------------------------------------------------------------
// onBtnStop()
//-----------------------------------------------------------------------------
void LLFloaterAnimPreview::onBtnStop(void* user_data)
{
LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)user_data;
if (!previewp->getEnabled())
return;
if (previewp->mMotionID.notNull())
{
LLVOAvatar* avatarp;
if (previewp->mInWorld)
{
if (!gAgent.getAvatarObject())
{
return;
}
avatarp = gAgent.getAvatarObject();
}
else
{
if (!previewp->mAnimPreview)
{
return;
}
avatarp = previewp->mAnimPreview->getDummyAvatar();
}
previewp->resetMotion();
previewp->mPauseRequest = avatarp->requestPause();
}
}
示例6: onSliderMove
//-----------------------------------------------------------------------------
// onSliderMove()
//-----------------------------------------------------------------------------
void LLFloaterAnimPreview::onSliderMove(LLUICtrl* ctrl, void*user_data)
{
LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)user_data;
if (!previewp->getEnabled())
return;
LLVOAvatar* avatarp;
if (previewp->mInWorld)
{
if (!gAgent.getAvatarObject())
{
return;
}
avatarp = gAgent.getAvatarObject();
}
else
{
if (!previewp->mAnimPreview)
{
return;
}
avatarp = previewp->mAnimPreview->getDummyAvatar();
}
F32 slider_value = (F32)previewp->childGetValue("playback_slider").asReal();
LLUUID base_id = previewp->mIDList[previewp->childGetValue("preview_base_anim").asString()];
LLMotion* motionp = avatarp->findMotion(previewp->mMotionID);
F32 duration = motionp->getDuration();// + motionp->getEaseOutDuration();
F32 delta_time = duration * slider_value;
avatarp->deactivateAllMotions();
avatarp->startMotion(base_id, delta_time + BASE_ANIM_TIME_OFFSET);
avatarp->startMotion(previewp->mMotionID, delta_time);
previewp->mPauseRequest = avatarp->requestPause();
previewp->refresh();
}
示例7: validateEaseOut
//-----------------------------------------------------------------------------
// validateEaseOut()
//-----------------------------------------------------------------------------
BOOL LLFloaterAnimPreview::validateEaseOut(LLUICtrl* spin, void* data)
{
LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)data;
if (!previewp->getEnabled())
return FALSE;
LLVOAvatar* avatarp;
if (previewp->mInWorld)
{
if (!gAgent.getAvatarObject())
{
return FALSE;
}
avatarp = gAgent.getAvatarObject();
}
else
{
if (!previewp->mAnimPreview)
{
return FALSE;
}
avatarp = previewp->mAnimPreview->getDummyAvatar();
}
LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(previewp->mMotionID);
if (!motionp->getLoop())
{
F32 new_ease_out = llclamp((F32)previewp->childGetValue("ease_out_time").asReal(), 0.f, motionp->getDuration() - motionp->getEaseInDuration());
previewp->childSetValue("ease_out_time", LLSD(new_ease_out));
}
return TRUE;
}
示例8: onCommitEaseOut
//-----------------------------------------------------------------------------
// onCommitEaseOut()
//-----------------------------------------------------------------------------
void LLFloaterAnimPreview::onCommitEaseOut(LLUICtrl* ctrl, void* data)
{
LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)data;
if (!previewp->getEnabled())
return;
LLVOAvatar* avatarp;
if (previewp->mInWorld)
{
if (!gAgent.getAvatarObject())
{
return;
}
avatarp = gAgent.getAvatarObject();
}
else
{
if (!previewp->mAnimPreview)
{
return;
}
avatarp = previewp->mAnimPreview->getDummyAvatar();
}
LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(previewp->mMotionID);
motionp->setEaseOut((F32)previewp->childGetValue("ease_out_time").asReal());
previewp->resetMotion();
}
示例9: onBtnPlay
//-----------------------------------------------------------------------------
// onBtnPlay()
//-----------------------------------------------------------------------------
void LLFloaterAnimPreview::onBtnPlay(void* user_data)
{
LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)user_data;
if (!previewp->getEnabled())
return;
if (previewp->mMotionID.notNull() && previewp->mAnimPreview)
{
LLVOAvatar* avatarp = previewp->mAnimPreview->getDummyAvatar();
if(!avatarp->isMotionActive(previewp->mMotionID))
{
previewp->resetMotion();
previewp->mPauseRequest = NULL;
}
else
{
if (avatarp->areAnimationsPaused())
{
previewp->mPauseRequest = NULL;
}
else
{
previewp->mPauseRequest = avatarp->requestPause();
}
}
}
}
示例10: onCommitEmote
//-----------------------------------------------------------------------------
// onCommitEmote()
//-----------------------------------------------------------------------------
void LLFloaterAnimPreview::onCommitEmote(LLUICtrl* ctrl, void* data)
{
LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)data;
if (!previewp->getEnabled())
return;
previewp->resetMotion(); // ssts emote
}
示例11: onBtnReload
//-----------------------------------------------------------------------------
// onBtnReload()
//-----------------------------------------------------------------------------
void LLFloaterAnimPreview::onBtnReload(void* userdata)
{
LLFloaterAnimPreview* floaterp = (LLFloaterAnimPreview*)userdata;
if (!floaterp->getEnabled()) return;
floaterp->unloadMotion();
floaterp->loadBVH();
}
示例12: onCommitHandPose
//-----------------------------------------------------------------------------
// onCommitHandPose()
//-----------------------------------------------------------------------------
void LLFloaterAnimPreview::onCommitHandPose(LLUICtrl* ctrl, void* data)
{
LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)data;
if (!previewp->getEnabled())
return;
previewp->resetMotion(); // sets hand pose
}
示例13: onBtnOK
//-----------------------------------------------------------------------------
// onBtnOK()
//-----------------------------------------------------------------------------
void LLFloaterAnimPreview::onBtnOK(void* userdata)
{
LLFloaterAnimPreview* floaterp = (LLFloaterAnimPreview*)userdata;
if (!floaterp->getEnabled()) return;
if (floaterp->mAnimPreview)
{
LLKeyframeMotion* motionp = (LLKeyframeMotion*)floaterp->mAnimPreview->getPreviewAvatar()->findMotion(floaterp->mMotionID);
S32 file_size = motionp->getFileSize();
U8* buffer = new U8[file_size];
LLDataPackerBinaryBuffer dp(buffer, file_size);
if (motionp->serialize(dp))
{
LLVFile file(gVFS, motionp->getID(), LLAssetType::AT_ANIMATION, LLVFile::APPEND);
S32 size = dp.getCurrentSize();
file.setMaxSize(size);
if (file.write((U8*)buffer, size))
{
std::string name = floaterp->getChild<LLUICtrl>("name_form")->getValue().asString();
std::string desc = floaterp->getChild<LLUICtrl>("description_form")->getValue().asString();
LLAssetStorage::LLStoreAssetCallback callback = NULL;
S32 expected_upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload();
void *userdata = NULL;
upload_new_resource(floaterp->mTransactionID, // tid
LLAssetType::AT_ANIMATION,
name,
desc,
0,
LLFolderType::FT_NONE,
LLInventoryType::IT_ANIMATION,
LLFloaterPerms::getNextOwnerPerms(), LLFloaterPerms::getGroupPerms(), LLFloaterPerms::getEveryonePerms(),
name,
callback, expected_upload_cost, userdata);
}
else
{
llwarns << "Failure writing animation data." << llendl;
LLNotificationsUtil::add("WriteAnimationFail");
}
}
delete [] buffer;
// clear out cache for motion data
floaterp->resetMotion();
floaterp->mAnimPreview->getPreviewAvatar()->removeMotion(floaterp->mMotionID);
LLKeyframeDataCache::removeKeyframeData(floaterp->mMotionID);
floaterp->mMotionID.setNull();
}
floaterp->closeFloater(false);
}
示例14: onCommitPriority
//-----------------------------------------------------------------------------
// onCommitPriority()
//-----------------------------------------------------------------------------
void LLFloaterAnimPreview::onCommitPriority(LLUICtrl* ctrl, void* data)
{
LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)data;
if (!previewp->getEnabled())
return;
LLVOAvatar* avatarp = previewp->mAnimPreview->getDummyAvatar();
LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(previewp->mMotionID);
motionp->setPriority(llfloor((F32)previewp->childGetValue("priority").asReal()));
}
示例15: onCommitEaseIn
//-----------------------------------------------------------------------------
// onCommitEaseIn()
//-----------------------------------------------------------------------------
void LLFloaterAnimPreview::onCommitEaseIn(LLUICtrl* ctrl, void* data)
{
LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)data;
if (!previewp->getEnabled())
return;
LLVOAvatar* avatarp = previewp->mAnimPreview->getDummyAvatar();
LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(previewp->mMotionID);
motionp->setEaseIn((F32)previewp->childGetValue("ease_in_time").asReal());
previewp->resetMotion();
}