VMDL

From Valve Developer Community
Jump to navigation Jump to search
English (en)中文 (zh)Translate (Translate)
English (en)Deutsch (de)Esperanto (eo)Español (es)Français (fr)Suomi (fi)Hrvatski (hr)Italiano (it)日本語 (ja)한국어 (ko)Nederlands (nl)Polski (pl)Português do Brasil (pt-br)Русский (ru)Slovenčina (sk)Svenska (sv)Türkçe (tr)Українська (uk)Tiếng Việt (vi)中文 (zh)中文(臺灣) (zh-tw)
Welcome to the
Valve Developer Community
13,101 articles documenting the development process.

Whether you're building a commercial project or a modification for Half-Life® 2, you'll want to sign up as a Valve developer today. It's free to join and is open to anyone working with the Source engine and its software development kit.

带有 VMDL 扩展名的文件是内容端的文本文件,利用工具能够编译出游戏端的二进制文件(VMDL_C)。

一个模型被存在模型编辑器中后,会写出VMDL文件。当VMDL数据有更新时,或工具检测到变化,便会编译模型。

参考文档

注意事项

  • 每个VMDL文件的第一行是定义构架的文本,这并不是文件的唯一ID或是其他任意特性。
  • VMDL里的文件路径,是相对于当前游戏的内容目录里。
  • 元素引用的名称可以是内部的,也可以引用一个外部文件路径。
  • 一个VMDL文件可以在没有提供全部字段的情况下被编译。

这个例子将会编译一个简单的静态道具:

<!-- schema text {7e125a45-3d83-4043-b292-9e24f8ef27b4} generic {198980d8-3a93-4919-b4c6-dd1fb07a3a4b} -->
CVModel CVModel_0
{
	CVmeshList m_meshList = CVmeshList
	{
		CVmesh[] m_meshList = 
		[
			CVmesh
			{
				string m_meshName = "test"
				string m_meshFile = "models/test/dmx/mesh/test.dmx"
			}
		]
	}	
}

大型实例

一个空白CMDL文件如下:

<!-- schema text {7e125a45-3d83-4043-b292-9e24f8ef27b4} generic {198980d8-3a93-4919-b4c6-dd1fb07a3a4b} -->
CVModel CVModel_0
{
	CVmeshList m_meshList = CVmeshList
	{
		CVmesh[] m_meshList = 
		[
			
		]
	}
	CVphysicsMeshList m_physicsMeshList = CVphysicsMeshList
	{
		CVphysicsMesh[] m_meshList = 
		[
			
		]
	}
	CVmodelInfo* m_pModelInfo = NULL
	CVhitBoxSetListReference[] m_pHitBoxSetLists = 
	[
		
	]
	CVattachmentListReference[] m_pAttachmentLists = 
	[
		
	]
	CVanimGroupReference[] m_pAnimGroups = 
	[
		
	]
	CVNodeMaterialGroupListReference m_pMaterialGroupList = CVNodeMaterialGroupListReference
	{
		NodeMaterialGroupList_t* m_pObject = NULL
		string m_sFileName = ""
	}
	CVMeshGroupListReference m_pMeshGroupList = CVMeshGroupListReference
	{
		MeshGroupList_t* m_pObject = NULL
		string m_sFileName = ""
	}
	CVLODGroupListReference m_pLodGroupList = CVLODGroupListReference
	{
		LODGroupList_t* m_pObject = NULL
		string m_sFileName = ""
	}
	CVpropBreakableListReference m_pPropBreakableList = CVpropBreakableListReference
	{
		CVpropBreakableList* m_pObject = NULL
		string m_sFileName = ""
	}
	CVpropDataListReference m_pPropDataList = CVpropDataListReference
	{
		CVpropDataList* m_pObject = NULL
		string m_sFileName = ""
	}
	CVConstraintListReference[] m_pConstraintLists = 
	[
		
	]
	string m_collision = ""
	string m_sMDLFilename = ""
	string[] m_scriptFiles = 
	[
		
	]
	CVMaterialRemapList* m_pMaterialRemapList = NULL
	float m_flFbxScale = 1.000000
}

引用链接