Unreal Live Link Face Plugin:如何检测人脸何时离开相机?
Unreal Live Link Face Plugin: How to detect when the face is out of the camera?
我正在跟随 Recording Facial Animation from an iPhone X tutorial with Unreal Engine 4 并成功捕捉和呈现我的脸部运动。
但是当我的脸在镜头外时,编辑器中的姿势会卡在最后一帧。
我怎样才能检测到实时动画数据丢失以便播放预先录制的动画?
我想通了。只需在 c++ 中使用 LiveLinkPlugin
源中的 ILiveLinkClient::IsSubjectValid(SubjectName);
方法或将其导出到蓝图:
class DAZTOUE4_API UMyBlueprintFunctionLibrary :
public UBlueprintFunctionLibrary
{
GENERATED_BODY()
UFUNCTION(BlueprintCallable, Category = "MyVirtualCharacter")
static bool IsLiveLinkSubjectValid(const FLiveLinkSubjectName SubjectName);
};
bool UMyBlueprintFunctionLibrary::IsLiveLinkSubjectValid(const FLiveLinkSubjectName SubjectName)
{
IModularFeatures& ModularFeatures = IModularFeatures::Get();
if (ModularFeatures.IsModularFeatureAvailable(ILiveLinkClient::ModularFeatureName))
{
ILiveLinkClient& LiveLinkClient = ModularFeatures.GetModularFeature<ILiveLinkClient>(ILiveLinkClient::ModularFeatureName);
return LiveLinkClient.IsSubjectValid(SubjectName);
}
return false;
}
我正在跟随 Recording Facial Animation from an iPhone X tutorial with Unreal Engine 4 并成功捕捉和呈现我的脸部运动。
但是当我的脸在镜头外时,编辑器中的姿势会卡在最后一帧。
我怎样才能检测到实时动画数据丢失以便播放预先录制的动画?
我想通了。只需在 c++ 中使用 LiveLinkPlugin
源中的 ILiveLinkClient::IsSubjectValid(SubjectName);
方法或将其导出到蓝图:
class DAZTOUE4_API UMyBlueprintFunctionLibrary :
public UBlueprintFunctionLibrary
{
GENERATED_BODY()
UFUNCTION(BlueprintCallable, Category = "MyVirtualCharacter")
static bool IsLiveLinkSubjectValid(const FLiveLinkSubjectName SubjectName);
};
bool UMyBlueprintFunctionLibrary::IsLiveLinkSubjectValid(const FLiveLinkSubjectName SubjectName)
{
IModularFeatures& ModularFeatures = IModularFeatures::Get();
if (ModularFeatures.IsModularFeatureAvailable(ILiveLinkClient::ModularFeatureName))
{
ILiveLinkClient& LiveLinkClient = ModularFeatures.GetModularFeature<ILiveLinkClient>(ILiveLinkClient::ModularFeatureName);
return LiveLinkClient.IsSubjectValid(SubjectName);
}
return false;
}