[UE4]C++设置AnimInstance的相关问题
2017-09-29 14:41
1246 查看
注意:ue4 4.17调用LoadObject<UAnimBlueprintGeneratedClass>直接崩
http://aigo.iteye.com/blog/2285001
UAnimInstance
https://docs.unrealengine.com/latest/INT/API/Runtime/Engine/Animation/UAnimInstance/index.html
AnimInstance是Animation Blueprint的C++版本。
角色蓝图中,设置动画蓝图是设置的Anim Class属性:
这个设置的步骤如果用C++操作,如下设置:
Cpp代码
USkeletalMeshComponent::SetAnimInstanceClass(UClass* NewClass);
具体实例:
Cpp代码
UAnimBlueprintGeneratedClass* MeshAnim = LoadObject<UAnimBlueprintGeneratedClass>(NULL, TEXT("/Game/Character/HeroTPP_AnimBlueprint.HeroTPP_AnimBlueprint"));
Mesh->SetAnimInstanceClass(MeshAnim);
如果想用C++ UAnimInstance代替蓝图动画,那么需要创建一个自己的UAnimInstance,并在其中实现自己的动画逻辑,UAnimInstance里面的具体函数还不熟悉,先标记下,等项目后期再将动画蓝图改为C++。
Game Instance, Custom Game Instance For Inter-Level Persistent Data Storage
https://wiki.unrealengine.com/Game_Instance,_Custom_Game_Instance_For_Inter-Level_Persistent_Data_Storage
http://aigo.iteye.com/blog/2285001
UAnimInstance
https://docs.unrealengine.com/latest/INT/API/Runtime/Engine/Animation/UAnimInstance/index.html
AnimInstance是Animation Blueprint的C++版本。
角色蓝图中,设置动画蓝图是设置的Anim Class属性:
这个设置的步骤如果用C++操作,如下设置:
Cpp代码
USkeletalMeshComponent::SetAnimInstanceClass(UClass* NewClass);
具体实例:
Cpp代码
UAnimBlueprintGeneratedClass* MeshAnim = LoadObject<UAnimBlueprintGeneratedClass>(NULL, TEXT("/Game/Character/HeroTPP_AnimBlueprint.HeroTPP_AnimBlueprint"));
Mesh->SetAnimInstanceClass(MeshAnim);
如果想用C++ UAnimInstance代替蓝图动画,那么需要创建一个自己的UAnimInstance,并在其中实现自己的动画逻辑,UAnimInstance里面的具体函数还不熟悉,先标记下,等项目后期再将动画蓝图改为C++。
Game Instance, Custom Game Instance For Inter-Level Persistent Data Storage
https://wiki.unrealengine.com/Game_Instance,_Custom_Game_Instance_For_Inter-Level_Persistent_Data_Storage
相关文章推荐
- C++调用matlab时可能遇到的问题和相关设置
- [UE4]C++实现动态加载的问题:LoadClass<T>()和LoadObject<T>()
- c/c++中与时间相关的问题
- linux IP、子网掩码、网关设置及相关问题
- C++面试题(三)——STL相关各种问题
- mysql中自增auto_increment功能的相关设置及问题
- setsockopt设置socket状态 解决相关端口占用问题!
- 问题六十四:怎么用C++实现二叉查找树(binary search tree)及其相关操作
- android平台通过socket向C++服务器端发送数据和接收数据的相关问题
- C/C++中指针和引用之相关问题研究
- c++中vector地址相关问题
- 移动项目中JAVA与C/C++编解码相关的JNI动态库问题(.dll vs .so)
- cactiEZ 添加PHP扩展模块mssql及相关设置问题整理
- 关于XP的IIS设置的相关问题
- C++常见问题(三)——宏定义、const、static、sizeof的相关实例
- 关于C++中类的成员函数指针相关问题
- Linux 下 PATH与LS_LIBRARY_PATH 环境变量设置相关问题
- 【笔记一】C++相关问题摘录
- Axure RP Pro - 相关问题 - 表格的单元格不能使用动作设置文字
- linux 设置静态ip 及解决相关问题