MAYA到crysis简单教程

0153_MAYA_to_crysis_Banner

 

原文链接:http://seithcg.com/wordpress/?page_id=459
作者信息:Lionel Gallat seithcg.com
翻译:otkdl(aboutcg.net)转载请注明出处。

Exporting static models from Maya to Crysis.
本页面提供了有关从MAYA导出(.cgf文件)到crysis的方法。对于带动画的角色,请查阅此页面。(英文)http://seithcg.com/wordpress/?page_id=316

1. OpenCOLLADA plugin for Maya:
http://www.opencollada.org/download.html
2. MayaCGF
http://www.seithcg.com/maya/scripts/…0.2c(beta).exe
3. PyFFI
http://sourceforge.net/projects/pyffi/files/
MAYACGF插件支持32/64位的MAYA2008,2009,2010。。按1-2-3顺序安装。

mayaCGF_UI

MayaCGF英文安装说明可以在这个网页找到http://seithcg.com/wordpress/?page_id=56
下载好后,按次序安装就可以了,最后在MAYA脚本编辑栏中输入“source “mayaCGF.mel”; mayaCGF;”

The Geometry:

When working in Maya, you should make sure to turn off two-sided lighting in the viewport (Lighting->Two Sided Lighting). That way, if something turns black, you’ll know the normals are flipped the wrong way.
The model can be constituted of any number of separated meshes. You do not have to combine them. All the meshes making up your model should be located in a group. That group’s name is going to be the name of your exported model.
You don’t need to delete the history when exporting a static model. But make sure you freeze the transformations (especially Scale)! Also, there should be no instanced nodes anywhere in the model, and each name should be unique. You must absolutely export your model to …Crysis Wars/Game/Objects (preferably in its own folder).

当使用MAYA时,你应该确保在视图中(Lighting->Two Sided Lighting)关闭了two-sided lighting。这样如果有一些面变黑了,你就马上可以知道是法线翻转错误了。
完整的一个模型可以由任意数量的模型组成,你不必把它们在combine一起。你应该把所有的模型设在一个群组内,这个群组的名字就是你导出后模型的名字。
当导出一个静态模型时,你不需要删除历史记录。但是要确保你使用了freeze the transformations(特别是冻结缩放)!同样,不应该有任何节点在模型中, 每个名字应该是唯一的。你必须导出模型到…Crysis Wars/Game/Objects(最好是在自己的文件夹)

Physics Proxy:

Before you export your model, you should make it solid by creating a collision mesh, also called a “physics proxy”. This is not strictly necessary in the sense that the Cryengine2 will automatically physicalyze a model even if it doesn’t have a physics proxy mesh, but it is better to create a simple mesh that roughly encompasses your render mesh. The Cryengine2 can get confused if the physics mesh is too complex, and it will contribute to slow things down.

动力学代理:

在你导出模型之前,你应该创建一个用于碰撞的模型,也被称为“physics proxy”。这个不是必要的,即使没有一个动力学代理物体,Cryengine2引擎会自动为模型计算物理碰撞,但最好创建一个简单的代理模型包裹住你的模型。如果代理模型过于复杂,Cryengine2引擎计算会变得复杂,这将造成计算缓慢。

2

For a mesh called “myMesh”, you should name the proxy mesh “myMesh_Phys” and make sure it is parented to the top node along with the mesh itself. In the picture above you can see the render mesh selected (a beveled cube), and around it (in Xray mode) the physics proxy.

对一个模型命名为“myMesh”,那你应该为其代理模型取名为“myMesh_Phys”,并且确定它父子结构(具体看上图)。在上面的图中,你可以看到被选择模型(一个倒角过的立方体),并且在它的外围(Xray模式下)的代理物体。

Materials:
You can use any kind of material you like (Lambert, Phong, Blinn, etc…).
Select every mesh making up your model and click on “Assign cryShader To Selection”. This will make sure that the currently assigned shaders get extra attributes related to the physics in Crysis. Once this is done, you should select the shader itself and scroll down to the bottom of the channelBox. You’ll see a “CryShader” attribute which lets you choose the physics status of the mesh to which the shader is applied:

NoPhysics: The mesh will be visible but not solid – this is the default.
Physics: The mesh will be solid and visible.
Physics(NoDraw): The mesh will be solid but invisible.
NoCollide: The mesh will catch bullets but the player can walk through it.
Obstruct: The mesh will block the AI.

