about md2

Software: Prefab3D

mkfui, Newbie
Posted: 22 July 2016 05:05 AM   Total Posts: 29

sir, i export md2 file from 3ds max, fragmotion or prefab3d, when i import it into prefab3d, mesh & animation sequence look ok, but never appear when i using away3d, why ? no error message in debug log


Fabrice Closier, Administrator
Posted: 24 July 2016 07:45 PM   Total Posts: 1260   [ # 1 ]

if you recieve the loaded event for your md2 file, you actually have loaded and parsed the md2 file.

Away3D is an engine, not a program/app.

So you need to declare your animator, feed it etc… use the dedicated events for each kind of instance for this.

Another option is to export from Prefab3D as AS3. Aside the class that you need, Prefab exports an example project class. Even if you do preffer to use md2, looking at the actionscript may help you setup your project using the md2. You can also look at the examples repo on github where different vertexanimated models are being used.


mkfui, Newbie
Posted: 30 July 2016 08:17 AM   Total Posts: 29   [ # 2 ]

sir, for x file(from 3ds max) & md2(exported from quake model editor), i have tried to import those files into fragmotion in order to split the animation, but it look black before & after i texture it. After i exported those files to md2, test it with loadmd2 example, it show nothing, why ? it look black because the normal inverse ? sir, how to deal with this problem ? when i import those into prefab3d, animation & sequence name there, but no animation, what wrong ? how about texture ? set it after i flip the normal

if i export it from prefab3d as AS3, any example ? how to set my mesh animation in my prefabproject.as, in my mesh.as, animation like this: 

var meshanimdata:MeshAnimData = new MeshAnimData();

get & set problem for animation in my mesh.as


Fabrice Closier, Administrator
Posted: 30 July 2016 10:30 PM   Total Posts: 1260   [ # 3 ]

an old example https://www.youtube.com/watch?v=zrElcKGGz94
showing the edits/generation

for as3, prefab export a project class as well, an example of what could your implementation look like. It’s using the class you exported. if you compile the prefabproject.as it will play the first encountered animation. Any other specified prefix is added to the class and commented out.

If your image is black, that might be because your exporter does not export the uvs properly. if you add to the mesh another image, like a full yellow, and it turns entirely yellow, then you know your uvs are wrongly exported.
Another reason may be the format of the image, that can be embedded or from a non supported kind.
To see what wrong, with the animation or correct it, simply inspect it as in the video.

In away3d, make also sure that your camera looks at the mesh. That’s something Prefab does for each imports, thats something you need to define in your project.

If you keep having problems, send me your md2 at fabrice3d at gmail dot com, i’ll look at it.


mkfui, Newbie
Posted: 01 August 2016 06:34 AM   Total Posts: 29   [ # 4 ]

sir, i need to split my animation with .QC file like this ?

// Sample MD2 config, copy into export directory
$modelname spyAnimatedReady.md2
$origin 0.0 0.0 0.0
// skins
$skinwidth 128
$skinheight 128
$skin skin.pcx
$skin pain.pcx
// sequences
$sequence stand 1 3
$sequence walk 4 84

how about texture, must be in pcx format ?
md2 file, pcx texture & .qc file must put together ?

will prefab3d generate .qc file ?


mkfui, Newbie
Posted: 01 August 2016 06:37 AM   Total Posts: 29   [ # 5 ]

sir, why cannot attach file ?


Fabrice Closier, Administrator
Posted: 01 August 2016 08:29 AM   Total Posts: 1260   [ # 6 ]

as said, “Another reason may be the format of the image…non supported”
pcx is not a native as3 format. use png or jpg.

.qc is not md2 file. an md2 file holds the entire data required to play back: mesh data, uvs, sequences and their respective keyframes data.

As far as i recall, qc files are just txt configs to compile to certain games. This is not something that away3d is supporting. That’s specific to valve and few other games companies.

Away3D has a vertex animation system, and loading md2 files is one way to feed it. Prefab3d goes a bit futher with edits/generation, also has a skeleton to vertex animation convertion. The exports themselves are in as3 class or md2 binary format. So you can import or compile them with your away3d project.



Away3D Forum

Member Login