HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Danbo

09-25-2008, 01:23 PM#1
laxa88
I know it's a really simple model and stuff, but it's my first attempt. This is Danbo the eco-friendly robot from Yotsuba&. I made one simple Stand animation, and when I try to view the model in War3 Model Viewer, his movements are wonky and his model gets stretched. He's only supposed to just sway forward and back gently. Any idea why?

Here's the mdl and preview in case anybody wants to see.
Attached Images
File type: jpgdanbo_preview.JPG (14.9 KB)
Attached Files
File type: mdldanbo3.mdl (39.4 KB)
09-25-2008, 02:27 PM#2
TDR
did you use max 5 + art tools? If not, what other version of max and what exporter?
09-25-2008, 02:55 PM#3
laxa88
Oh, sorry I forgot to mention. I'm using 3ds Max 9 and Dexporter 0.186m script. You did mention a lot on the forums that art tools don't work on versions other than 4 and 5, or something, so I didn't give it a try.
09-25-2008, 02:57 PM#4
TDR
yeah, well DEX is known to be very buggy with exporting animations...I know the exporter for Milkshape is much better, so I don't know what to say other than get milkshape and animate & export from there, since I'm not familiar with DEX...Even though the best way is max 5+art tools, but unfortunately max 5 can't be found anymore anywhere.
09-25-2008, 03:06 PM#5
laxa88
Thanks for the help anyway, TDR. I'll try animating in Milkshape then. Will update this post when I succeed. (:
09-26-2008, 12:33 PM#6
laxa88
Ok, I found a way around the problem. It's a long-winded solution, though. I noticed the animations only go wonky when the two or more bones are connected. The bones other than the root bone will produce a weird rotation at some unknown axis (world, I assume).

So what I did was assign one bone to one mesh, and don't link them with other bones whatsoever. This means I'll have to animate each bone/mesh separately. This probably won't work if the mesh has several joints, like the elbow or knee (unless I treat each part of the arm and leg as a separate mesh, but animating it will be a pain).

It's a temporary solution, but it works! :D And I didn't go far with Milkshape. I'm too used to 3dsmax's controls, Milkshape's confuses me too much. I'll experiment more and post here, in case other budding animators want some hint on animating on 3ds max 9.
09-26-2008, 11:57 PM#7
Nuclear Arbitor
try using any old mdl converter. i think it'll work but i haven't gotten around to trying.
09-27-2008, 10:22 AM#8
laxa88
If you meant by using a different older program to convert my model from mdl to mdx, I used MdLX converter, it still converts to the same file. :/ So I guess it doesn't work.
09-27-2008, 08:30 PM#9
Nuclear Arbitor
i meant just any mdl converter off the web. preferable a new one.
09-28-2008, 11:02 AM#10
laxa88
I'm not sure what you mean, Nuclear Arbitor, but I tinkered about the .mdl file after exporting my animated model and discovered something. So I guess it has nothing to do with file conversion, but rather in the export script itself.

The script exports the translation of the bones in a way that we don't want it. When two or more bones are connected, the rotation of the root bone will cause other bones to follow along as we'd expect, right?

Code:
Bone "bone_head" {
	ObjectId 2,
	Parent 0,
	GeosetId 3,
	GeosetAnimId None,
	Translation 3 {
		Bezier,
		0: { 0.0, 0.0, 0.0 },
			InTan { 0.0, 0.0, 0.0 },
			OutTan { 0.0, 0.0, 0.0 },
		1600: { -0.522916, 29.4452, -66.2804 },
			InTan { -0.522916, 29.4452, -66.2804 },
			OutTan { -0.522916, 29.4452, -66.2804 },
		3200: { 0.0, 0.0, 0.0 },
			InTan { 0.0, 0.0, 0.0 },
			OutTan { 0.0, 0.0, 0.0 },
	}
	Rotation 3 {
		Linear,
		0: { 0.0, 0.0, 0.0, 1.0 },
		1600: { 0.0, 0.0, 0.0, 1.0 },
		3200: { 0.0, 0.0, 0.0, 1.0 },
	}
	Scaling 3 {
		Linear,
		0: { 1.36262, -770952.0, 0.0336994 },
		1600: { 7225.6, -312995.0, 704520.0 },
		3200: { 1.36262, -770952.0, 0.0336994 },
	}
}

The above code is the vertex translations of the head mesh, whose root is body mesh. the "Parent 0" is the body mesh ID, which is 0. From what I see, when a bone has a parent, the translation itself is relative to the parent bone, so by itself, it should not move at all. In my original animation, the head doesn't move at all, it just follows where ever the body moves.