NoPhysics is the default for the render meshes; you should use this for the meshes you want to see in game but that don’t need to be solid (for example if you additionally use a simplified physics mesh).
Physics(NoDraw) is typically used for the proxy physics: you want those meshes to be solid, but you don’t want to actually see them in game.
If you do not want to create a physics proxy mesh (in case your model is not very heavy), then choose Physics; The mesh will be both visible and solid.

材质:

你可以使用像Lambert, Phong, Blinn等材质。
选择你的全部模型,点击“Assign cryShader To Selection”(应用cryShader材质至所选)。这将确保当前分配的材质获得了在Crysis中的物理效果属性。完成之后,你应该选择材质本身属性,向下滚动到材质球属性的底部。你将会看到一个“CryShader”的属性,它可以让你选择各种物理应用效果。

NoPhysics: 模型可见,但它并有体积的-这是默认的。
Physics: 模型将是有体积的并是可见的。
Physics(NoDraw): 模型将是有体积的,但是是不可见的。
NoCollide: 模型将捕捉住子弹,但是玩家可以穿过它。
Obstruct: 该模型将阻止AI.

NoPhysics是默认渲染网格,你想在游戏里观察模型,那你应该使用这个材质,并且这并不需要有体积的(例如,如果你同时使用一个简化的代理物体)
Physics(NoDraw) 通常用于代理物体:你希望这些模型是有体积的,并且你不希望在游戏中实际看到他们。如果你不希望创建一个物理代理模型(如果您的模型并不很重?),然后选择Physics,该模型将是可见并有体积。

Exporting The Model:

First, choose the directory to which you want to import your static model. Remember that this directory must absolutely be located in …Crysis Wars/Game/Objects. Again, you cannot export a file to anywhere else on your hard drive!
The path that appears in the Path text input only shows a partial result. Anything before “…/Crysis Wars/Game/Objects/…” will not appear. This is to keep the path short as to be able to see the export directory at a glance. If you hover your mouse over the text field, the complete path will appear. Note that you can also right-click on the Path line to access a quick bookmarks menu that gives you instant access to the last five locations you used.
Choose “.CGF” in the “File Type” pulldown menu. Then select the top node of the model and click on “Export!”. By default, if a .mtl file already exists for the model, MayaCGF will not overwrite it, unless you check the “Overwrite .mtl File” option. But beware, if you spend time tweaking the material file within Sandbox2, you wouldn’t want to overwrite it with the default “bland” one!
When you export a static model, the following files are created:

.dae: Those are temporary Collada files; text files of your model which get compiled by the Crytek compiler to produce the actual files used by the CryEngine2.
.cgf: Binary file containing the data for the mesh (vertices, normals, etc…)
.mtl: Text file containing the material (shader information) related to a model.

首先,选择目录,导入你的静态模型。记住,这个目录必须在…Crysis Wars/Game/Objects下。同样的,你不能导出文件到其他硬盘。

路径文本输入的路径只显示部份内容。任何在此路径“…/Crysis Wars/Game/Objects/…”前的内容将不会出现。这是为了保持较短的路径,能够一眼就看到导出的目录。如果你在文本字段悬停鼠标,完整的路径将会出现。请注意,你也可以右键单击路径行快速访问书签菜单,可让你即时访问过去五个你使用的位置。

在 “File Type”下拉菜单中选择“.CGF” 文件。然后选中“Export!”导出,默认情况下,如果A.MTL已经存在,那MAYACGF不会覆盖它,除非你选中“Overwrite .mtl File”选项。但请注意,if you spend time tweaking the material file within Sandbox2, you wouldn’t want to overwrite it with the default “bland” one!(看E文快到极限了。。脑仁很难受啊。。)

当您导出一个静态模型,创建下列文件:

.dae: 那些是临时Collada文件,得到你的模型的文档由Crytek编译器产生文件为CryEngine2所用。
.cgf: 二进制文件包含的网格(顶点,法线等…的数据)
.mtl: 文本文件包含的材质(着色信息)相关的模型。
英文水平有限。。请见谅,大体应该能看懂吧。。。斜体的文字我基本看上下文蒙的。。

有问题可以参与答疑

0回复MAYA到crysis简单教程"

留下信息

电子邮件地址不会被公开。 必填项已用*标注