fbx_to_3dtiles/cpp_src/include/fbx_wrap.h

30 lines
1.2 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include <fbxsdk.h>
#include <vector>
#include <tools.h>
#include <tuple>
using namespace std;
using Triangle = std::tuple<int, int, int>;
/**
* 递归遍历FBX节点树结构
* @param parent_node 起始父节点从此节点开始向下遍历若为nullptr则函数不执行任何操作
* @param level 当前节点层级用于缩进或层级标识建议初始调用时传入0
* @note 函数内部会递归访问parent_node的所有直接子节点和间接子节点
* @warning 若输入的parent_node无效如野指针可能导致程序崩溃
*/
void each_node(const FttContext* ctx, FbxNode* parent_node, int level);
/**
* 打印FBX节点的基本信息含层级缩进
* @param node 待打印信息的节点指针nullptr时输出警告日志
* @param level 节点层级用于控制打印缩进每级建议缩进4空格
* @details 输出内容包含:节点名称、类型、子节点数量、层级深度
* @example 层级2的节点打印格式" |-- NodeName (Type: Mesh, Children: 3)"
*/
void print_node_info(FbxNode* node, int level);
FbxNode* get_fbx_root_node(const char* fbx_path);
int load_triangles(fbxsdk::FbxNodeAttribute* attr, std::vector<Triangle>& triangles);