Code:
Bone "bone_head" {
	ObjectId 2,
	Parent 0,
	GeosetId 3,
	GeosetAnimId None,
	Translation 3 {
		Bezier,
		0: { 0.0, 0.0, 0.0 },
			InTan { 0.0, 0.0, 0.0 },
			OutTan { 0.0, 0.0, 0.0 },
		1600: { 0.0, 0.0, 0.0 },
			InTan { 0.0, 0.0, 0.0 },
			OutTan { 0.0, 0.0, 0.0 },
		3200: { 0.0, 0.0, 0.0 },
			InTan { 0.0, 0.0, 0.0 },
			OutTan { 0.0, 0.0, 0.0 },
	}
	Rotation 3 {
		Linear,
		0: { 0.0, 0.0, 0.0, 1.0 },
		1600: { 0.0, 0.0, 0.0, 1.0 },
		3200: { 0.0, 0.0, 0.0, 1.0 },
	}
	Scaling 3 {
		Linear,
		0: { 1.0, 1.0, 1.0 },
		1600: { 1.0, 1.0, 1.0 },
		3200: { 1.0, 1.0, 1.0 },
	}
}

In the head, I changed all the translations to 0, and voila! No more wonky animations. The head rotates with the body. I only wish I knew how to script so I can fix how the exporter works a bit. Or is this not caused by the exporter in the first place?

Either way, I've found the root of the wonky animation problems. Now to experiment further to find solutions...

EDIT:: Now that I understand the problem a bit, I realize that BlinkBoy has already suggested some solutions in the Dexporter sticky thread. Will check it out again.

EDIT2:: I made a simple edit to the Dex script to ease the fix of the bones from going wonky, attached below. I made it so that all bones with a parent will be forced to have 0 translations in all axises. However, by doing so, I make it impossible to consider that if a child bone were to move independently from the parent at any point, this code will not work as desired.

Here's a snippet of the modified/added part of the script, for quick reference.
Code:
-- laxa88 edit: same as OutputPositionAnimation, except this forces all translation values to be 0.
	fn ForceOutputPositionAnimation o = 
	(
		if o.pos.isAnimated then
		(
			
			local keys = PositionKeys o
			
			swrite ("\tTranslation " + (keys.count as string) + " {\n\t\tLinear,\n")
			for k in keys do swrite ("\t\t" + ((k.time as integer / 5) as string) + \
				": { 0.0 " + \
				", 0.0 " + \
				", 0.0 },\n")
			swrite "\t}\n"
			
		)
	)
-- /laxa88 edit

	fn OutputMDLBones =
	(
		for o in MDLObjects do
		(
			if o.type == 1 then
			(
				swrite ("Bone \"" + o.o.name + "\" {\n\tObjectId " + (o.objid as string) + ",\n")
				if o.parent != undefined then swrite ("\tParent " + (o.parent as string) + ",\n")
				swrite ("\tGeosetId " + (o.ex.geosid as string) + ",\n\tGeosetAnimId " + (o.ex.geoaid as string) + ",\n")
				
				-- laxa88 edit:
				-- If bone has a parent, no need for translation; it follows the translations of the
				-- parent bone. So just output rotations.
				if o.parent != undefined then
				(
					ForceOutputPositionAnimation o.o
				)
				else
				(
					OutputPositionAnimation o.o
				)
				-- /laxa88 edit
				
				OutputRotationAnimation o.o
				OutputScaleAnimation o.o
				swrite "}\n"
			)
		)
	)

EDIT 3:: Looks like the above code edit to the DEX script doesn't work when there's more than one chain of bones. When I tried to animate a little more complex movements, everything goes wonky once again. ): I guess I have no choice but to learn Milkshape now. I've also removed the download, since it's no use at all.
10-02-2008, 11:58 AM#11
laxa88
Now with a proper stand animation!... More updates coming next month. Exams and assignments piled up last week.

Mesh and UV wrapping done on 3Ds max 9, exported using DEX script. Animation done in Milkshape.

I tried to post a GIF animation of the model, but I can't find any software that can record it. At least for free, that is.
Attached Files
File type: mdxdanbo.mdx (16.6 KB)
10-04-2008, 01:59 PM#12
laxa88
Hi again. I figured I would put my model as a doodad at the moment, but I just realized that although it looked perfectly fine in the W3 viewer, there is actually a problem with my model when i view it in Magos' Model Editor, which is also the same case in W3 map editor when I imported.

Screenshot attached to this message shows how it looks like in Milkshape, and how it looks like in Magos' Viewer (and also map editor, and also in-game)

Did anybody else get this same problem before? I didn't come across any thread that mentioned this. I think.

EDIT:: Fixed the problem. The UV wrapping for 3ds max was at a different position than what milkshape had, so I just had to use LithUnwrap to move all the mapped faces to the correct position.
Attached Images
File type: jpgproblem_01.JPG (146.7 KB)
File type: jpgproblem_02.JPG (24.0 KB)
10-05-2008, 02:33 AM#13
Nuclear Arbitor
well it's coming along, reminds me that i need to see how my dreadnought skinning attempt looks in game. i also need to find an mdl exporter arg.
11-11-2008, 07:06 AM#14
laxa88
Complete the basic animation sets for danbo! Thanks for IRC comments, I figured I'll leave the "floating arm" issue for next time.

Small bug: The animations loop even though they're only supposed to play once (e.g. attack, death)

Comment and critique are muchly appreciated, and if any help on the looping animation problem. (: thank you.

EDIT: I updated the zip file. Added portrait photo, fixed the looping/non-looping problem, and i even made a demo map to test the animations. (:
Attached Files
File type: zipdanbo.zip (128.5 KB)