本文整理汇总了C++中LLFloaterAnimPreview::childGetValue方法的典型用法代码示例。如果您正苦于以下问题:C++ LLFloaterAnimPreview::childGetValue方法的具体用法?C++ LLFloaterAnimPreview::childGetValue怎么用?C++ LLFloaterAnimPreview::childGetValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLFloaterAnimPreview
的用法示例。
在下文中一共展示了LLFloaterAnimPreview::childGetValue方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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();
}
示例2: 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;
}
示例3: onCommitLoop
//-----------------------------------------------------------------------------
// onCommitLoop()
//-----------------------------------------------------------------------------
void LLFloaterAnimPreview::onCommitLoop(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->setLoop(previewp->childGetValue("loop_check").asBoolean());
motionp->setLoopIn((F32)previewp->childGetValue("loop_in_point").asReal() * 0.01f * motionp->getDuration());
motionp->setLoopOut((F32)previewp->childGetValue("loop_out_point").asReal() * 0.01f * motionp->getDuration());
}
}
示例4: onBtnOK
//-----------------------------------------------------------------------------
// onBtnOK()
//-----------------------------------------------------------------------------
void LLFloaterAnimPreview::onBtnOK(void* userdata)
{
LLFloaterAnimPreview* floaterp = (LLFloaterAnimPreview*)userdata;
if (!floaterp->getEnabled()) return;
if (floaterp->mAnimPreview)
{
LLKeyframeMotion* motionp = (LLKeyframeMotion*)floaterp->mAnimPreview->getDummyAvatar()->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->childGetValue("name_form").asString();
std::string desc = floaterp->childGetValue("description_form").asString();
upload_new_resource(floaterp->mTransactionID, // tid
LLAssetType::AT_ANIMATION,
name,
desc,
0,
LLAssetType::AT_NONE,
LLInventoryType::IT_ANIMATION,
PERM_NONE,
name);
}
else
{
llwarns << "Failure writing animation data." << llendl;
gViewerWindow->alertXml("WriteAnimationFail");
}
}
delete [] buffer;
// clear out cache for motion data
floaterp->mAnimPreview->getDummyAvatar()->removeMotion(floaterp->mMotionID);
LLKeyframeDataCache::removeKeyframeData(floaterp->mMotionID);
}
floaterp->close(false);
}
示例5: onCommitLoopIn
//-----------------------------------------------------------------------------
// onCommitLoopIn()
//-----------------------------------------------------------------------------
void LLFloaterAnimPreview::onCommitLoopIn(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->setLoopIn((F32)previewp->childGetValue("loop_in_point").asReal() / 100.f);
previewp->resetMotion();
previewp->childSetValue("loop_check", LLSD(TRUE));
onCommitLoop(ctrl, data);
}
}
示例6: 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;
}
示例7: 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();
}
示例8: 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);
}
示例9: 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()));
}
示例10: 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();
}
示例11: validateEaseIn
//-----------------------------------------------------------------------------
// validateEaseIn()
//-----------------------------------------------------------------------------
BOOL LLFloaterAnimPreview::validateEaseIn(LLUICtrl* spin, void* data)
{
LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)data;
if (!previewp->getEnabled())
return FALSE;
LLVOAvatar* avatarp = previewp->mAnimPreview->getDummyAvatar();
LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(previewp->mMotionID);
if (!motionp->getLoop())
{
F32 new_ease_in = llclamp((F32)previewp->childGetValue("ease_in_time").asReal(), 0.f, motionp->getDuration() - motionp->getEaseOutDuration());
previewp->childSetValue("ease_in_time", LLSD(new_ease_in));
}
return TRUE;
}
示例12: onCommitLoopOut
//-----------------------------------------------------------------------------
// onCommitLoopOut()
//-----------------------------------------------------------------------------
void LLFloaterAnimPreview::onCommitLoopOut(LLUICtrl* ctrl, void* data)
{
LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)data;
if (!previewp->getEnabled())
return;
LLVOAvatar* 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);
}
}
示例13: onBtnOK
//-----------------------------------------------------------------------------
// onBtnOK()
//-----------------------------------------------------------------------------
void LLFloaterAnimPreview::onBtnOK(void* userdata)
{
LLFloaterAnimPreview* floaterp = (LLFloaterAnimPreview*)userdata;
if (!floaterp->getEnabled()) return;
if ((!floaterp->mInWorld && floaterp->mAnimPreview) || (floaterp->mInWorld && gAgent.getAvatarObject()))
{
LLKeyframeMotion* motionp;
if (floaterp->mInWorld)
{
motionp = (LLKeyframeMotion*)gAgent.getAvatarObject()->findMotion(floaterp->mMotionID);
}
else
{
motionp = (LLKeyframeMotion*)floaterp->mAnimPreview->getDummyAvatar()->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->childGetValue("name_form").asString();
std::string desc = floaterp->childGetValue("description_form").asString();
LLAssetStorage::LLStoreAssetCallback callback = NULL;
S32 expected_upload_cost = sUploadAmount;
void *userdata = NULL;
// <edit>
if(floaterp->mItem)
{
// Update existing item instead of creating a new one
LLViewerInventoryItem* item = (LLViewerInventoryItem*)floaterp->mItem;
LLSaveInfo* info = new LLSaveInfo(item->getUUID(), LLUUID::null, desc, floaterp->mTransactionID);
gAssetStorage->storeAssetData(floaterp->mTransactionID, LLAssetType::AT_ANIMATION, NULL, info, FALSE);
// I guess I will do this now because the floater is closing...
LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item);
new_item->setDescription(desc);
new_item->setTransactionID(floaterp->mTransactionID);
new_item->setAssetUUID(motionp->getID());
new_item->updateServer(FALSE);
gInventory.updateItem(new_item);
gInventory.notifyObservers();
}
else
// </edit>
upload_new_resource(floaterp->mTransactionID, // tid
LLAssetType::AT_ANIMATION,
name,
desc,
0,
LLAssetType::AT_NONE,
LLInventoryType::IT_ANIMATION,
LLFloaterPerms::getNextOwnerPerms(), LLFloaterPerms::getGroupPerms(), LLFloaterPerms::getEveryonePerms(),
name,
callback, expected_upload_cost, userdata);
}
else
{
llwarns << "Failure writing animation data." << llendl;
LLNotifications::instance().add("WriteAnimationFail");
}
}
delete [] buffer;
// clear out cache for motion data
if (floaterp->mInWorld)
{
gAgent.getAvatarObject()->removeMotion(floaterp->mMotionID);
gAgent.getAvatarObject()->deactivateAllMotions();
}
else
{
floaterp->mAnimPreview->getDummyAvatar()->removeMotion(floaterp->mMotionID);
}
LLKeyframeDataCache::removeKeyframeData(floaterp->mMotionID);
}
floaterp->close(false);
}
示例14: onBtnOK
//-----------------------------------------------------------------------------
// onBtnOK()
//-----------------------------------------------------------------------------
void LLFloaterAnimPreview::onBtnOK(void* userdata)
{
LLFloaterAnimPreview* floaterp = (LLFloaterAnimPreview*)userdata;
if (!floaterp->getEnabled()) return;
if ((!floaterp->mInWorld && floaterp->mAnimPreview) || (floaterp->mInWorld && gAgent.getAvatarObject()))
{
LLKeyframeMotion* motionp;
if (floaterp->mInWorld)
{
motionp = (LLKeyframeMotion*)gAgent.getAvatarObject()->findMotion(floaterp->mMotionID);
}
else
{
motionp = (LLKeyframeMotion*)floaterp->mAnimPreview->getDummyAvatar()->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->childGetValue("name_form").asString();
std::string desc = floaterp->childGetValue("description_form").asString();
LLAssetStorage::LLStoreAssetCallback callback = NULL;
S32 expected_upload_cost = sUploadAmount;
void *userdata = NULL;
upload_new_resource(floaterp->mTransactionID, // tid
LLAssetType::AT_ANIMATION,
name,
desc,
0,
LLAssetType::AT_NONE,
LLInventoryType::IT_ANIMATION,
LLFloaterPerms::getNextOwnerPerms(), LLFloaterPerms::getGroupPerms(), LLFloaterPerms::getEveryonePerms(),
name,
callback, expected_upload_cost, userdata);
}
else
{
llwarns << "Failure writing animation data." << llendl;
LLNotifications::instance().add("WriteAnimationFail");
}
}
delete [] buffer;
// clear out cache for motion data
if (floaterp->mInWorld)
{
gAgent.getAvatarObject()->removeMotion(floaterp->mMotionID);
gAgent.getAvatarObject()->deactivateAllMotions();
}
else
{
floaterp->mAnimPreview->getDummyAvatar()->removeMotion(floaterp->mMotionID);
}
LLKeyframeDataCache::removeKeyframeData(floaterp->mMotionID);
}
floaterp->close(false);
}