Assimp访问节点名称时出错
Assimp Error acessing aiNode name
我正在尝试加载一个动画网格(骨骼)与assimp,但我有一些问题。
当我试图访问(根节点)aiNode*
的名称时,程序崩溃了。在Visual Studio的输出中,它说它无法读取字符串字符。
(我遵循这个教程)
void Mesh::ReadNodeHierarchy(float AnimationTime, aiScene* scene, aiNode* pNode, const aiMatrix4x4& ParentTransform) {
if (pNode == NULL) {
std::cerr << "NODE NULLn";
return;
}
std::cerr << pNode->mName.length; // I tried to check the length of the string but it caused the same error
std::string NodeName(pNode->mName.data); // Throws error
(...)
}
如果有人有同样的问题,我刚刚发现,当Assimp::Importer类被销毁时,场景也是。
我的导入器类是本地的,所以它被销毁了,从而导致了错误。
相关文章:
- 访问者访问变体并返回不同类型时出错
- 在c++中访问int到类对象的映射时出错
- 分段 访问私有类变量时出错
- 从反向顺序C++访问矢量时运行时出错
- 按基类对象访问派生类资源时出错
- 通过 [] 运算符访问unordered_map时出错
- 通过多个类访问成员时出错
- 在VS2015中访问类成员时运行时错误,但在Linux上未访问时出错
- 通过 constexpr 中的 'const char *' glvalue 访问字符串文字的值会出错
- CPLEX - 访问解决方案C++时出错
- 尝试访问列表时出错
- 我设计了一个类并创建了基指针,但是当我尝试通过基指针访问派生函数时,它会出错
- 从 OpenMP 循环内部访问和编辑 Qmap 时出错
- 从 C++ 中的类访问数组内容时出错
- 在 C++ 中访问泛型结构的成员会出错
- 对关键部分的两个进程访问出错
- C++:访问抽象超类枚举时出错
- 在C++中访问静态私有变量时出错
- 无法访问if块时出错
- 读取字符串的字符时出错-访问冲突错误C++