FBX

From Valve Developer Community
Jump to: navigation, search
English

记录FBX文件在Dota 2 Workshop Tools中的功用。

材质指派(Material Assignment)

一般支持FBX文件不需考虑特别事项,但着绘在几何体上的材质则需要注意一些事项。

注意,所有的资源参照(resource references),包括材质,资源皆为mod对应之文件名(relative filename)。与Half-Life 2 Source SDK不同,没有隐含的目录(implied directories),如材质会在"materials/..." 的树状目录结构中。

FBX材质指派到(assignment to)source材质(source material)的算法是根据下列步骤。

  1. 若FbxProperty有FbxSurfaceMaterial下的字符串为"FBX_vmatPath",则该值做为材质指派。
  2. 若上述不为真,FbxSurfaceMaterial自身的名字试图匹配到CONTENT与GAME存在之材质。
  3. 若上述不为真且FbxSurfaceMaterial已被指派,若为存在之材质找到匹配则纹理文件名被转至材质文件名。
  4. 若上述不为真,则纹理文件名结尾为"_color.*"或"_normal.*","_color" 与"_normal"被去除,存在之材质找到匹配则纹理文件名被转至材质文件名。

这有一个FBX ASCII文件范例"FBX_vmatPath"字符串属性指定要使用哪个材质:

Material: 668812176, "Material::tile_stone_000_75", "" {
	Version: 102
	ShadingModel: "phong"
	MultiLayer: 0
	Properties70:  {
		P: "EmissiveColor", "Color", "", "A",1,1,1
		P: "EmissiveFactor", "Number", "", "A",0
		P: "DiffuseColor", "Color", "", "A",1,1,1
		P: "DiffuseFactor", "Number", "", "A",0.8
		P: "SpecularColor", "Color", "", "A",1,1,1
		P: "SpecularFactor", "Number", "", "A",0.2
		P: "ShininessExponent", "Number", "", "A",256
		P: "ReflectionColor", "Color", "", "A",1,1,1
		P: "ReflectionFactor", "Number", "", "A",0
		P: "FBX_vmatPath", "KString", "", "U", "materials/stone/tile_stone_000_75.vmat"
		P: "Emissive", "Vector3D", "Vector", "",0,0,0
		P: "Ambient", "Vector3D", "Vector", "",0.2,0.2,0.2
		P: "Diffuse", "Vector3D", "Vector", "",0.8,0.8,0.8
		P: "Specular", "Vector3D", "Vector", "",0.2,0.2,0.2
		P: "Shininess", "double", "Number", "",256
		P: "Opacity", "double", "Number", "",1
		P: "Reflectivity", "double", "Number", "",0
	}
}


Houdini

Houdini有个特定的材质指派方法。

依赖性追踪(Dependency Tracking)

在FBXHeaderExtension中,若FbxProperty有"Original|FileName"字符串则该文件名将会被增加至资源依赖列表(asset dependency list)。

范例中正确的把"Original|FileName"指向.lxo (Modo)文件,则.FBX文件自该文件生成。

FBXHeaderExtension:  {
	FBXHeaderVersion: 1003
	FBXVersion: 7300
	CreationTimeStamp:  {
		Version: 1000
		Year: 2014
		Month: 3
		Day: 25
		Hour: 15
		Minute: 22
		Second: 56
		Millisecond: 976
	}
	Creator: "FBX SDK/FBX Plugins version 2013.3"
	SceneInfo: "SceneInfo::GlobalInfo", "UserData" {
		Type: "UserData"
		Version: 100
		MetaData:  {
			Version: 100
			Title: "test_cube_001"
			Subject: ""
			Author: ""
			Keywords: ""
			Revision: ""
			Comment: ""
		}
		Properties70:  {
			P: "DocumentUrl", "KString", "Url", "", "D:\Dev\main\content\dota\models\test\fbx\test_cube_001.fbx"
			P: "SrcDocumentUrl", "KString", "Url", "", "D:\Dev\main\content\dota\models\test\fbx\test_cube_001.fbx"
			P: "Original", "Compound", "", ""
			P: "Original|ApplicationVendor", "KString", "", "", "The Foundry"
			P: "Original|ApplicationName", "KString", "", "", "MODO"
			P: "Original|ApplicationVersion", "KString", "", "", ""
			P: "Original|DateTime_GMT", "DateTime", "", "", "25/03/2014 22:22:56.976"
			P: "Original|FileName", "KString", "", "", "D:\Dev\main\content\dota\models\test\modo\test_cube_001.lxo"
			P: "LastSaved", "Compound", "", ""
			P: "LastSaved|ApplicationVendor", "KString", "", "", "The Foundry"
			P: "LastSaved|ApplicationName", "KString", "", "", "MODO"
			P: "LastSaved|ApplicationVersion", "KString", "", "", ""
			P: "LastSaved|DateTime_GMT", "DateTime", "", "", "25/03/2014 22:22:56.976"
		}
	}
}

引用链接