什么是Autodesk FBX技术?

本篇会大致说明Autodesk FBX技术和它的功能特性。

Autodesk FBX SDK技术包含了一整套工具,用来让开发者对3D模型进行快捷的导入、修改和导出等操作,而FBX SDK是整套工具的一部分。通过Autodesk FBX来开发混合2D和3D数字内容的应用程序,有助于许多组织团队更有效的参与到数字媒体娱乐行业中来。

3D场景中的FBX文件格式

FBX格式文件(.fbx)一般是以二进制形式保存,也支持ascii形式,并且都是使用的 .fbx 后缀名。

FBX格式会将3D场景里的相机、灯光、网格、NURBS或其他的一些元素都保存进去。很多软件比如3ds max、maya、MotionBuilder等都可以从FBX格式里导入全部或部分场景元素,自然也可以将这些软件里的3D场景信息导出到FBX中,而这些功能实现都是使用的FBX SDK。

下面的示例是从ascii形式保存的FBX文件中,截取的部分内容。忽略的行数用“…”代表,然后人为增加了一些注释说明,这些注释都以“;”开头。

  1. ; FBX 7.1.0 project file
  2. ; Copyright (C) 1997-2010 Autodesk Inc. and/or its licensors.
  3. ; All rights reserved.
  4. ; ----------------------------------------------------
  5. FBXHeaderExtension: {
  6. ; header information: global file information.
  7. FBXHeaderVersion: 1003
  8. FBXVersion: 7100
  9. CreationTimeStamp: {
  10. Version: 1000
  11. Year: 2010
  12. Month: 1
  13. Day: 19
  14. Hour: 16
  15. Minute: 30
  16. Second: 28
  17. Millisecond: 884
  18. }
  19. Creator: "FBX SDK/FBX Plugins version 2011.2"
  20. SceneInfo: "SceneInfo::GlobalInfo", "UserData" {
  21. ...
  22. }
  23. GlobalSettings: {
  24. Version: 1000
  25. Properties70: {
  26. P: "UpAxis", "int", "Integer", "",1
  27. P: "UpAxisSign", "int", "Integer", "",1
  28. P: "FrontAxis", "int", "Integer", "",2
  29. P: "FrontAxisSign", "int", "Integer", "",1
  30. P: "CoordAxis", "int", "Integer", "",0
  31. P: "CoordAxisSign", "int", "Integer", "",1
  32. P: "OriginalUpAxis", "int", "Integer", "",-1
  33. P: "OriginalUpAxisSign", "int", "Integer", "",1
  34. P: "UnitScaleFactor", "double", "Number", "",1
  35. P: "OriginalUnitScaleFactor", "double", "Number", "",1
  36. P: "AmbientColor", "ColorRGB", "Color", "",0,0,0
  37. P: "DefaultCamera", "KString", "", "", "Producer Perspective"
  38. P: "TimeMode", "enum", "", "",6
  39. P: "TimeSpanStart", "KTime", "Time", "",0
  40. P: "TimeSpanStop", "KTime", "Time", "",46186158000
  41. }
  42. }
  43. ...
  44. ; Object definitions
  45. ;------------------------------------------------------------------
  46. Definitions: {
  47. Version: 100
  48. Count: 2251
  49. ObjectType: "GlobalSettings" {
  50. Count: 1
  51. }
  52. ObjectType: "Model" {
  53. Count: 86
  54. PropertyTemplate: "FbxNode" {
  55. Properties70: {
  56. P: "QuaternionInterpolate", "bool", "", "",0
  57. P: "RotationOffset", "Vector3D", "Vector", "",0,0,0
  58. P: "RotationPivot", "Vector3D", "Vector", "",0,0,0
  59. P: "ScalingOffset", "Vector3D", "Vector", "",0,0,0
  60. P: "ScalingPivot", "Vector3D", "Vector", "",0,0,0
  61. ...}
  62. ObjectType: "Material" {
  63. Count: 1
  64. PropertyTemplate: "FbxSurfacePhong" {
  65. Properties70: {
  66. P: "ShadingModel", "KString", "", "", "Phong"
  67. P: "MultiLayer", "bool", "", "",0
  68. P: "EmissiveColor", "ColorRGB", "Color", "",0,0,0
  69. P: "EmissiveFactor", "double", "Number", "",1
  70. P: "AmbientColor", "ColorRGB", "Color", "",0.2,0.2,0.2
  71. ...}
  72. Model: 21883936, "Model::Humanoid:Hips", "LimbNode" {
  73. Version: 232
  74. Properties70: {
  75. P: "ScalingMin", "Vector3D", "Vector", "",1,1,1
  76. P: "NegativePercentShapeSupport", "bool", "", "",0
  77. P: "DefaultAttributeIndex", "int", "Integer", "",0
  78. P: "Lcl Translation", "Lcl Translation", "", "A+",-271.281097412109,-762.185852050781,528.336242675781
  79. P: "Lcl Rotation", "Lcl Rotation", "", "A+",-1.35128843784332,2.6148145198822,0.42334708571434
  80. P: "Lcl Scaling", "Lcl Scaling", "", "A+",1,0.99999988079071,1
  81. ...

注意:FBX格式并不全是纯文本化的(大多数是二进制)。为了更好的兼容性,程序应该使用FBX SDK从FBX文件中读取和写入场景信息。

FBX软件开发工具包

开发者可以使用FBX SDK来创建应用程序,或者将其嵌入已有的应用程序。

注意FBX SDK并不是开源软件,不存在GPL等开源许可证,所以它的源代码也是不公开的。有些功能代码是包含到FBX SDK扩展部分的,并不在FBX SDK本身之中,比如Maya和3ds Max的一些自定义插件。最新版本或历史版本都可以在Autodesk FBX官网http://www.autodesk.com/fbx中找到。没有Autodesk的许可授权,不能再次分发或打包FBX SDK。如果你想在开源项目中使用,必须给予用户一个Autodesk FBX官网的链接,以便其自行下载安装FBX SDK。

本章节还包含内容

翻译者:listenlin
原文档地址: http://help.autodesk.com/view/FBX/2016/ENU/?guid=__files_GUID_274163DA_9E89_4DCC_8AF6_10B0C498582E_htm
时间:2016.11.8
联系邮箱:listenlin521@foxmail.com