Model Utilities

Status
Not open for further replies.
yes I will release it soon. I want to clean it up a little bit more and add some more features to it.

I'm going to post the animation code for this. If anyone has anykind of experience in coding maxscript especially for animations, do lend a hand. Otherwise this project will not get very far.
Code:
f = getOpenFileName caption: "Import Animation" types: "Animation (*.ani)|*.ani"
ReadANI f &Animation

local curBoneFrame, nextBoneFrame
		
		For BoneID = 1 To Animation.BoneData.names.Count Do (
			obj = getnodebyname Animation.BoneData.names[BoneID]
			if obj != undefined Then
			(
				if Animation.BoneTM[BoneID] == undefined Then
				(
					For FrameID = 1 To Animation.FrameCount Do (
						Frame = Animation.BoneFrame[BoneID]
						if Frame == undefined Then ( return 0 ) else
						(
							CurFrame = Frame[FrameID]
							--curBoneFrame = Animation.BoneFrame[BoneID][FrameID]
							if (FrameID + 1) >= Animation.FrameCount Then ( nextBoneFrame = Animation.BoneFrame[BoneID][Animation.FrameCount] ) else ( nextBoneFrame = Animation.BoneFrame[BoneID][(FrameID+1)])

							-- Get QuatSlerp
							quatSlerp = slerp CurFrame.Rotation nextBoneFrame.Rotation Animation.PerSLERP
							-- GetVecLerp
							vecLerp = lerp CurFrame.Translation nextBoneFrame.Translation 1
							-- Make new Rotation Matrix
							mQ = quatSlerp as matrix3
							-- Make new Translation
							
							local mTemp = mQ
							mTemp.row4 = vecLerp
							
							format "Frame:% MatTemp:%\n" FrameID mTemp
							
							if FrameID == Animation.FrameCount Then FrameID = Animation.FrameCount else FrameID += 1
							
							if obj.parent != 0 Then (
							
								with animate on (
									at time FrameID 
									(
										in coordsys parent obj.rotation = mQ;
										in coordsys parent obj.pos = vecLerp
									)
								)
							) else (
								with animate on (
									at time FrameID
									(
										in coordsys local obj.rotation.x_rotation = mQ;
										in coordsys local obj.pos = vecLerp
									)
								)
							)
						)
					)
				)
			)
		)
 
Last edited:
That looks exactly like Addi's script.

I totally noticed that too, lol'd somethin FIERCE.

But hey, it's an efficient design that works well. Why not copy it?

As for hints, let's just say you're trying too hard. It's really simple if you know how everything works together honestly, check how FlyFF's source code handles the bones.

Also as a suggestion, use mvr_behemoth.o3d as a test. If you can get that to load an animate correctly, you're well on your way to funky avenue.
 
by the way, the bone viewer seems not to be a 64-bit version friendly, or so I guess..
When I try to start it, nothing happends :p

Sometimes, since I use win7 x64, I forget to change the build platform. Let me double check it and see if I can keep it at x86. I don't have the x64 dll files for xna so it should load up fine. Make sure you have xna 4.0 installed otherwise I may need to throw in the distributable file as well.
 
OK. I've put this up on Codplex so people can perhaps help me get this finished as the time I have put into this is way over what I planned.

Understand that if you do take the code and get it to work, I ask that you commit the change or post it here in case you don't know how Mercurial Source Control works.



So far you can import each file. Ani is messed up but can import anyway.

Steps to get a model imported successfully and skinned.

1. Locate the texture file. DO THIS FIRST! Otherwise you will get an error and have to restart the script.

2. Find the o3d model of choice.

3. Locate the bone file (if any).

4. Click the Skinned Model button and now your model is skinned, weighted and ready for animation either by loading the ani file or how ever you want.

Things NOT done.

1. Exporting the files back either by original or custom. I recommend FBX for custom if you plan on loading FBX in your source. For the love of god remember this.... If you so choose FBX. CHECK Z-Up Axis for Axis correction. If you not you will get bad results in game (flipped models, glitches,etc.)

2. Animations are NOT DONE!!! They will look like crap because I haven't figured out how each bone rotates against one another or in a chain. Perhaps you can.

I hope this helps people. And I will continue to work on this here and there but for now at least you can play with this and make your own changes to the file.
 
Each model has its own weight paints.
P.e. the head model just got 1 weight paint, the one for the face bone.
The chr file of a character contains every bone of the player.
Now, when we load the face and press the skinning button the weight paint of the face is applied numeric to the first bone of the rig, which is not correct.
I´m not into maxscript so I don´t know how to handle it, but I will take a look tomorrow.

I hope you understood what i tried to explain, my English is pretty shitty.
 
hmmm i have download the Model Plugin for 3ds Max. but i dont know what i musst do? how i can put it in 3ds max to use it ?


Edit: sry problem fixed :D
 
Those having issues please use the codeplex link from now on to get the latest version of the plugin. And yes it works on max9, 2010, 2011 and 2012. I've tested them all myself. Scripts are back and forwards compatible with slight differences. Plus you get the source at your disposal anyway. Just recommit any changes are per the license I set forth.
 
Those having issues please use the codeplex link from now on to get the latest version of the plugin. And yes it works on max9, 2010, 2011 and 2012. I've tested them all myself. Scripts are back and forwards compatible with slight differences. Plus you get the source at your disposal anyway. Just recommit any changes are per the license I set forth.

mhm I'm using it now, it worked perfectly I really don't see a reason for it not to work

been having fun playing around with the script making it less of a pain to load things

I'd recommend doing something similar to what cola does

having a input text for the monster type such as lets say you have a mob that uses a model like mvr_johndoe you would place in the text box johndoe(which is as decided in mdldyna) once you confirm it then search for mvr_johndoe.o3d if it finds it load it, if not fail, next being mvr_johndoe.chr then after that searching for something like "mvr_johndoe_*.ani" then loading them in a list box on the side one can click and load

it makes it a lot easier to work with ;/
 
Those who wish to work and commit any changes or add branches to the original should contact me with their info. I would very much like to change various things like the interface, and add in what Rem suggested but sometimes the time constraints do not allow it.
 
yes. with the exception of the animation which is not done, You will be able to export the model back to the original o3d, and chr respectively.

you should really have been working with the .ase instead of fbx, if you managed to fix the .ase export in a good way, then the cola would do the rest, (o3d, chr, ani etc)

well, I have close to made it possible to load fbx files, no idea how actually.. but need to fix the x,y,z xD seems like ive mixed everything up :D:

and yeah, for those who will ask, A RELEASE?!?!
I will do a release when I have managed to make it fully work with any kind of animation
 
Last edited:
yes. with the exception of the animation which is not done, You will be able to export the model back to the original o3d, and chr respectively.

animation exporting already works in cola, it's the bones that do not work, however if you make a new animation and do it as it should in cola, the animation will work on other movers(though the animation is not made for them so it doesn't look quite right)

so I really don't think that will be a big problem so long as you can get bones to save properly.

a certain server has been bragging about their "4th jobs" and how it's animations were only possible due to their excessively mentioned "exclusive" converter, has actually been possible since the day cola was released no add on or fix required, making that "exclusive" converter irrelevant to making it possible as players already have bones. Just people have been too lazy to even convert the player model to plain o3d, then re-create the bones and make the names match.

there are many things possible with very little effort, just most people are hopeless when it comes to to things not served to them on a silver platter.
 
Last edited:
Status
Not open for further replies.
Back