求翻译!插件ms3dImportExport_ver1_1说明
本帖最后由 renyil 于 2011-7-22 11:11 编辑这是1.1的
Release Notes for ms3dImportExport_ver1_1.ms:
Author: KnightErrant
Date: 02 December 2007
General Information:
This is an update to the importer/exporter of Milkshape .ms3d files into 3ds Max
and Gmax. It adds two new buttons for importing and exporting geometry only data,
that is, not full models but partial geometries without bones.It also fixes
three bugs (described below).
The zip file contains the MaxScript ms3dimportexport_ver1_1.ms, the original
readme.txt file, now called readme_ver1_0.txt, a readme_ver1_1.txt file which
contains the information from this post in a little more detail, and two
files needed by Gmax users but not by 3ds Max users.The script can be placed in
your scripts subdirectory or any place convenient to your workflow.
Usage Information:
Click the Max Script menu item, then Run Script, then mouse to the directory containing
ms3dimportexport_ver1_1.ms and double click to run it.It will display a simple rollout
with "import ms3d file", "export ms3d file", and the two new buttons,
"import geometry only" and "export geometry only".
The two new buttons can be used this way.Suppose one likes a shield on one
model and wants to use it on another model or several other models.Import
the full model using "import ms3d file" and then click "export geometry only".
This will display a listbox containing the meshes in the scene. Double click
an entry to select it.Your selection will be echoed in the listener.You
are not limited to a single selection so double click all the meshes you wish
to export; they will also be echoed in the listener.The script does check
if you select an item twice which it doesn't allow.Click the "finished selecting"
button when done.
(1) If you are a 3ds Max user the script will open a file chooser for you to
enter a name for the .ms3d file to save to.It will then write the file.
(2) If you are a Gmax user the script exports the data to the listener just
like exporting a full model.You then have to use the supplied GMaxSLGRAB.exe
utility to copy the data from the listener into a ASCII text file that
you name.Then you have to run the Python ascii2ms3dconverter.py utility
to convert it into a binary .ms3d file with the same name but .ms3d extension.
You can then reset and import a desired model you want to add your saved shield to.
Delete the shield you don't want and then click the "import geometry only"
button and select the file you saved previously.The desired object should
appear in the scene.If you exported a fully defined object, that is, one
with uv coordinates and bone assignments and weighting, that information
is preserved and a skin modifier will be put on the object.
Additional error checking:
On export the script now checks for defined grouptypes and groupflags.Rather
than just stopping with an error, it now prompts you to enter these.On exporting
a full model without a bounding sphere, it tells you it is supplying a default one.
If it finds an unassigned vertex, it will inform you which mesh the problem occurs
in and then terminate.
Bug fixes:
Fix 1: Most glaring bug is that the uv maps are upside down in version 1_0.
The correct transformation was in Vercingetorix's script, I just didn't
see it.It is v -> 1 - v when converting from meshes and Milkshape to
3ds Max and Gmax.This is now done for all imports and exports.
Fix 2: A more subtle bug, again correctly done in Verc's script, is that
texture vertices and geometry vertices have no 1-1 correspondence in
3ds Max.You don't notice this if you just import a model and then export
it because they do have a 1=1 correspondence in a mesh file.Here's the
documentation on the subject.
BEGINNING OF DOCUMENTATION:
It is very important to note that
A - There can be more or less texture and color vertices than there are mesh vertices
B - There are always exactly as many mesh faces as there are texture and color faces!
So there is no one-to-one correspondence between mesh vertices and texture and color vertices.
You cannot take vertex number 10 from the mesh and expect that texture vertex 10 will store
the information about its texturing or color vertex 10 would define its vertex color.
As mentioned in B , the number of faces is always identical. Not only this, the indices of
the mesh and texture resp. color faces have a one-to-one correspondence! If face 5 has 3 mesh
vertices you are interested in, their corresponding texture vertices will be the 3 vertices
referenced by the texture face number 5.
This is the key to access to texture and color information in 3ds Max!
Finding the corresponding vertices
In order to find out which texture vertex corresponds to a mesh vertex, you have to do the following:
1. Take the index of the mesh vertex.
2. Find out which faces reference the index of the face.
3. Note the number of the vertex (1st, 2nd or 3rd - .x, .y or .z) inside each face.
4. For each face referencing the vertex, get the texture face with the same index.
5. Get the index of the respective texture vertex from the face - 1st, 2nd or 3rd / .x, .y or .z
6. The vertex you got corresonds to the mesh vertex we started with.
7. Repeat steps 3 to 6 for all faces found.
Same applies to color vertices.
END OF DOCUMENTATION:
The release notes in the header comments of ms3dImportExport_ver1_1.ms have the
commands you have to use to implement the above algorithm.
Fix 3: For animated files I said I had computed the basevert_array so that on back conversion
you obtain the basepose when you open the file in Milkshape.Well, that was half true, you
get the basepose if you are a Gmax user but I forgot to implement that for the 3ds Max
side.There you get the regular vert_array which would be whatever animation frame
was displayed when you exported.The animation data in the bones was still correct, you
just got a distorted mesh that would look terrible if you played the animation in Milkshape.
Now on the 3ds Max side, it looks at a flag to decide if there is animation data present
and stored in the root bone (an animheader entry). If so, it writes out the basevert_array.
原插件http://www.twcenter.net/forums/downloads.php?do=file&id=1745
可将中2的兵模导出
谢绝机译!!!
这是1.0的
Release Notes for ms3dImportExport_ver1_0.ms:
Author: KnightErrant
Date: 17 November 2007
General Information:
ms3dImportExport_ver1_0.ms is an importer and exporter script for 3ds Max
and Gmax to bring in Milkshape binary .ms3d format files and export models
to the same format.It brings in and preserves all the information necessary
for models to be reconverted to the .mesh format.This includes mesh geometry,
bones, bone assignments, vertex weighting, uv coordinates, as well as specialized
data such as group names, types, and flags, as well as bounding sphere data.
Animation is accomodated in the sense that .ms3d files can contain animation
data, through the use of the Python animation utilities, and these are imported
transparently.Similarly, modified animation files can be exported and the new
animations extracted to .cas files using the animextract function from the utilties.
Regular units, mounts, and siege engines are supported as are their animated
versions except for siege engines (the animation utilities don't support animating
siege engines).
The release includes ms3dImportExport_ver1_0.ms, this readme.txt file, an executable
GmaxSLGRAB.exe that can extract the contents of the listener window to a user
defined file, and a Python utility ascii2ms3dconverter.py that can convert the
extracted ASCII file to the binary .ms3d file format.
Usage Information:
The script can be put in the scripts subdirectory of 3ds Max or Gmax.It can also
be put in any convenient working directory where the user's models are.To run
click the Max Script menu item, then Run Script, then mouse to the directory containing
ms3dimportexport_ver1_0.ms and double click to run it.It will display a simple rollout
with import and export buttons.
Click the "Import ms3d file" button and mouse to the .ms3d file to import and double
click it.This file will be read and converted into a model in 3ds Max or Gmax.Note
that the vertex weighting function takes roughly 30 seconds or more depending on the
size of the model; a progress bar tracks this processing.
Click the "Export ms3d file" button to do the reverse process.Some technical issues
related to the skin modifier are discussed below.Note that if any vertices are not
assigned to a bone the script will fail.This is a good thing since these models will
cause problems when put in game.
Acknowledgements:
Bwian for getting me started with Gmax and sending a link to Vercingetorix's script.
Vercingetorix for writing the wonderful script in the first place.
Aymar de Bois Mauri for explaining that "groups" in 3ds Max can only be made by making multiple meshes,
a conceptual roadblock for me coming from Milkshape.
GrumpyOldMan for sending along the listener data grabbing utility: GmaxSLGRAB.exe (discussed below).
Technical Bits for Gmax Users:
------------------------------
(1) The export procedure for Gmax:
Among the many runtime features turned off in Gmax, the ability to write ASCII or binary files
is one of the most frustrating things to lose.The procedure I've seen other authors do for
Gmax is export to the listener window and then cut and paste into a text file.Fortunately,
GrumpyOldMan heard my pain and found a utility that does this for you.This has been
included in the zip file and is called GMaxSLGRAB.exe.Once you have exported to the listener
double click this file.It displays a small Window with one big button with "grab" as the
label.Click the "grab" button and it copies the data from the listener and prompts you
for a filename to save it to.Note that it supplies an .xml filter but my recommendation is
to explicitely type a .txt extension for your filename to override this.It will warn
you if you are going to overwrite an existing file and it displays "done" after writing the
file.
Now your data is out but in a useless made up format of mine.Now you run the supplied
Python utility ascii2ms3dconverter.py by either double clicking it or right clicking and
selecting open.It pops up a filechooser and you select the text file you just made and
it reads the data and converts it to binary .ms3d format.Only slightly more complicated
than the 3ds Max way.
(2) Exporting big models clobbers the listener window, here's a workaround:
Cut and paste the following into a file and name it clearlistener.mcr.
macroScript clearListener
category:"Helpers and Gizmos"
internalcategory:"Helpers and Gizmos"
tooltip:"Clear Listener"
ButtonText:"Clear Listener"
Icon:#("Helpers",1)
(
on execute do clearlistener()
)
Put it in your ui\macroscripts directory.In Gmax click the customize menu item
and then select customize user interface.In the dialog that pops up click the toolbars
tab and scroll down until you see clearlistener, Click and drag it to your main toolbar.
Then click the save button to update your configuration.Now when the listener gets
filled up by an export and won't allow you to type in it, you can hit this button to clear it.
Technical Bits for All Users:
-----------------------------
(1) Where's the data stored?
In Milkshape the group name, type, and flag are stored in the group comments and the bounding
sphere data is stored in the model comment.In 3ds Max and Gmax the name of a given mesh is
the group name and the group type and flag are stored in user defined properties.To see them
select the mesh with the Select Objects dialog, then under the edit menu item select Object
Properties, then select the User Defined tab to see the group name and flag.
The bounding sphere is stored in the root bone: bone_pelvis for humanoids, bone_H_Saddle for
horses, bone_camel_root for camels, bone_E_platform for elephants, and USUALLY bone_body for
siege engines.The bounding sphere is stored as ASCII floats joined by % signs.
(Oddity of Gmax, maybe of 3ds Max, you can store strings with spaces in User Properties and
see them there, but only the first whole word comes back out, hence the need to make strings
with no spaces.)
When dealing with animated files, the .cas header, hierarchy, and footer strings are stored in
the first three joint comments in Milkshape.In 3ds Max and Gmax they are stored in the root
bone as well and you can see them in User Properties.They also are ASCII format numbers joined
by percent signs.Underscores would have looked better but texture paths for siege engines
have underscores so I couldn't use them because I tokenize the string based on the chosen delimeter.
Naturally for siege engines, the three texture paths are stored here, it's just that
their keywords are: animheader, animhierarchy, and animfooter.This may change if I get
animation utilities to work with siege engines.
(2) Known Deficiencies:
The script works on unanimated regular units converted by GrumpyOldMan's converter and
unanimated mounts and siege engines converted by my Python converter.It also works
for animated regular units and mounts.It WON'T work for animated siege engines because
I store the three texture paths for siege engines in the joints comments but I also
store the .cas file animation headers, hierarchy, and footers in the joints comments.
Haven't worked through this conflict yet.
Not a deficiency of this script but if people are going to start using the Python animation
utilities (version 1_1 uploaded June 18, 2007) there are three known bugs.
1 - on line 1092 in the animextract function there's this extraneous entry
float_vec3.fromfile( fidcas, 7 )
I can't fathom how it got there, it wasn't there when I tested everything.
Just comment it out with a pound sign like
# float_vec3.fromfile( fidcas, 7 )
2 - Converttxttocas doesn't convert the degrees back to radians.Oops, it's fixed just
have to post an updated copy.
3 - I didn't check for uppercase extensions so some cas files that look like name.CAS
don't get exported to.Bwian found this one in the exportskeleton function.Also
fixed just not released.
(3) Modifier Stack:
The export only works if the skin is at the top of the modifier stack for each mesh
in the model.You can do this manually by clicking and holding the modifier and
moving it.A "feature" of Gmax at least is that if you do this to the skin modifier
to move it to the top of the stack it loses all its information about bone assignments
and weighting.On the other hand, if you manually move all other modifiers below the
skin modifier, the information is retained and the export works.I've duplicated this
procedure in the script so that if the skin modifier is NOT at the top of the stack,
I make full copies of all the modifiers above the skin modifier, delete the originals
so that the skin modifier is at the top, and then recreate the other modifiers, in order,
below the skin modifier.The script will stop and ask if you want it to do this procedure
or to terminate.
(4) Trying to reconstruct the basepose on exporting an animated model:
Having used Milkshape first I expected animated files to look the same way in Gmax,
that is, be in the basepose and only change to animations when you hit the animate button.
Bwian explained this isn't the way it works, animations are just done differently between
the two.If I simply exported the same way I did a regular model I get the vertex positions
of whatever frame happens to be displayed at the time.If you opened this is Milkshape you'd
see the bones in the basepose and a distorted mesh.The animations are perfectly good and
you can run animextract to make a perfectly good .cas file but this is still unsightly.
So to get an approximation to the basepose mesh I followed this procedure.For each vertex
get its primary bone assignment.In that bone's coordinate system get the vertex position, i.e.,
relative to the pivot point.Now get the relative bone positions all the way up the hierarchy
to the root bone and add them up.This SHOULD be the vertex position in world or object
or whatever the outside coordinate system is.(bone_pelvis is hard coded to be at (0, 0, 0) since
its position got overridden by the animation data.)For armored_sergeants this was good to
about a percent, too large to be round-off error but too small to detect in Milkshape.
So the warning is: don't reimport a previously exported animated model, it's akin
to making a xerox of a xerox.Again, this is just for aesthetics, you only want the
animation data from an exported animated model, you never backconvert these to meshes.
(5) Bone Assignments:
Mesh files always have two bone assignments, a primary and a secondary, even if the
vertex weighting on the secondary is zero.Gmax ignores an assignment with a zero weight
so to preserve these two bones I weight the secondary one with 0.00001 and the primary with
0.99999.This satisfies Gmax to keep two assignments but on conversion back to Milkshape
format it rounds back to 100 percent on the primary and 0 percent on the secondary and everybody's
happy.Custom made models in Milkshape frequently have only a single bone assignment
so the secondary Id is -1.To be safe and ensure that there are always two bone assignments
I arbitrarily made the secondary assignment to the root bone with a weight of 0.00001.
全人工翻译。有错误之处请之处~多谢~
Release Notes for ms3dImportExport_ver1_1.ms:
Author: KnightErrant
Date: 02 December 2007
ms3dImportExport_ver1_1.ms版本注释:
作者:KnightErrant
发布日期:2007年12月2日
General Information:
This is an update to the importer/exporter of Milkshape .ms3d files into 3ds Max
and Gmax. It adds two new buttons for importing and exporting geometry only data,
that is, not full models but partial geometries without bones.It also fixes
three bugs (described below).
简介:
本软件可以将Milkshape .ms3d文件导入或导出3dsMax和Gmax软件。1.1为本软件的更新,它增加了两个新按钮用于导入和导出只含有几何多边形的文件。这些文件不是完整的模型,只有几何形状而没有骨骼。1.1版还修正了3个bug(稍后会详细说明)。
The zip file contains the MaxScript ms3dimportexport_ver1_1.ms, the original
readme.txt file, now called readme_ver1_0.txt, a readme_ver1_1.txt file which
contains the information from this post in a little more detail, and two
files needed by Gmax users but not by 3ds Max users.The script can be placed in
your scripts subdirectory or any place convenient to your workflow.
这个Zip压缩文件包含Max脚本文件,也就是ms3dimportexport_ver1_1.ms,以及原来的自述文件(现在改名叫readme_ver1_0.txt)和1.1版的自述文件readme_ver1_1.txt,最后是两个Gmax软件使用者需要而3dsMax使用者无需使用的文件。最新的自述文件包含本帖提到的更新细节。本脚本既可以置于Max的脚本子目录下,又可以按照你的工作需要置于任意目录下。
Usage Information:
Click the Max Script menu item, then Run Script, then mouse to the directory containing
ms3dimportexport_ver1_1.ms and double click to run it.It will display a simple rollout
with "import ms3d file", "export ms3d file", and the two new buttons,
"import geometry only" and "export geometry only".
使用指南:
单击打开Max中的脚本菜单,点击运行脚本。找到包含ms3dimportexport_ver1_1.ms的目录,并双击之以运行。之后该脚本便会显示出一个下拉菜单,包括导入ms3d文件(import ms3d file)、导出ms3d文件(export ms3d file)、仅导入几何多边形(import geometry only)、仅导出几何多边形(export geometry only)等按钮。导入和导出几何多边形按钮为1.1版本新添加内容。
The two new buttons can be used this way.Suppose one likes a shield on one
model and wants to use it on another model or several other models.Import
the full model using "import ms3d file" and then click "export geometry only".
This will display a listbox containing the meshes in the scene. Double click
an entry to select it.Your selection will be echoed in the listener.You
are not limited to a single selection so double click all the meshes you wish
to export; they will also be echoed in the listener.The script does check
if you select an item twice which it doesn't allow.Click the "finished selecting"
button when done.
你可以这样用导入和导出几何多边形按钮。假设你喜欢一个兵模所持的盾牌,想把它用在其他人身上。单击导入ms3d文件按钮导入完整模型再按仅导出几何多边形。之后你会看见一个列表框,上面包含了场景中的网格。双击一个条目以选中,你的选择将会被记录。一次选择可以选很多条线,所以一次都选上吧。如果一个物件你选了两次,脚本会侦测到并不会选它。点击结束选择(finished selecting)按钮当你选完。
(1) If you are a 3ds Max user the script will open a file chooser for you to
enter a name for the .ms3d file to save to.It will then write the file.
(2) If you are a Gmax user the script exports the data to the listener just
like exporting a full model.You then have to use the supplied GMaxSLGRAB.exe
utility to copy the data from the listener into a ASCII text file that
you name.Then you have to run the Python ascii2ms3dconverter.py utility
to convert it into a binary .ms3d file with the same name but .ms3d extension.
You can then reset and import a desired model you want to add your saved shield to.
Delete the shield you don't want and then click the "import geometry only"
button and select the file you saved previously.The desired object should
appear in the scene.If you exported a fully defined object, that is, one
with uv coordinates and bone assignments and weighting, that information
is preserved and a skin modifier will be put on the object.
(1)如果你使用的是3dsMax软件,脚本会激活一个文件选择窗口让你给需要保存的.ms3d文件命名,然后写入文件。
(2)如果你使用的是Gmax软件,脚本会导出文件给监听器就像导出完整模型一样。然后你必须使用提供的GMaxSLGRAB.exe通用版来将监听器的文件转成 一个你命名的ASCII 代码文本文件。之后你运行 Python ascii2ms3dconverter.py 通用版以把它转换成一个同名的二进制 .ms3d扩展文件。然后你可以重置再导入你所想要加上盾牌的模型。删掉你不想要的盾牌,再点选仅导出几何图形按钮,选择你之前保存的文件。那个你渴望已久的盾牌将会出现在场景中。如果你导入的是完整清晰的物体,那么UV烘焙贴图坐标和骨架重量还有皮肤编辑器将会被添加,前提是有相关信息的话。
Additional error checking:
On export the script now checks for defined grouptypes and groupflags.Rather
than just stopping with an error, it now prompts you to enter these.On exporting
a full model without a bounding sphere, it tells you it is supplying a default one.
If it finds an unassigned vertex, it will inform you which mesh the problem occurs
in and then terminate.
附加的错误检查:
导出时脚本将会检查详细的组种类和字段。如果没有,脚本会要求你键入它们,而不是自己简单地弹出报错。导出一个没有bounding sphere的完整模型时,脚本会给你添加一个默认的。当脚本发现一个未指定的顶点时,它会通知你来修复问题。
Bug fixes:
Fix 1: Most glaring bug is that the uv maps are upside down in version 1_0.
The correct transformation was in Vercingetorix's script, I just didn't
see it.It is v -> 1 - v when converting from meshes and Milkshape to
3ds Max and Gmax.This is now done for all imports and exports.
Fix 2: A more subtle bug, again correctly done in Verc's script, is that
texture vertices and geometry vertices have no 1-1 correspondence in
3ds Max.You don't notice this if you just import a model and then export
it because they do have a 1=1 correspondence in a mesh file.Here's the
documentation on the subject.
Bug修正:
修正1:最要命的Bug是在1.0版本中模型的UV贴图上下颠倒。正确的变换信息在Vercingetorix的脚本中有。我只是没看到它。在把Milkshape中的网格变换入3dsMax和Gmax时须经历v -> 1 - v的变化,现在所有导入导出操作均无问题。
修正2:一个有些微妙的问题。Verc的脚本中也解决了它,那就是材质顶点和几何顶点在3dsMax中没有一一对应。如果你只是导入导出文件的话是不会注意到的——因为它们在网格上的确是一一对应的 - -|||。下面是有关它的文件。
BEGINNING OF DOCUMENTATION:
It is very important to note that
A - There can be more or less texture and color vertices than there are mesh vertices
B - There are always exactly as many mesh faces as there are texture and color faces!
So there is no one-to-one correspondence between mesh vertices and texture and color vertices.
You cannot take vertex number 10 from the mesh and expect that texture vertex 10 will store
the information about its texturing or color vertex 10 would define its vertex color.
As mentioned in B , the number of faces is always identical. Not only this, the indices of
the mesh and texture resp. color faces have a one-to-one correspondence! If face 5 has 3 mesh
vertices you are interested in, their corresponding texture vertices will be the 3 vertices
referenced by the texture face number 5.
This is the key to access to texture and color information in 3ds Max!
说明的开始:
这是一个非常重要的因为
A 网格顶点在材质和颜色顶点上多少有些不同。
B 网格面有多少,材质与颜色面就有多少!
所以网格顶点与材质颜色顶点压根儿没有一一对应的关系。
不要想从网格中选10号点然后指望着材质点10号能记录它的材质,或巴望着10号颜色点能准确记录它的颜色。
就像我在B中提到的那样,面的数量是完全相同的。不仅如此,网格材质颜色面的指数是一一对应的!如果5号面有三个你感兴趣的网格点,它们的对应材质将会是三个在5号材质面上的参考点。
这就是得到3dsMax中材质与色彩信息的不二法门!
Finding the corresponding vertices
In order to find out which texture vertex corresponds to a mesh vertex, you have to do the following:
1. Take the index of the mesh vertex.
2. Find out which faces reference the index of the face.
3. Note the number of the vertex (1st, 2nd or 3rd - .x, .y or .z) inside each face.
4. For each face referencing the vertex, get the texture face with the same index.
5. Get the index of the respective texture vertex from the face - 1st, 2nd or 3rd / .x, .y or .z
6. The vertex you got corresonds to the mesh vertex we started with.
7. Repeat steps 3 to 6 for all faces found.
Same applies to color vertices.
找到对应的顶点:
为了找出一个网格点对应的一个材质点,你必须按照如下操作进行:
1. 取得网格点的参数
2. 找出参考该面参数的面。
3. 给每个面里的顶点编号。
4. 对于那些参考顶点的面,让材质面拥有同样的参数。
5. 从面上各自的材质点上得到参数。
6. 你得到的点对应了我们开始时的网格点。
7. 重复3至6步以覆盖全部的面。
对于颜色面亦可同样处理。
END OF DOCUMENTATION:
The release notes in the header comments of ms3dImportExport_ver1_1.ms have the
commands you have to use to implement the above algorithm.
说明的结束:
在ms3dImportExport_ver1_1.ms的header comments中有发布声明,它包含你用来执行以上演算操作的各项命令。
Fix 3: For animated files I said I had computed the basevert_array so that on back conversion
you obtain the basepose when you open the file in Milkshape.Well, that was half true, you
get the basepose if you are a Gmax user but I forgot to implement that for the 3ds Max
side.There you get the regular vert_array which would be whatever animation frame
was displayed when you exported.The animation data in the bones was still correct, you
just got a distorted mesh that would look terrible if you played the animation in Milkshape.
Now on the 3ds Max side, it looks at a flag to decide if there is animation data present
and stored in the root bone (an animheader entry). If so, it writes out the basevert_array.
修正3:对于动画文件我说过我已经编出了 basevert_array ,为了能在变换后你在Milkshape中打开文件后能够得到基本动作。额,我的基本能对一半儿,因为Gmax用户可以,但3dsMax用户不行(我忘了编它)。那样的话你可以得到常规的vert_array,导出时你可以在任何动作框架内看见它。不过骨骼中的动作信息依旧是对的,你会看到一个长的很残酷扭曲的网格,如果你在Milkshape中播放它的动画。现在在3dsMax上会出现一个标记让你来决定是否有动作文件存在并储存于root bone (an animheader entry)之中。如果是这样的话,那么脚本会制作出basevert_array。
注:有两个词意思可能有些许偏差,请谅解~ index、vertex
原插件http://www.twcenter.net/forums/downloads.php?do=file&id=1745
在线等啊!现在的论坛好冷清啊!! 回复 renyil 的帖子
等你 翻译完 !!继续给你加分!!:victory:
我来翻译
本帖最后由 三国迷NO.1 于 2011-7-27 21:34 编辑我来翻译。
ms3dImportExport_ver1_1.ms释放的笔记。
Author: KnightErrant作者:KnightErrant
Date: 02 December 20072007年12月2日:
General Information:一般信息:
This is an update to the importer/exporter of Milkshape .ms3d files into 3ds Max这是一个更新的进口商、出口商的Milkshape .ms3d文件到3 ds Max
and Gmax. 和Gmax。It adds two new buttons for importing and exporting geometry only data,它增加了两个新的按钮为进出口几何只有数据,
that is, not full models but partial geometries without bones. 这是不充分的,但是没有骨头部分几何模型。It also fixes它也修复
three bugs (described below).三个错误(下述)。
The zip file contains the MaxScript ms3dimportexport_ver1_1.ms, the original压缩文件包含了ms3dimportexport_ver1_1.ms MaxScript,原
readme.txt file, now called readme_ver1_0.txt, a readme_ver1_1.txt file which现在被称为readme_ver1_0.txt帮助文件中编档了,readme_ver1_1.txt文件
contains the information from this post in a little more detail, and two其所含信息从这篇文章的细节,又有两个轮班替换
files needed by Gmax users but not by 3ds Max users. 文件Gmax用户所需要的而不是由3 dsmax中用户。The script can be placed in脚本可以放置在
your scripts subdirectory or any place convenient to your workflow.你的脚本或子目录中任何地方方便你的工作流程。
Usage Information:使用信息:
Click the Max Script menu item, then Run Script, then mouse to the directory containing点击马克斯脚本菜单项,然后运行的脚本,那么鼠标目录包含
ms3dimportexport_ver1_1.ms and double click to run it. ms3dimportexport_ver1_1.ms和双击运行它。It will display a simple rollout它将显示一个简单的首次展示
with "import ms3d file", "export ms3d file", and the two new buttons,以“进口ms3d文件”、“出口ms3d文件”,但是这两个新钮扣,
"import geometry only" and "export geometry only".“进口几何只有”和“出口几何只有”。
The two new buttons can be used this way. 这两个新的按钮可以用这种方式。Suppose one likes a shield on one假设一个人喜欢的护盾
model and wants to use it on another model or several other models. 模型和想用它在另外一个模型或其他模型。Import进口
the full model using "import ms3d file" and then click "export geometry only".完整的模型ms3d文件使用“进口”,再按“出口几何只有”。
This will display a listbox containing the meshes in the scene. 这将显示一个列表框中插入列包含网格在场景里。Double click双击
an entry to select it. 一个条目的选择。Your selection will be echoed in the listener. 你的选择将会回荡在听众。You你
are not limited to a single selection so double click all the meshes you wish不局限于单一的选择所有的网格所以双击你希望什么
to export; they will also be echoed in the listener. 出口;他们也会回荡在听众。The script does check剧本并检查
if you select an item twice which it doesn't allow. 如果你选择一个项目,它不允许两次。Click the "finished selecting"单击“完成”选择
button when done.按钮,当完成。
(1) If you are a 3ds Max user the script will open a file chooser for you to(1)如果你是一个3 dsmax中用户选用自创剧本将为你打开文件
enter a name for the .ms3d file to save to. 输入文件名称,.ms3d救。It will then write the file.它将然后写文件。
(2) If you are a Gmax user the script exports the data to the listener just(2)如果你是一个Gmax用户脚本的出口数据给听众而已
like exporting a full model. 一个完整的模型和出口一样。You then have to use the supplied GMaxSLGRAB.exe然后你必须使用提供的GMaxSLGRAB.exe
utility to copy the data from the listener into a ASCII text file that实用的数据拷贝到一个ASCII文本文件的听众
you name. 你的名字。Then you have to run the Python ascii2ms3dconverter.py utility然后你要跑那条蟒蛇ascii2ms3dconverter.py效用
to convert it into a binary .ms3d file with the same name but .ms3d extension.转换成二进制.ms3d有同样的文件的名字,但.ms3d延伸。
You can then reset and import a desired model you want to add your saved shield to.然后你可以复位和进口预期你要增加你模型救了他们的盾牌。
Delete the shield you don't want and then click the "import geometry only"删除保护你不想要的,然后点击“进口几何只有”
button and select the file you saved previously. 按钮,选择文件你救了以前。The desired object should理想的对象应
appear in the scene. 出现在现场。If you exported a fully defined object, that is, one如果你出口完全定义的对象,这就是说,一个
with uv coordinates and bone assignments and weighting, that information与uv坐标和骨的作业和重量,这些信息
is preserved and a skin modifier will be put on the object.保存修改一个皮肤,将对象。
Additional error checking:额外的错误检查。
On export the script now checks for defined grouptypes and groupflags. 在出口剧本现在检查grouptypes和groupflags定义。Rather而
than just stopping with an error, it now prompts you to enter these. 不仅仅是停止一个错误,现在让你进入这些。On exporting在年出口
a full model without a bounding sphere, it tells you it is supplying a default one.一个完美的模型没有碰撞球,它告诉你它是提供一个默认的。
If it finds an unassigned vertex, it will inform you which mesh the problem occurs如果找到了一个unassigned顶点,它就会通知你的问题就会出现网格
in and then terminate.,然后终止。
Bug fixes:修复错误:
Fix 1: Most glaring bug is that the uv maps are upside down in version 1_0.修理1:最明显的错误就是uv贴图是版本1 _0翻过来。
The correct transformation was in Vercingetorix's script, I just didn't正确的改革是在Vercingetorix的剧本,我只是没有
see it. 看到它。It is v -> 1 - v when converting from meshes and Milkshape to这是v - > 1 - v转换时从网格划分和Milkshape
3ds Max and Gmax. Gmax 3 ds Max。This is now done for all imports and exports.这是现在所作的所有进口和出口。
Fix 2: A more subtle bug, again correctly done in Verc's script, is that修理2:一个更微妙的错误,再正确地做Verc的剧本,就是这个了
texture vertices and geometry vertices have no 1-1 correspondence in纹理顶点和几何顶点对应没有1 - 1
3ds Max. 3 ds Max。You don't notice this if you just import a model and then export你根本没有注意到这个,如果你只是导入一个模型,然后出口
it because they do have a 1=1 correspondence in a mesh file. 它,因为他们有一个1 = 1对应网格文件。Here's the这是
documentation on the subject.文件的内容。
BEGINNING OF DOCUMENTATION:开始的文档:
It is very important to note that这是非常重要的注意
A - There can be more or less texture and color vertices than there are mesh verticesA -可以有更多或更少的质地和颜色比网格顶点的顶点
B - There are always exactly as many mesh faces as there are texture and color faces!B -总有许多网格的脸一样有质地和颜色的脸!
So there is no one-to-one correspondence between mesh vertices and texture and color vertices.所以没有一对一的对应关系网格顶点和质地、颜色顶点。
You cannot take vertex number 10 from the mesh and expect that texture vertex 10 will store你不能带顶点10号从网格,预计10纹理顶点的商店
the information about its texturing or color vertex 10 would define its vertex color.信息对其材质和颜色10定义它的顶点顶点的颜色。
As mentioned in B , the number of faces is always identical. 如上的数量在B,脸总是相同的。Not only this, the indices of不仅如此,指标
the mesh and texture resp. color faces have a one-to-one correspondence! 网格和纹理颜色的脸型一对一丙信件!If face 5 has 3 mesh如果面对5有三个网格
vertices you are interested in, their corresponding texture vertices will be the 3 vertices顶点你有兴趣的话,他们会相应的纹理顶点3点
referenced by the texture face number 5.引用纹理面5号。
This is the key to access to texture and color information in 3ds Max!这是钥匙进入质地、颜色信息在3 dsmax中!
Finding the corresponding vertices找到相应的顶点
In order to find out which texture vertex corresponds to a mesh vertex, you have to do the following:为了找出哪些纹理顶点对应一个网格顶点,你必须做到以下几点:
1. 1。Take the index of the mesh vertex.以指数的网格顶点。
2. 2。Find out which faces reference the index of the face.找出哪些参考指标的脸脸。
3. 3。Note the number of the vertex (1st, 2nd or 3rd - .x, .y or .z) inside each face.值得注意的是数量的顶点(1日或3rd 2nd——.x,.y或.z)内每一张脸。
4. 4。For each face referencing the vertex, get the texture face with the same index.为每一张脸参考顶点,得到了面对相同指标的纹理。
5. 5。Get the index of the respective texture vertex from the face - 1st, 2nd or 3rd / .x, .y or .z得到了各自的纹理顶点索引的脸- - - 1日或3rd 2nd / .x,.y或.z
6. 6。The vertex you got corresonds to the mesh vertex we started with.你有corresonds顶点的网格顶点我们了。
7. 7。Repeat steps 3 to 6 for all faces found.重覆执行步骤3至6为所有人的脸现在都发现。
Same applies to color vertices.相同的颜色顶点。
END OF DOCUMENTATION:最后文件:
The release notes in the header comments of ms3dImportExport_ver1_1.ms have the释放在页眉的评论指出ms3dImportExport_ver1_1.ms有
commands you have to use to implement the above algorithm.你必须使用命令来实现上述算法。
Fix 3: For animated files I said I had computed the basevert_array so that on back conversion修理三:动画文件我说我计算basevert_array这样背转换
you obtain the basepose when you open the file in Milkshape. 您获得basepose当你打开这个文件Milkshape。Well, that was half true, you好了,这是真的,你一半
get the basepose if you are a Gmax user but I forgot to implement that for the 3ds Max把basepose,如果你是一个Gmax用户能够实现,但我忘了为3 ds Max
side. 一边。There you get the regular vert_array which would be whatever animation frame在那里你得到定期vert_array将任何动画帧
was displayed when you exported. 当你展示了出口。The animation data in the bones was still correct, you动画数据依然正确,你骨头
just got a distorted mesh that would look terrible if you played the animation in Milkshape.只是有一个扭曲的网格,看起来太可怕了,如果你扮演Milkshape动画。
Now on the 3ds Max side, it looks at a flag to decide if there is animation data present现在3 dsmax中一边时,它看着国旗来决定是否有动画数据的礼物
and stored in the root bone (an animheader entry). 并保存在根骨头(一个animheader入口)。If so, it writes out the basevert_array.如果真是这样的话,那basevert_array写出来的。
原插件原插件http://www.twcenter.net/forums/downloads.php?do=file&id=1745http://www.twcenter.net/forums/downloads.php?do=file&id=1745
可将中2的兵模导出可将中2的兵模导出
谢绝机译!!!谢绝机译! ! !
这是1.0的这是1.0的
Release Notes for ms3dImportExport_ver1_0.ms:ms3dImportExport_ver1_0.ms释放的笔记。
Author: KnightErrant作者:KnightErrant
Date: 17 November 2007日期:2007年11月17日
General Information:一般信息:
ms3dImportExport_ver1_0.ms is an importer and exporter script for 3ds Maxms3dImportExport_ver1_0.ms是进口商和出口商剧本3 dsmax中
and Gmax to bring in Milkshape binary .ms3d format files and export models和Gmax引进Milkshape二进制格式文件和出口.ms3d模型
to the same format. 相同的格式。It brings in and preserves all the information necessary它能带来和保存所有必要的信息
for models to be reconverted to the .mesh format. 为增加型号的.mesh格式。This includes mesh geometry,这包括网格几何学,
bones, bone assignments, vertex weighting, uv coordinates, as well as specialized骨头,骨头作业、顶点称重、uv坐标,以及专业
data such as group names, types, and flags, as well as bounding sphere data.资料如组的名称、类型、旗帜、以及碰撞球数据。
Animation is accomodated in the sense that .ms3d files can contain animation动画是灵活性在某种意义上说.ms3d文件可以包含动画
data, through the use of the Python animation utilities, and these are imported数据,通过使用那条蟒蛇动画公用事业,这些都是进口的
transparently. 透明的。Similarly, modified animation files can be exported and the new同样,修改动画文件可以出口和新
animations extracted to .cas files using the animextract function from the utilties..cas动画文件中提取到使用animextract从utilties功能。
Regular units, mounts, and siege engines are supported as are their animated正规军,坐骑是围城引擎支持他们的动画
versions except for siege engines (the animation utilities don't support animating版本除了攻城机械(动画公用事业不支持动画
siege engines).围城引擎)。
The release includes ms3dImportExport_ver1_0.ms, this readme.txt file, an executablems3dImportExport_ver1_0.ms释放,这包括帮助文件中编档了,一个可执行的程序
GmaxSLGRAB.exe that can extract the contents of the listener window to a userGmaxSLGRAB.exe的内容,可以提取听众窗口一个用户
defined file, and a Python utility ascii2ms3dconverter.py that can convert the定义文件,一条巨蟒,效用ascii2ms3dconverter.py转换为
extracted ASCII file to the binary .ms3d file format.ASCII文件中提取的二进制.ms3d文件格式。
Usage Information:使用信息:
The script can be put in the scripts subdirectory of 3ds Max or Gmax. 这个脚本可以放在脚本个子目录的3 dsmax中或Gmax。It can also它也可以
be put in any convenient working directory where the user's models are. 放在任何方便的工作目录用户模型的地方。To run跑
click the Max Script menu item, then Run Script, then mouse to the directory containing点击马克斯脚本菜单项,然后运行的脚本,那么鼠标目录包含
ms3dimportexport_ver1_0.ms and double click to run it. ms3dimportexport_ver1_0.ms和双击运行它。It will display a simple rollout它将显示一个简单的首次展示
with import and export buttons.进出口按钮。
Click the "Import ms3d file" button and mouse to the .ms3d file to import and double点击“进口ms3d文件”按钮,只老鼠,这种.ms3d文件输入和双
click it. 请单击它。This file will be read and converted into a model in 3ds Max or Gmax. 这个文件将读和转换成一个模型在3 dsmax中或Gmax。Note注
that the vertex weighting function takes roughly 30 seconds or more depending on the顶点权函数,大约花30秒或更多的依靠
size of the model; a progress bar tracks this processing.大小的一个进度条轨迹模型;这一处理过程。
Click the "Export ms3d file" button to do the reverse process. 点击“出口ms3d文件”按钮来做相反的过程。Some technical issues一些技术上的问题
related to the skin modifier are discussed below. 相关的修改是皮肤下面讨论。Note that if any vertices are not注意,如果任何顶点是没有意义的
assigned to a bone the script will fail. 指派给一个骨脚本可以���败。This is a good thing since these models will这是一件好事因为这些模式
cause problems when put in game.当把导致问题在比赛。
Acknowledgements:出处:
Bwian for getting me started with Gmax and sending a link to Vercingetorix's script.Bwian帮助我开始Gmax和发送链接到Vercingetorix的脚本。
Vercingetorix for writing the wonderful script in the first place.Vercingetorix精彩的剧本写作放在第一位。
Aymar de Bois Mauri for explaining that "groups" in 3ds Max can only be made by making multiple meshes,保尔Aymar德解释,毛里的“组”在3 dsmax中只能由做多网格,
a conceptual roadblock for me coming from Milkshape.给我一个概念性的路障来自Milkshape。
GrumpyOldMan for sending along the listener data grabbing utility: GmaxSLGRAB.exe (discussed below).GrumpyOldMan发送数据为听众抓用途:GmaxSLGRAB.exe(下面讨论)。
Technical Bits for Gmax Users:Gmax技术位用户:
------------------------------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(1) The export procedure for Gmax:(1)为Gmax出口程序:
Among the many runtime features turned off in Gmax, the ability to write ASCII or binary files在众多的运行特点,在Gmax关闭的写作能力ASCII码或二进制文件
is one of the most frustrating things to lose. 是其中一个最令人沮丧的事情要输了。The procedure I've seen other authors do for我看过的程序做其他作者
Gmax is export to the listener window and then cut and paste into a text file. Gmax是出口到听者的窗口,然后复制并粘贴到一个文本文件。Fortunately,幸运的是,
GrumpyOldMan heard my pain and found a utility that does this for you. GrumpyOldMan听到我的痛苦,并且找到了一个工具,这是否适合你。This has been这是
included in the zip file and is called GMaxSLGRAB.exe. 包括在压缩文件和被称为GMaxSLGRAB.exe。Once you have exported to the listener一旦你已经出口到听众
double click this file. 双击这个文件。It displays a small Window with one big button with "grab" as the它显示一个小窗口,一个大的按钮,“抓住”的
label. 标签。Click the "grab" button and it copies the data from the listener and prompts you点击“抓住”按钮,它复制数据,让你的听众
for a filename to save it to. 对于一个文件名保存它。Note that it supplies an .xml filter but my recommendation is注意,它提供了一个extend .但我建议滤波器
to explicitely type a .txt extension for your filename to override this. 对explicitely a型.txt延长你的文件名来推翻。It will warn它会提醒
you if you are going to overwrite an existing file and it displays "done" after writing the你如果你要覆盖现有的一个文件,它显示“做”的写完
file.文件。
Now your data is out but in a useless made up format of mine. 现在你的数据是由但无用的格式我的。Now you run the supplied现在你运行提供了
Python utility ascii2ms3dconverter.py by either double clicking it or right clicking and任何效用ascii2ms3dconverter.py巨蟒,双击它或点击鼠标右键打开
selecting open. 选择打开。It pops up a filechooser and you select the text file you just made and这一filechooser弹出你选择的文本文件,你刚刚做了
it reads the data and converts it to binary .ms3d format. 它读取数据,转换成二进制.ms3d格式。Only slightly more complicated只有更复杂一些
than the 3ds Max way.比3 dsmax中。
(2) Exporting big models clobbers the listener window, here's a workaround:(2)出口大模型可能会影响听者的窗口,这里有一个解决办法:
Cut and paste the following into a file and name it clearlistener.mcr.复制并粘贴到一个文件后,它clearlistener.mcr名字。
macroScript clearListenermacroScript clearListener
category:"Helpers and Gizmos"类别:"小帮手,”
internalcategory:"Helpers and Gizmos"internalcategory:“助手和小玩意儿”
tooltip:"Clear Listener"提示:“明确的听众”
ButtonText:"Clear Listener"ButtonText听众:“清楚”
Icon:#("Helpers",1)图标:#(“助手”,1)
(
on execute do clearlistener()在执行clearlistener(做)
)
Put it in your ui\macroscripts directory. 把它放在你的ui \ macroscripts目录。In Gmax click the customize menu item在Gmax点击自定义菜单项目
and then select customize user interface. 然后选择定制的用户界面。In the dialog that pops up click the toolbars在对话框中,点击工具栏弹出
tab and scroll down until you see clearlistener, Click and drag it to your main toolbar.选项卡,向下滚动,直到你看到clearlistener,点击并拖动它到你的主工具栏。
Then click the save button to update your configuration. 然后点击保存按钮来更新您的配置。Now when the listener gets现在,当听众得到的机会
filled up by an export and won't allow you to type in it, you can hit this button to clear it.登出口,也不允许你输入它,你可以打这个按钮来清除。
Technical Bits for All Users:技术位所有用户:
------------------------------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(1) Where's the data stored?(1)的数据储存在哪里?
In Milkshape the group name, type, and flag are stored in the group comments and the bounding在Milkshape集团名称,类型,以及旗帜都被储存在集团评论和包围
sphere data is stored in the model comment. 领域模型中存储数据的评论。In 3ds Max and Gmax the name of a given mesh isGmax 3 dsmax中,在一个给定的网格的名字
the group name and the group type and flag are stored in user defined properties. 组合名称和群类型和旗帜都存储在用户定义的属性。To see them看到他们
select the mesh with the Select Objects dialog, then under the edit menu item select Object选择网格物体的选择对话框,然后根据编辑菜单项选择对象
Properties, then select the User Defined tab to see the group name and flag.性质,然后选择用户自定义标签来看到团体名称和旗帜。
The bounding sphere is stored in the root bone: bone_pelvis for humanoids, bone_H_Saddle for包围球储存在根骨:bone_pelvis bone_H_Saddle为机器人
horses, bone_camel_root for camels, bone_E_platform for elephants, and USUALLY bone_body for马、骆驼、bone_E_platform为bone_camel_root了大象,通常bone_body
siege engines. 围城引擎。The bounding sphere is stored as ASCII floats joined by % signs.包围球储存成ASCII漂浮了%的迹象。
(Oddity of Gmax, maybe of 3ds Max, you can store strings with spaces in User Properties and(Gmax奇特的,也许对3 dsmax中,你可以存储在用户属性弦乐器与空间
see them there, but only the first whole word comes back out, hence the need to make strings看到他们有,但只有先整体词回来,因此需要作出字符串
with no spaces.)没有空间。)
When dealing with animated files, the .cas header, hierarchy, and footer strings are stored in当处理动画文件,.cas页眉和页脚、分层、存储在字符串
the first three joint comments in Milkshape. 前三个Milkshape联合的评论。In 3ds Max and Gmax they are stored in the root在Gmax 3 dsmax中,他们是保存在根
bone as well and you can see them in User Properties. 骨,你可以看到他们在用户属性。They also are ASCII format numbers joined他们也都是ASCII格式编号加入
by percent signs. 通过的迹象。Underscores would have looked better but texture paths for siege engines强调可能看起来更好,但纹理的路径来围城引擎
have underscores so I couldn't use them because I tokenize the string based on the chosen delimeter.有强调,所以我不能使用他们,因为我tokenize串基于选择的delimeter。
Naturally for siege engines, the three texture paths are stored here, it's just that为围城引擎,自然的路径是储存在这儿三个纹理,而已
their keywords are: animheader, animhierarchy, and animfooter. 他们是:animheader关键词,animhierarchy,animfooter。This may change if I get这可能会改变,如果我得到的
animation utilities to work with siege engines.动画公用事业工作与围城引擎。
(2) Known Deficiencies:(2)已知的不足之处:
The script works on unanimated regular units converted by GrumpyOldMan's converter and在unanimated剧本作品由GrumpyOldMan正规军的转换器和转换
unanimated mounts and siege engines converted by my Python converter. unanimated坐骑和围城引擎转换由我的蟒蛇转换器。It also works它也可以
for animated regular units and mounts. 动画的正规军和坐骑。It WON'T work for animated siege engines because行不通,因为动画的围城引擎
I store the three texture paths for siege engines in the joints comments but I also我店途径三个纹理围城引擎在关节的意见,但我也是
store the .cas file animation headers, hierarchy, and footers in the joints comments..cas存储文件标题、分层、动画和页脚在关节的评论。
Haven't worked through this conflict yet.通过这次冲突没有做过呢。
Not a deficiency of this script but if people are going to start using the Python animation没有缺乏这个脚本,但如果人们要开始使用Python动画
utilities (version 1_1 uploaded June 18, 2007) there are three known bugs.设施(版本1 _1上传的2007年6月18日)有三个已知的错误。
1 - on line 1092 in the animextract function there's this extraneous entry1092年1 -在线的animextract功能有这些额外的入口
float_vec3.fromfile( fidcas, 7 )float_vec3.fromfile(fidcas,7)
I can't fathom how it got there, it wasn't there when I tested everything.我无法领会它如何到达那儿的时候,它已经不在那儿我测试的一切。
Just comment it out with a pound sign like它只是评论标志犹如一磅
# float_vec3.fromfile( fidcas, 7 )(fidcas # float_vec3.fromfile,7)
2 - Converttxttocas doesn't convert the degrees back to radians. 2 - Converttxttocas不把度回弧度。Oops, it's fixed just哎呀,这��固定只是
have to post an updated copy.要发布一个更新的副本。
3 - I didn't check for uppercase extensions so some cas files that look like name.CAS3 -我没有检查大写的延伸这样看起来像name.CAS cas文件
don't get exported to. 不要让出口。Bwian found this one in the exportskeleton function. Bwian发现,这一次在exportskeleton功能。Also也
fixed just not released.固定不释放。
(3) Modifier Stack:(3)修改堆栈:
The export only works if the skin is at the top of the modifier stack for each mesh出口只有工程,假如皮肤在顶部的修改堆栈为每个网格
in the model. 在模型。You can do this manually by clicking and holding the modifier and你可以做这个手动点击修改,握住
moving it. 移动它。A "feature" of Gmax at least is that if you do this to the skin modifier一个“特征”的Gmax至少是,如果你这样对皮肤改性剂
to move it to the top of the stack it loses all its information about bone assignments来移动它到层的最上方,它就会丧失所有信息的任务。骨
and weighting. 与权重计算。On the other hand, if you manually move all other modifiers below the另一方面,如果你手动移动以下所有其他的修饰
skin modifier, the information is retained and the export works. 皮料信息的保留,出口工作。I've duplicated this我已经重复这
procedure in the script so that if the skin modifier is NOT at the top of the stack,在脚本程序修改,所以,如果不是在皮肤的最上方,
I make full copies of all the modifiers above the skin modifier, delete the originals我充分的副本修饰语在皮肤上修改,删除正本
so that the skin modifier is at the top, and then recreate the other modifiers, in order,所以修改的皮肤是顶点,然后创造另一个修饰语,在秩序,
below the skin modifier. 皮肤下面的改性剂。The script will stop and ask if you want it to do this procedure脚本可以停下来问,如果你想要它做的这种做法
or to terminate.或者终止。
(4) Trying to reconstruct the basepose on exporting an animated model:(4)试图重建在年出口basepose动画模型:
Having used Milkshape first I expected animated files to look the same way in Gmax,首先我将曾经用Milkshape动画文件看同样的方式,在Gmax
that is, be in the basepose and only change to animations when you hit the animate button.就是,在basepose,只有改变动画当你点击按钮的生命。
Bwian explained this isn't the way it works, animations are just done differently betweenBwian解释说这不是自己工作的方式、动画只是做一些不同的事情之间
the two. 这两个层面。If I simply exported the same way I did a regular model I get the vertex positions如果我只是出口用相同的方法做了一个规则的几何模型得到顶点
of whatever frame happens to be displayed at the time. 无论发生在被显示在框架。If you opened this is Milkshape you'd如果你打开这是Milkshape你会
see the bones in the basepose and a distorted mesh. 看到骨骼及扭曲basepose网格。The animations are perfectly good and这个动画和很好的
you can run animextract to make a perfectly good .cas file but this is still unsightly.你能跑的animextract使一个完美的.cas文件,但这仍是难看的。
So to get an approximation to the basepose mesh I followed this procedure. 因此得到近似的basepose网我跟随了这个过程。For each vertex为每个顶点
get its primary bone assignment. 得到它的原发性骨的任务。In that bone's coordinate system get the vertex position, i.e.,在那块骨头系统达到顶点坐标位置,即:
relative to the pivot point. 相对的基准点。Now get the relative bone positions all the way up the hierarchy现在你可以将所有骨骼相对位置的层次结构
to the root bone and add them up. 到根骨头,加入他们。This SHOULD be the vertex position in world or object这应该是顶点的位置在世界或对象
or whatever the outside coordinate system is. 或者不管外面坐标系统。(bone_pelvis is hard coded to be at (0, 0, 0) since(bone_pelvis是硬编码在(0 0,0)开始的
its position got overridden by the animation data.) 它的位置得到被动画数据。)For armored_sergeants this was good to为armored_sergeants这很好
about a percent, too large to be round-off error but too small to detect in Milkshape.大约百分之一,大到不能被round-off错误但太小了,在Milkshape检测。
So the warning is: don't reimport a previously exported animated model, it's akin这样的警告是:别reimport之前一个出口,这是类似动画模型
to making a xerox of a xerox. 要做一个施乐的复印件。Again, this is just for aesthetics, you only want the再一次,这只是为了美观,你只希望
animation data from an exported animated model, you never backconvert these to meshes.动画动画模型数据从一个出口,你永远不backconvert这些网格。
(5) Bone Assignments:(5)骨作业:
Mesh files always have two bone assignments, a primary and a secondary, even if the网格文件通常只有两种骨作业,一个第一和一个第二,就算了
vertex weighting on the secondary is zero. 在二次顶点加权零。Gmax ignores an assignment with a zero weightGmax忽略了一种作业和一个零的重量
so to preserve these two bones I weight the secondary one with 0.00001 and the primary with所以我来保存这些两根重0.00001和二次一个初级
0.99999. 0.99999。This satisfies Gmax to keep two assignments but on conversion back to Milkshape这满足Gmax保持两个作业转化为Milkshape但
format it rounds back to 100 percent on the primary and 0 percent on the secondary and everybody's这轮格式回到100%,0%的小学中学和每个人的
happy. 快乐。Custom made models in Milkshape frequently have only a single bone assignment经常Milkshape定制模型只有一个骨骼的任务
so the secondary Id is -1. 所以第二身份证是1。To be safe and ensure that there are always two bone assignments安全,保证总有两根骨头的作业
I arbitrarily made the secondary assignment to the root bone with a weight of 0.00001.我的二次分配给任意根骨重为0.00001。 回复 三国迷NO.1 的帖子
翻译前请看 本版块的版规 不知是否有幫助
請參考
1.1的
Release Notes for ms3dImportExport_ver1_1.ms:
Author: KnightErrant
Date: 02 December 2007
General Information:
This is an update to the importer/exporter of Milkshape .ms3d files into 3ds Max
and Gmax. It adds two new buttons for importing and exporting geometry only data,
that is, not full models but partial geometries without bones.It also fixes
three bugs (described below).
The zip file contains the MaxScript ms3dimportexport_ver1_1.ms, the original
readme.txt file, now called readme_ver1_0.txt, a readme_ver1_1.txt file which
contains the information from this post in a little more detail, and two
files needed by Gmax users but not by 3ds Max users.The script can be placed in
your scripts subdirectory or any place convenient to your workflow.
Usage Information:
Click the Max Script menu item, then Run Script, then mouse to the directory containing
ms3dimportexport_ver1_1.ms and double click to run it.It will display a simple rollout
with "import ms3d file", "export ms3d file", and the two new buttons,
"import geometry only" and "export geometry only".
The two new buttons can be used this way.Suppose one likes a shield on one
model and wants to use it on another model or several other models.Import
the full model using "import ms3d file" and then click "export geometry only".
This will display a listbox containing the meshes in the scene. Double click
an entry to select it.Your selection will be echoed in the listener.You
are not limited to a single selection so double click all the meshes you wish
to export; they will also be echoed in the listener.The script does check
if you select an item twice which it doesn't allow.Click the "finished selecting"
button when done.
(1) If you are a 3ds Max user the script will open a file chooser for you to
enter a name for the .ms3d file to save to.It will then write the file.
(2) If you are a Gmax user the script exports the data to the listener just
like exporting a full model.You then have to use the supplied GMaxSLGRAB.exe
utility to copy the data from the listener into a ASCII text file that
you name.Then you have to run the Python ascii2ms3dconverter.py utility
to convert it into a binary .ms3d file with the same name but .ms3d extension.
You can then reset and import a desired model you want to add your saved shield to.
Delete the shield you don't want and then click the "import geometry only"
button and select the file you saved previously.The desired object should
appear in the scene.If you exported a fully defined object, that is, one
with uv coordinates and bone assignments and weighting, that information
is preserved and a skin modifier will be put on the object.
Additional error checking:
On export the script now checks for defined grouptypes and groupflags.Rather
than just stopping with an error, it now prompts you to enter these.On exporting
a full model without a bounding sphere, it tells you it is supplying a default one.
If it finds an unassigned vertex, it will inform you which mesh the problem occurs
in and then terminate.
Bug fixes:
Fix 1: Most glaring bug is that the uv maps are upside down in version 1_0.
The correct transformation was in Vercingetorix's script, I just didn't
see it.It is v -> 1 - v when converting from meshes and Milkshape to
3ds Max and Gmax.This is now done for all imports and exports.
Fix 2: A more subtle bug, again correctly done in Verc's script, is that
texture vertices and geometry vertices have no 1-1 correspondence in
3ds Max.You don't notice this if you just import a model and then export
it because they do have a 1=1 correspondence in a mesh file.Here's the
documentation on the subject.
BEGINNING OF DOCUMENTATION:
It is very important to note that
A - There can be more or less texture and color vertices than there are mesh vertices
B - There are always exactly as many mesh faces as there are texture and color faces!
So there is no one-to-one correspondence between mesh vertices and texture and color vertices.
You cannot take vertex number 10 from the mesh and expect that texture vertex 10 will store
the information about its texturing or color vertex 10 would define its vertex color.
As mentioned in B , the number of faces is always identical. Not only this, the indices of
the mesh and texture resp. color faces have a one-to-one correspondence! If face 5 has 3 mesh
vertices you are interested in, their corresponding texture vertices will be the 3 vertices
referenced by the texture face number 5.
This is the key to access to texture and color information in 3ds Max!
Finding the corresponding vertices
In order to find out which texture vertex corresponds to a mesh vertex, you have to do the following:
1. Take the index of the mesh vertex.
2. Find out which faces reference the index of the face.
3. Note the number of the vertex (1st, 2nd or 3rd - .x, .y or .z) inside each face.
4. For each face referencing the vertex, get the texture face with the same index.
5. Get the index of the respective texture vertex from the face - 1st, 2nd or 3rd / .x, .y or .z
6. The vertex you got corresonds to the mesh vertex we started with.
7. Repeat steps 3 to 6 for all faces found.
Same applies to color vertices.
END OF DOCUMENTATION:
The release notes in the header comments of ms3dImportExport_ver1_1.ms have the
commands you have to use to implement the above algorithm.
Fix 3: For animated files I said I had computed the basevert_array so that on back conversion
you obtain the basepose when you open the file in Milkshape.Well, that was half true, you
get the basepose if you are a Gmax user but I forgot to implement that for the 3ds Max
side.There you get the regular vert_array which would be whatever animation frame
was displayed when you exported.The animation data in the bones was still correct, you
just got a distorted mesh that would look terrible if you played the animation in Milkshape.
Now on the 3ds Max side, it looks at a flag to decide if there is animation data present
and stored in the root bone (an animheader entry). If so, it writes out the basevert_array.
翻
發行說明 ms3dImportExport_ver1_1.ms:
作者:KnightErrant
日期:2007年12月2號
一般資料:
這是一個更新的進口商 /出口商的Milkshape。ms3d文件到3ds Max
和GMAX。它增加了兩個新的按鈕,導入和導出幾何唯一的數據,
也就是說,不飽滿的幾何模型,但部分沒有骨頭。它還修復
three錯誤(如下所述)。
該 zip文件包含的MAXScript ms3dimportexport_ver1_1.ms,原
readme.txt文件,現在稱為 readme_ver1_0.txt,一個 readme_ver1_1.txt文件,該文件
包含的信息從這個職位在一個多一點細節,以及兩個
文件需要的GMAX用戶,但不是由3ds Max軟件的用戶。該腳本可以放置在
腳本子目錄或任何地方方便您的工作流程。
使用信息:
點擊最高腳本菜單項,然後運行腳本,然後鼠標移動到該目錄包含
ms3dimportexport_ver1_1.ms並雙擊運行它。它會顯示一個簡單的部署
與“進口 ms3d文件”,“出口ms3d文件”,和兩個新的按鈕,
“進口幾何只有”和“出口幾何只有”。
這兩個新的按鈕可以使用這種方式。假設人喜歡在一個盾牌
模型,並希望用它在另一個模型或其他幾個車型。進口
整個模型採用“進口 ms3d文件”,然後點擊“導出幾何只”。
這將顯示一個列表框包含網格在了現場。雙擊
項目以選擇它。您的選擇將迴盪在聽者。您
不局限於單一的選擇,以便雙擊您希望所有的網格
出口,他們也將迴盪在聽眾。該腳本檢查
如果你選擇一個項目兩次它不允許。點擊“完成選擇”
按鈕時完成。
(1)如果你是一個 3ds Max的用戶腳本將打開一個文件選擇為你
輸入一個名稱為。ms3d文件保存到。然後,它將寫入文件。
(2)如果您是GMAX用戶腳本出口數據,聽者只
就像一個完整的出口模式。然後,您必須使用所提供的GMaxSLGRAB.exe
實用程序來複製數據從監聽到一個 ASCII文本文件,
你的名字。然後,你需要運行的Python ascii2ms3dconverter.py工具
將其轉換成二進制。ms3d文件具有相同的名稱,但。ms3d延伸。
然後,您可以重置和進口所需的模型,你要添加已保存的盾牌。
刪除屏蔽你不想再點擊“導入幾何只有”
按鈕,選擇以前保存的文件。所需的對象應
出現在現場。如果您導出一個完全定義的對象,即一個
與 UV坐標和骨任務和權重,該信息
保留和修改的皮膚將被提上對象。
額外的錯誤檢查:
在出口的腳本現在檢查的定義 grouptypes和groupflags。而
不僅僅是停在一個錯誤,現在會提示你輸入這些。在出口
一個完整的模型沒有一個邊界球,它會告訴你它是提供一個默認的。
如果它發現一個未分配的頂點,它會告訴你哪個網發生問題
中,然後終止。
錯誤修正:
修正1:最明顯的錯誤是,紫外線地圖倒掛在版本1_0。
正確的轉變是在Vercingetorix的劇本,我只是沒有
看到它。它是V - > 1 - V轉換時從網格和Milkshape到
3ds Max和GMAX。這是現在做了所有的進口和出口。 回复 0929122115 的帖子
翻译不错 个别单词再斟酌下。全翻译完 基本就有通行证了!!加油
这是1.0的
Release Notes for ms3dImportExport_ver1_0.ms:
Author: KnightErrant
Date: 17 November 2007
General Information:
ms3dImportExport_ver1_0.ms is an importer and exporter script for 3ds Max
and Gmax to bring in Milkshape binary .ms3d format files and export models
to the same format.It brings in and preserves all the information necessary
for models to be reconverted to the .mesh format.This includes mesh geometry,
bones, bone assignments, vertex weighting, uv coordinates, as well as specialized
data such as group names, types, and flags, as well as bounding sphere data.
Animation is accomodated in the sense that .ms3d files can contain animation
data, through the use of the Python animation utilities, and these are imported
transparently.Similarly, modified animation files can be exported and the new
animations extracted to .cas files using the animextract function from the utilties.
Regular units, mounts, and siege engines are supported as are their animated
versions except for siege engines (the animation utilities don't support animating
siege engines).
The release includes ms3dImportExport_ver1_0.ms, this readme.txt file, an executable
GmaxSLGRAB.exe that can extract the contents of the listener window to a user
defined file, and a Python utility ascii2ms3dconverter.py that can convert the
extracted ASCII file to the binary .ms3d file format.
Usage Information:
The script can be put in the scripts subdirectory of 3ds Max or Gmax.It can also
be put in any convenient working directory where the user's models are.To run
click the Max Script menu item, then Run Script, then mouse to the directory containing
ms3dimportexport_ver1_0.ms and double click to run it.It will display a simple rollout
with import and export buttons.
Click the "Import ms3d file" button and mouse to the .ms3d file to import and double
click it.This file will be read and converted into a model in 3ds Max or Gmax.Note
that the vertex weighting function takes roughly 30 seconds or more depending on the
size of the model; a progress bar tracks this processing.
Click the "Export ms3d file" button to do the reverse process.Some technical issues
related to the skin modifier are discussed below.Note that if any vertices are not
assigned to a bone the script will fail.This is a good thing since these models will
cause problems when put in game.
Acknowledgements:
Bwian for getting me started with Gmax and sending a link to Vercingetorix's script.
Vercingetorix for writing the wonderful script in the first place.
Aymar de Bois Mauri for explaining that "groups" in 3ds Max can only be made by making multiple meshes,
a conceptual roadblock for me coming from Milkshape.
GrumpyOldMan for sending along the listener data grabbing utility: GmaxSLGRAB.exe (discussed below).
Technical Bits for Gmax Users:
------------------------------
(1) The export procedure for Gmax:
Among the many runtime features turned off in Gmax, the ability to write ASCII or binary files
is one of the most frustrating things to lose.The procedure I've seen other authors do for
Gmax is export to the listener window and then cut and paste into a text file.Fortunately,
GrumpyOldMan heard my pain and found a utility that does this for you.This has been
included in the zip file and is called GMaxSLGRAB.exe.Once you have exported to the listener
double click this file.It displays a small Window with one big button with "grab" as the
label.Click the "grab" button and it copies the data from the listener and prompts you
for a filename to save it to.Note that it supplies an .xml filter but my recommendation is
to explicitely type a .txt extension for your filename to override this.It will warn
you if you are going to overwrite an existing file and it displays "done" after writing the
file.
Now your data is out but in a useless made up format of mine.Now you run the supplied
Python utility ascii2ms3dconverter.py by either double clicking it or right clicking and
selecting open.It pops up a filechooser and you select the text file you just made and
it reads the data and converts it to binary .ms3d format.Only slightly more complicated
than the 3ds Max way.
(2) Exporting big models clobbers the listener window, here's a workaround:
Cut and paste the following into a file and name it clearlistener.mcr.
macroScript clearListener
category:"Helpers and Gizmos"
internalcategory:"Helpers and Gizmos"
tooltip:"Clear Listener"
ButtonText:"Clear Listener"
Icon:#("Helpers",1)
(
on execute do clearlistener()
)
Put it in your ui\macroscripts directory.In Gmax click the customize menu item
and then select customize user interface.In the dialog that pops up click the toolbars
tab and scroll down until you see clearlistener, Click and drag it to your main toolbar.
Then click the save button to update your configuration.Now when the listener gets
filled up by an export and won't allow you to type in it, you can hit this button to clear it.
Technical Bits for All Users:
-----------------------------
(1) Where's the data stored?
In Milkshape the group name, type, and flag are stored in the group comments and the bounding
sphere data is stored in the model comment.In 3ds Max and Gmax the name of a given mesh is
the group name and the group type and flag are stored in user defined properties.To see them
select the mesh with the Select Objects dialog, then under the edit menu item select Object
Properties, then select the User Defined tab to see the group name and flag.
The bounding sphere is stored in the root bone: bone_pelvis for humanoids, bone_H_Saddle for
horses, bone_camel_root for camels, bone_E_platform for elephants, and USUALLY bone_body for
siege engines.The bounding sphere is stored as ASCII floats joined by % signs.
(Oddity of Gmax, maybe of 3ds Max, you can store strings with spaces in User Properties and
see them there, but only the first whole word comes back out, hence the need to make strings
with no spaces.)
When dealing with animated files, the .cas header, hierarchy, and footer strings are stored in
the first three joint comments in Milkshape.In 3ds Max and Gmax they are stored in the root
bone as well and you can see them in User Properties.They also are ASCII format numbers joined
by percent signs.Underscores would have looked better but texture paths for siege engines
have underscores so I couldn't use them because I tokenize the string based on the chosen delimeter.
Naturally for siege engines, the three texture paths are stored here, it's just that
their keywords are: animheader, animhierarchy, and animfooter.This may change if I get
animation utilities to work with siege engines.
(2) Known Deficiencies:
The script works on unanimated regular units converted by GrumpyOldMan's converter and
unanimated mounts and siege engines converted by my Python converter.It also works
for animated regular units and mounts.It WON'T work for animated siege engines because
I store the three texture paths for siege engines in the joints comments but I also
store the .cas file animation headers, hierarchy, and footers in the joints comments.
Haven't worked through this conflict yet.
Not a deficiency of this script but if people are going to start using the Python animation
utilities (version 1_1 uploaded June 18, 2007) there are three known bugs.
1 - on line 1092 in the animextract function there's this extraneous entry
float_vec3.fromfile( fidcas, 7 )
I can't fathom how it got there, it wasn't there when I tested everything.
Just comment it out with a pound sign like
# float_vec3.fromfile( fidcas, 7 )
2 - Converttxttocas doesn't convert the degrees back to radians.Oops, it's fixed just
have to post an updated copy.
3 - I didn't check for uppercase extensions so some cas files that look like name.CAS
don't get exported to.Bwian found this one in the exportskeleton function.Also
fixed just not released.
(3) Modifier Stack:
The export only works if the skin is at the top of the modifier stack for each mesh
in the model.You can do this manually by clicking and holding the modifier and
moving it.A "feature" of Gmax at least is that if you do this to the skin modifier
to move it to the top of the stack it loses all its information about bone assignments
and weighting.On the other hand, if you manually move all other modifiers below the
skin modifier, the information is retained and the export works.I've duplicated this
procedure in the script so that if the skin modifier is NOT at the top of the stack,
I make full copies of all the modifiers above the skin modifier, delete the originals
so that the skin modifier is at the top, and then recreate the other modifiers, in order,
below the skin modifier.The script will stop and ask if you want it to do this procedure
or to terminate.
(4) Trying to reconstruct the basepose on exporting an animated model:
Having used Milkshape first I expected animated files to look the same way in Gmax,
that is, be in the basepose and only change to animations when you hit the animate button.
Bwian explained this isn't the way it works, animations are just done differently between
the two.If I simply exported the same way I did a regular model I get the vertex positions
of whatever frame happens to be displayed at the time.If you opened this is Milkshape you'd
see the bones in the basepose and a distorted mesh.The animations are perfectly good and
you can run animextract to make a perfectly good .cas file but this is still unsightly.
So to get an approximation to the basepose mesh I followed this procedure.For each vertex
get its primary bone assignment.In that bone's coordinate system get the vertex position, i.e.,
relative to the pivot point.Now get the relative bone positions all the way up the hierarchy
to the root bone and add them up.This SHOULD be the vertex position in world or object
or whatever the outside coordinate system is.(bone_pelvis is hard coded to be at (0, 0, 0) since
its position got overridden by the animation data.)For armored_sergeants this was good to
about a percent, too large to be round-off error but too small to detect in Milkshape.
So the warning is: don't reimport a previously exported animated model, it's akin
to making a xerox of a xerox.Again, this is just for aesthetics, you only want the
animation data from an exported animated model, you never backconvert these to meshes.
(5) Bone Assignments:
Mesh files always have two bone assignments, a primary and a secondary, even if the
vertex weighting on the secondary is zero.Gmax ignores an assignment with a zero weight
so to preserve these two bones I weight the secondary one with 0.00001 and the primary with
0.99999.This satisfies Gmax to keep two assignments but on conversion back to Milkshape
format it rounds back to 100 percent on the primary and 0 percent on the secondary and everybody's
happy.Custom made models in Milkshape frequently have only a single bone assignment
so the secondary Id is -1.To be safe and ensure that there are always two bone assignments
I arbitrarily made the secondary assignment to the root bone with a weight of 0.00001.
這是1.0的
發行說明 ms3dImportExport_ver1_0.ms:
作者:KnightErrant
日期:2007年11月17日
一般資料:
ms3dImportExport_ver1_0.ms是進口商和出口商3ds Max的腳本
和GMAX引進 Milkshape二進制。ms3d格式的文件和出口模式
以相同的格式。它帶來了,並保留所有必要的信息
為模型轉回的。目格式。這包括網幾何形狀,
骨,骨作業,頂點權重,UV坐標,以及專門
數據,如組名稱,類型和標誌,以及邊界領域的數據。
動畫是安置在這個意義上。ms3d文件可以包含動畫
數據,通過使用Python的動畫事業,而這些都是進口的
透明。同樣,修改動畫文件可以導出和新
動畫提取。CAS文件使用animextract功能從 utilties。
正規單位,坐騎,和圍困引擎支持,因為他們的動畫
版本除了圍困引擎(動畫工具不支持動畫
攻城發動機)。
該版本包括ms3dImportExport_ver1_0.ms,這個 readme.txt文件,可執行
GmaxSLGRAB.exe可以提取內容監聽器窗口,用戶
定義文件和Python的工具,可以轉換 ascii2ms3dconverter.py
提取的ASCII文件的二進制代碼。ms3d文件格式。
使用信息:
該腳本可以放在腳本子目錄的3ds Max或GMAX。它也可以
放在任何方便的工作目錄,用戶的型號。要運行
單擊最大腳本菜單項,然後運行腳本,然後鼠標移動到該目錄包含
ms3dimportexport_ver1_0.ms並雙擊運行它。它會顯示一個簡單的部署
與進口和出口的按鈕。
點擊“導入 ms3d文件”按鈕和鼠標的。ms3d文件導入和雙
單擊它。這個文件將被讀取並轉換成模型在3ds Max或GMAX。注意:
該頂點加權函數需要大約 30秒或更取決於
大小的模型,一個進度條軌道此處理。
點擊“導出 ms3d文件”按鈕,做相反的過程。一些技術問題
修改相關的皮膚下面討論。請注意,如果沒有任何頂點
分配到骨骼的腳本將失敗。這是一件好事,因為這些車型將
導致問題的時候把遊戲。
致謝:
Bwian獲取我開始使用GMAX並發送一個鏈接到Vercingetorix的腳本。
Vercingetorix寫劇本的精彩擺在首位。
Aymar DE布瓦莫里解釋說,“集團”在3ds Max只可通過使多個網格,
一個概念路障我來自 Milkshape。
GrumpyOldMan發送沿監聽數據抓取工具:GmaxSLGRAB.exe(下面討論)。
技術位為 GMAX用戶:
------------------------------
(1)出口程序GMAX:
在眾多的運行特性關閉在GMAX,寫的能力ASCII或二進制文件
是一個最令人沮喪的事情失去。這個過程我見過的其他作者做
GMAX是出口到偵聽窗口,然後剪切並粘貼到一個文本文件。幸運的是,
GrumpyOldMan聽到我的痛苦,並找到了一個實用工具,這對你。這已
包含在zip文件,稱為 GMaxSLGRAB.exe。一旦你已經出口到監聽器
雙擊此文件。它顯示一個小窗口,有一個大按鈕與“搶”為
標籤。點擊“搶”按鈕,並在複製數據從監聽器,並提示您
為文件名保存它。請注意,它提供的。xml過濾器,但我的建議是
以顯式類型。txt擴展你的文件名覆蓋它。它會發出警告
您是否要覆蓋現有文件,它會顯示“完成”後寫
文件。
現在你的數據是無用的了,但在我的格式組成。現在你運行所提供的
Python的工具ascii2ms3dconverter.py通過雙擊或右鍵單擊它並點擊
選擇打開。它彈出一個 filechooser並選擇文本文件,你剛才和
它讀取數據,並將其轉換成二進制。ms3d格式。只有稍微複雜
比3ds Max的方式。
(2)出口大車型則會覆蓋監聽器窗口,這裡有一個解決方法:
剪切並粘貼以下到一個文件,並將其命名clearlistener.mcr。
macroScript clearListener
類別:“助手和小玩意兒”
internalcategory:“助手和小玩意兒”
提示:“清除監聽器”
ButtonText:“清除監聽器”
圖示:#(“幫手”,1)
(
在執行做clearlistener()
)
把它在你的用戶界面\ macroscripts目錄。在GMAX點擊自定義菜單項
然後選擇自定義用戶界面。在彈出的對話框中單擊工具欄
標籤,向下滾動,直至看到clearlistener,點擊並拖動到主工具欄。
然後點擊保存按鈕來更新您的配置。現在,當聽者得到
由出口填補了,不會讓你輸入它,你可以打這個按鈕將其清除。
技術位為所有用戶:
-----------------------------
(1)凡的數據存儲在哪裡?
在Milkshape組的名稱,類型和標誌存儲組中的意見和邊界
球體的數據存儲在模型的評論。在3ds Max和GMAX的名字給定網格
組名和組類型和標誌存儲在用戶定義的屬性。看到他們
選擇網的選擇對象對話框,然後在編輯菜單選擇對象
屬性,然後選擇用戶定義的標籤,查看該組的名稱和標誌。
包圍球被存儲在根骨頭:bone_pelvis的類人型機器人,bone_H_Saddle為
馬,bone_camel_root為駱駝,bone_E_platform為大象,通常bone_body為
圍困引擎。包圍球被保存為 ASCII花車加入了%符號。
(怪異的GMAX,也許 3ds Max中,您可以存儲字符串用空格在用戶屬性和
看到他們那裡,但只有第一個全字回來了,因此需要進行字符串
沒有空格。)
在處理動畫文件,。CAS頭,層次和頁腳字符串存儲在
前三個聯合評論,Milkshape。在3ds Max和GMAX它們存儲在根
骨以及,你可以看到他們在用戶屬性。他們還加入了ASCII格式的數字
由百分號。強調會顯得更好,但質地路徑的圍困引擎
有底線,所以我不能使用他們,因為我的字符串標記化的基礎上,選擇分隔符。
當然對於攻城發動機,三個紋理路徑都存儲在這裡,它只是
其關鍵字是:animheader,animhierarchy和animfooter。這可能會改變,如果我得到
動畫事業與圍困引擎。
(2)已知的不足之處:
該腳本在unanimated由GrumpyOldMan正規單位轉換的轉換器和
unanimated坐騎和圍困引擎由我的Python轉換器。它還
為動畫正規部隊和坐騎。它不會工作,因為對動畫圍困引擎
我的三個紋理存儲路徑為圍困引擎在關節的意見,但我也
存儲。CAS文件的動畫標題,層次和頁腳在關節意見。
沒有工作,通過這個矛盾呢。
不是缺乏該腳本,但如果人們將開始使用Python動畫
公用事業(版本1_1載 2007年6月18日),有三個已知的錯誤。
1 - 上線 1092在animextract功能有此無關的項目
float_vec3.fromfile(fidcas,7)
我無法捉摸如何到達那裡,它是不存在的時候我測試一切。
只要註釋掉以井號一樣
#float_vec3.fromfile(fidcas,7)
2 - Converttxttocas不轉換回度弧度。哎呀,它的固定剛
已發布更新的副本。
3 - 我沒有檢查大寫的擴展使一些CAS文件看起來像name.CAS
沒有得到出口。 Bwian發現這是在exportskeleton功能。另外
固定只是沒有公佈。
(3)修改器堆棧:
出口只有當皮膚是在修改器堆棧頂部的每個網
在模型中。為此,您可以手動點擊並按住改性劑和
移動。一個“功能”的GMAX至少是,如果你這樣做對皮膚的修飾
移動到頂部的堆棧失去其所有的信息骨骼任務
和比重。另一方面,如果您手動將所有其他修飾符低於
皮膚修飾,信息保留和出口工作。我重複這
程序腳本中,這樣,如果皮膚修飾詞不是在堆棧頂部,
我充分複製所有的修飾符高出皮膚修飾,刪除原稿
使皮膚修飾符的頂部,然後重新創建其他改性劑,以,
下面的皮膚修飾。該腳本將停止,並詢問是否你想要它做此過程
或終止。
(4)試圖重建basepose對出口動畫模型:
首先,我曾使用Milkshape預期動畫文件看同樣的方式在GMAX,
也就是說,在basepose,只有改變動畫當你到了動畫按鈕。
Bwian解釋說這不是它的工作方式,動畫只是做不同之間
兩個。如果我只是出口以同樣的方式我做了常規模式我得到的頂點位置
不論何種幀正好顯示在時間。如果你打開你這是Milkshape
看到骨頭在basepose和扭曲的網格。該動畫是完全好的,
你可以運行 animextract做出一個完美的。CAS文件,但是這仍然是不堪入目。
因此,為了得到一個近似的basepose網我遵循了這一過程。對於每一個頂點
得到它的主骨分配。在骨骼的坐標系統得到頂點的位置,即
相對於支點。現在得到的相對骨位置一路攀升層次
根骨頭,並添加他們。這應該是世界頂點的位置或對象
或任何外部坐標系。 (bone_pelvis是硬編碼將在(0,0,0),因為
其位置由覆蓋了動畫數據。)對於 armored_sergeants這是很好的
約一成,過大,舍入錯誤,但太小,檢測 Milkshape。
所以警告:不要重新導入以前導出的動畫模型,它的類似於
使施樂的施樂公司。同樣,這只是為了美觀,你只希望
動畫數據導出動畫模型,你永遠 backconvert這些網格。
(5)骨分配:
網文件總是有兩個骨分配,主要和次要的,即使
頂點加權的二次為零。 GMAX忽略了一個分配一個權重為零
所以我保留這兩個骨頭的重量中學之一,0.00001和主用
0.99999。這滿足 GMAX保持兩個任務,但在轉換回Milkshape
格式發回100%的小學和0%的中學和每個人的
高興。自國產車型在Milkshape經常只有一個骨轉讓
所以輔助 ID為 -1。為了安全起見,並確保總是有兩個骨任務
我隨意提出的二次分配到根骨重量的0.00001。
页:
[1]