Sign in to follow this  
Followers 0
Gen.Kenobi

Animation Pipeline

443 posts in this topic

See if you got my response :)

Actually, after taking a seccond look over my rigg (took a small break to have dinner and play some BF3) I realised that I did somthing wrong. Because I would need to rig each oar in order to get everything rotating around the same pivot. I tried to simplify the things, but it really didn't work out well in the end :/

Share this post


Link to post
Share on other sites

Well, I took a look at blender tonight, and it looked as foreign to me today as it did 5 years ago. I was able to figure out how to import a .dae model (I picked one of the male tunics I think - they are all the same, so it doesn't matter). When I delete the mesh and look at the bone structure that was imported, it is awful. Bones aren't oriented correctly links are off... etc. I don't think the software's import is working so well.

Anyway, there might be a way around that. Let me ask you blender guys this - can you make any object (geometry) a bone in blender or is a bone a unique sort of an object? If so, what I could do is export Character Studio's bones as a mesh and they could be imported and linked up in Blender later? The importer seems to do fine with geometry...

post-3-0-49557900-1326951614_thumb.jpg

Notice the bones orientation is off and the dotted line links between the bones. They look like one point is correct, but the other end of many of the bones in the spine area, the ends of the appendages, and the props are flying in the wind.

Share this post


Link to post
Share on other sites

See if you got my response :)

Yep, got it ;)

Actually, after taking a seccond look over my rigg (took a small break to have dinner and play some BF3) I realised that I did somthing wrong. Because I would need to rig each oar in order to get everything rotating around the same pivot. I tried to simplify the things, but it really didn't work out well in the end :/

Ah good, I thought you'd found a clever way that didn't require 1 bone per oar, which is why I really wanted to see how you'd go about animating the skeletal structure you created. We can't do 1 bone per oar for obvious reasons, so over the past few weeks I've been trying alternatives and there's a possibility I may have found one. But as I said before, i still need to redesign the oars to make it work in Blender, and then hope 0 A.D. treats the animation the same way.

Well, I took a look at blender tonight, and it looked as foreign to me today as it did 5 years ago. I was able to figure out how to import a .dae model (I picked one of the male tunics I think - they are all the same, so it doesn't matter). When I delete the mesh and look at the bone structure that was imported, it is awful. Bones aren't oriented correctly links are off... etc. I don't think the software's import is working so well.

Anyway, there might be a way around that. Let me ask you blender guys this - can you make any object (geometry) a bone in blender or is a bone a unique sort of an object? If so, what I could do is export Character Studio's bones as a mesh and they could be imported and linked up in Blender later? The importer seems to do fine with geometry...

post-3-0-49557900-1326951614_thumb.jpg

Notice the bones orientation is off and the dotted line links between the bones. They look like one point is correct, but the other end of many of the bones in the spine area, the ends of the appendages, and the props are flying in the wind.

Yeah Blender takes a while to get aquatinted with, and then they go and change the interface again. As you say, the collada importer still doesn't handle importing skeletons very well, Ben and I were looking at the latest importer a few weeks ago and also came to that conclusion.

Blender treats bones as a unique object, but i'm not quite sure what you mean by 'bones as a mesh' - could you link me to some info about that? Thanks for your help :)

Share this post


Link to post
Share on other sites
Blender treats bones as a unique object, but i'm not quite sure what you mean by 'bones as a mesh' - could you link me to some info about that? Thanks for your help :)

Well, this that max does that might be a max only feature. For example, if I created two simple boxes (similar to like what is started with when blender opens up each time) and if I linked one box to another box... this effectively creates a hierarchical structure of bones. If you re-sized these boxes you could make it more like the shape of an... arm for example. Max then allows you to apply a modifier called "skin" to the mesh you want to modify with animation and define this simple hierarchy of boxes as the 'bones'. That is one option, the other option is to actually use the bones object in max that help automate a lot of things for you like scaling and IK constraints.

Does blender allow you to create a hierarchy out of geometry that could later be turned into "bones" that would allow you to rig your model and apply envelopes and vertex weights - or are you forced to use bones?

Share this post


Link to post
Share on other sites

Yep, got it ;)

:)

Ah good, I thought you'd found a clever way that didn't require 1 bone per oar, which is why I really wanted to see how you'd go about animating the skeletal structure you created. We can't do 1 bone per oar for obvious reasons, so over the past few weeks I've been trying alternatives and there's a possibility I may have found one. But as I said before, i still need to redesign the oars to make it work in Blender, and then hope 0 A.D. treats the animation the same way.

Yeah. We need to figure something out. In theory, what my IK bones did, was what I wanted, but for more reason the meshes didn't behave as planned. Unless we rig them all, I don't think we'll be abble to make all oars to rotate around the same pivot, but I'm eager to see what you have came up with. :)

Well, this that max does that might be a max only feature. For example, if I created two simple boxes (similar to like what is started with when blender opens up each time) and if I linked one box to another box... this effectively creates a hierarchical structure of bones. If you re-sized these boxes you could make it more like the shape of an... arm for example. Max then allows you to apply a modifier called "skin" to the mesh you want to modify with animation and define this simple hierarchy of boxes as the 'bones'. That is one option, the other option is to actually use the bones object in max that help automate a lot of things for you like scaling and IK constraints.

Does blender allow you to create a hierarchy out of geometry that could later be turned into "bones" that would allow you to rig your model and apply envelopes and vertex weights - or are you forced to use bones?

Blender allows you to set hierarchy and parents the way you like (Hotkey: Ctrl+P). But they wont work properly as bones - You wont get a "Pose Mode" and I'm not sure if they will deform. Although you have plenty of different deform modifiers to play with. (Haven't tried them all yet, just the Armature one doesn't works with meshes.)

Blender allows you to convert curves from mesh and mesh from curves, but you can't do that with bones. Bones to mesh is impossible, but you may be able to find a way with some modifiers, I guess.

Share this post


Link to post
Share on other sites

I was playing with this a bit earlier. I found that it seems to basically work if you put horizontal bones running the length of the set of oars at every point with vertices (I was using long rectangle so I just stuck one at the each end). Then you lock the rotation of these horizontal bones and attach a rig which moves them. There seemed to be some strange movement artifacts though, with some vertices not moving quite right, I don't understand why this would happen. Also blender crashed so I lost the rig so I can't upload it here.

Share this post


Link to post
Share on other sites

I was playing with this a bit earlier. I found that it seems to basically work if you put horizontal bones running the length of the set of oars at every point with vertices (I was using long rectangle so I just stuck one at the each end). Then you lock the rotation of these horizontal bones and attach a rig which moves them. There seemed to be some strange movement artifacts though, with some vertices not moving quite right, I don't understand why this would happen. Also blender crashed so I lost the rig so I can't upload it here.

I'd be interested in seeing that if you have some time to recreate (just within blender)? How many bones would you end up with?

Share this post


Link to post
Share on other sites

I'd be interested in seeing that if you have some time to recreate (just within blender)? How many bones would you end up with?

I have managed to recreate it properly, I made a rough copy of the oar shape from the trireme which has three places with vertices along the oar. Blender seems to be pretty iffy with its rigging support. I have found that you should leave the weight painting till last otherwise it does nasty stuff like flattening your model into a 2d plane for no reason. It is probably because I don't really know how to use it though.

oars8.blend.zip

Share this post


Link to post
Share on other sites

I have managed to recreate it properly, I made a rough copy of the oar shape from the trireme which has three places with vertices along the oar. Blender seems to be pretty iffy with its rigging support. I have found that you should leave the weight painting till last otherwise it does nasty stuff like flattening your model into a 2d plane for no reason. It is probably because I don't really know how to use it though.

Well I have to say that works much better than the manual way I was planning to do it. Will it work in 0 A.D. though? Worth a try :)

Share this post


Link to post
Share on other sites
Ah good, I thought you'd found a clever way that didn't require 1 bone per oar, which is why I really wanted to see how you'd go about animating the skeletal structure you created. We can't do 1 bone per oar for obvious reasons, so over the past few weeks I've been trying alternatives and there's a possibility I may have found one.

I think you can do it with about two bones per ship: For (e.g.) the left set of oars, create a single bone which is animated to move around in a circle at the tip of one oar. You want vertexes at the tip of any oar to have exactly that amount of movement; and you want vertexes at the fulcrum (where the oar joins the ship) to not move at all; and the oar should be straight, so you need vertexes 50% of the way along the oar to move 50% as far as the tip moves; etc. So you have to assign vertex weights so that the tip has weight 1.0, the fulcrum has weight 0.0, the middle has weight 0.5, and the weights increase linearly along the length of the oar.

The hard part is assigning the weights perfectly linearly - I don't know how to do that in Blender. Maybe with some custom Python scripting or something? (There might also be other terrible problems that I haven't noticed). I've attached a rough ugly test version just from manually painting on weights (with Blender 2.61).

(This assumes #1012 is fixed; otherwise you'll probably need to add an additional bone.)

shiprigtest.zip

Share this post


Link to post
Share on other sites

I think you can do it with about two bones per ship: For (e.g.) the left set of oars, create a single bone which is animated to move around in a circle at the tip of one oar. You want vertexes at the tip of any oar to have exactly that amount of movement; and you want vertexes at the fulcrum (where the oar joins the ship) to not move at all; and the oar should be straight, so you need vertexes 50% of the way along the oar to move 50% as far as the tip moves; etc. So you have to assign vertex weights so that the tip has weight 1.0, the fulcrum has weight 0.0, the middle has weight 0.5, and the weights increase linearly along the length of the oar.

The hard part is assigning the weights perfectly linearly - I don't know how to do that in Blender. Maybe with some custom Python scripting or something? (There might also be other terrible problems that I haven't noticed). I've attached a rough ugly test version just from manually painting on weights (with Blender 2.61).

(This assumes #1012 is fixed; otherwise you'll probably need to add an additional bone.)

Indeed this is the route I was planning to go down, using the skeleton structure I posted here: http://www.wildfiregames.com/forum/index.php?showtopic=15552&view=findpost&p=232845

However I was planning to keep the 3 rows of oars separate to allow some diversity in the movement (top ones need to move lower down to reach water).

I've just been trying to add quantumstate's animation structure onto a ship mesh but Blender doesn't handle it very well/easily.

Share this post


Link to post
Share on other sites
The hard part is assigning the weights perfectly linearly - I don't know how to do that in Blender. Maybe with some custom Python scripting or something?

Hmm, doesn't seem too hard with scripting. (I don't know if there's a much better way to do it, though). As a rough prototype/experiment: Select the ship mesh, switch to Edit Mode, lassoo-select the oar vertices that are outside the hull, switch back to Object Mode, then in the Python console run


def find_connected(vs):
while True:
nv = set()
for e in bpy.context.active_object.data.edges:
if e.vertices[0] in vs or e.vertices[1] in vs:
nv.add(e.vertices[0])
nv.add(e.vertices[1])
if nv == vs: return vs
vs = nv

nv = find_connected(set([i.index for i in bpy.context.active_object.data.vertices if i.select]))

for v in nv:
w = (bpy.context.active_object.data.vertices[v].co.x - 0.033) / 0.22
if len(bpy.context.active_object.data.vertices[v].groups) > 2:
bpy.context.active_object.data.vertices[v].groups[1].weight = 1.0 - w
bpy.context.active_object.data.vertices[v].groups[2].weight = w

The 'nv = find_connected' thing is just to automatically select all the oar vertices that weren't selected by the user (particularly the ones inside the hull that I don't know how to easily select manually), then it computes per-vertex weights for vertex groups 1 and 2 based on the x coordinate, so the oars stay perfectly straight while animating. (The oars get skewed rather than rotated, but I presume nobody's going to notice that since they're so small). So that seems like that approach should be feasible.

Share this post


Link to post
Share on other sites

Hmm...

I'm travelling, So sorry for the lack of my participation.

Anyways, I'll give it a try on Jonathan's way. :)

@Phillip' ... Hmm, your way sounds interesting, but, I don't know... Wouldn't the oars bend in a strange way with different weights points? I'll give it a look too. BTW, the way to select the entire oar is to select at least one vertex in the end of the oar and press the "+" key several times untill you have the whole oar selected.

Hmmm. I'll take a look. I think we're getting somewhere with the ship rigs ;)

Share this post


Link to post
Share on other sites
Wouldn't the oars bend in a strange way with different weights points?

No (unless I'm misunderstanding the question) - as the bone moves, each vertex moves by an amount proportional to the vertex's weight, and if we set the weights to be proportional to the vertex's distance along the oar then they'll all move by precisely the right amount to remain perfectly straight.

BTW, the way to select the entire oar is to select at least one vertex in the end of the oar and press the "+" key several times untill you have the whole oar selected.

Ah, handy :). (Seems to be Ctrl + Numpad-Plus for me in 2.61 (or Space + "select more").) (Also, looks like B + left-mouse-drag ("border select") is probably easier than the lasso selection. Eventually I might figure out how to use Blender without getting lost at the most basic steps :))

Share this post


Link to post
Share on other sites

@Phillip: Well, looks like the main probleman is with the oars geometry. Because right now they are made with two unconnected meshes (each one). Maybe with the geometry as one single mesh the issue with some vertexes behaving weirdly :P - (I tried to make a new oar with a single mesh, clonned them along the ship (top oars, just as a test), them I joined the geometry with the ship and run your script. For some reason it didn't work. - I'm assuming that to run the script you just need to paste the code, select the tip's vertexes, go to the object mode and press enter to run the script, right?)

@Jonatham: I quite like yours. But wouldn't be better to try with IK solvers? I don't know. I made mine with IKs... Maybe I can try to use your setup with IKs. Didn't have the time to test it yet. And also, there's that annoying issue with the rotation of the tip of the oars, what creates a small distortion.

In both metheods I guess we'll have some distortion, but it may be quite unnoticeable ingame. Unless we rig each oar - what would be easer - but not so easy, game-alike :P

What about we rig one oar and animate it. Them we can copy this oar as a prop of the ship. Them we'll have just few bones, and we can randomize the animations whitin the different oar, and the oars can be randomized whitin the ship's oar "houses". Sounds like for me the most easy and perfect solution for the distortion (don't know if it'll be perfect for codding nor performace).

What do you guys think?

Share this post


Link to post
Share on other sites
@Phillip: Well, looks like the main probleman is with the oars geometry. Because right now they are made with two unconnected meshes (each one).

That shouldn't be a problem (as long as the vertices from all the unconnected meshes are selected and have the weights applied).

I'm assuming that to run the script you just need to paste the code, select the tip's vertexes, go to the object mode and press enter to run the script, right?

Blender's Python console runs each line as soon as it's input, so you should paste the entire script (and press enter twice to ensure it's completed) only after doing all of the selection. Then it should be like the attached file.

What about we rig one oar and animate it. Them we can copy this oar as a prop of the ship.

Props aren't particularly good for performance - there's a constant cost for rendering each individual mesh (independent of the size or complexity of the meshes), especially if they're animated meshes, and I think it starts hurting once we have maybe hundreds of meshes on screen (whereas we can easily have hundreds of thousands of triangles), so using a hundred single-oar meshes for a single unit would be pretty bad.

shiprigtest2.zip

Share this post


Link to post
Share on other sites

@Phillip: Well, looks like the main probleman is with the oars geometry. Because right now they are made with two unconnected meshes (each one).

That's what I've fixed in the new rigs I've created - as I mentioned a few posts back. I haven't had any time for 0 A.D. the past few days - starting work at 8.30am and finishing at 10pm with a 50 minute commute each way eats up a lot of time :(

Share this post


Link to post
Share on other sites

Ykkrosh's rig seems to work best. For ease of animating it would be easy enough to set up a convenient rig with a small rotation locked bone which you would apply the script to.

Share this post


Link to post
Share on other sites

That's what I've fixed in the new rigs I've created - as I mentioned a few posts back. I haven't had any time for 0 A.D. the past few days - starting work at 8.30am and finishing at 10pm with a 50 minute commute each way eats up a lot of time :(

That sucks mate... Have you sent me your rig yet? I didn't look my inbox :P

@Jason: Are you working on the Human Rigs for Blender? Hmm... Are you importing the rigs that are already made? Hmm...Because I made a new one (I guess you saw). Wouldn't be better if we just code the new rig into the skeletons.xml? (I'm talking like a total stranger here. :P Dunno. Whatever you do, I'm prety sure it'll be better. hehehe)

Share this post


Link to post
Share on other sites

I'm afraid the best I can do is get you an export of what it should be like. I'll try to figure out how to do that. Though it might be easier said than done... My 3ds Max isn't working at the moment and I think I have to reinstall windows to get it up. I've got some cdilla issues.

Share this post


Link to post
Share on other sites

So. I gave it a try on codding the Blender armature into the skeletons.xml file.

But since I'm not at home, I can't try to get an animation ingame. So I'll post the code here, if anyone could try it and see if it works, it would be really nice.

         <skeleton title="Blender biped" target="biped">
<identifier>
<root>Armature</root> ;;(???? ==- Dunno what do to here)
</identifier>

<bone name="Armature"> ;;(??? - Neither here)
<target>root</target>

<bone name="hips">
<target>pelvis</target>

<bone name="spine">
<target>spine</target>

<bone name="ribs">
<target>spine1</target>
</bone>
</bone>
</bone>
<bone name="shoulder.L">
<target>l_clavicle</target>
</bone>
<bone name="upper_arm.L">
<target>l_upperarm</target>

<bone name="forearm.L">
<target>l_forearm</target>
</bone>
</bone>
<bone name="shoulder.R">
<target>r_clavicle</target>
</bone>
<bone name="upper_arm.R">
<target>r_upperarm</target>

<bone name="forearm.R">
<target>r_forearm</target>
</bone>
</bone>
<bone name="neck">
<target>neck</target>

<bone name="head">
<target>head</target>
</bone>
</bone>
<bone name="thigh.L">
<target>l_thigh</target>

<bone name="shin.L">
<target>l_calf</target>
</bone>
</bone>
<bone name="thigh.R">
<target>r_thigh</target>

<bone name="shin.R">
<target>r_calf</target>
</bone>
</bone>
<bone name="hand.L">
<target>l_hand</target>
<bone name="Biped_Lfingers"/> ;;(Dont have fingers in that test armature)
</bone>
<bone name="foot.L">
<target>l_foot</target>
<bone name="toe.L"/>
<bone name="heel.L"/> ;; (Added just because it had)
<bone name="heel.02.L"/> ;; (Added just because it had)
</bone>
</bone>
</bone>
<bone name="hand.R">
<target>r_hand</target>
<bone name="Biped_Rfingers"/> ;;(Dont have fingers in that test armature)
</bone>
<bone name="foot.R">
<target>r_foot</target>
<bone name="toe.R"/>
<bone name="heel.R"/> ;; (Added just because it had)
<bone name="heel.02.R"/> ;; (Added just because it had)
</bone>
</bone>
</bone>
</bone>
</skeleton>

Share this post


Link to post
Share on other sites

Bumping for the sake of a bump.

I'm planning to start manning the sieges soon. (At least the Rams, as they are the most simple animations.).

A question to Michael, when the rams are engaged in hand to hand combat will the mens do out and fight untill die, so the rams could be captured, and maybe manned by other guys and teams? (Like CoH) And If yes, how is the number of men per garrison per ram per faction?

I'm going to start sketching something soon. (I brought a camera, so I can start making funny tests in my free time :P - recording me doing funny stuff)

If someone could take a look at the blender code, It would really be nice.

BTW I remembered that I had uploaded the fisherman_paddling animation. If you guys want to give it a run to try the code, please be my guest. (As I can't try, since i'm not home.)

Fisherman-test.zip

Share this post


Link to post
Share on other sites

I think capturable siege would be better suited to a game like Rome Total War. There's just too much going on at one time in 0 A.D. to have to worry about capturing rams and such.

Share this post


Link to post
Share on other sites
But since I'm not at home, I can't try to get an animation ingame. So I'll post the code here, if anyone could try it and see if it works, it would be really nice.
Try exporting a .dae file and I think it could be used to read the names of the hierarchy structure as the .dae file sees it.

Share this post


Link to post
Share on other sites

Ok, I've got Max working finally!

Note to self: Thanks to this link - http://forums.cgsociety.org/archive/index.php/t-247858.html

So, this is what an imported skeleton should look something like. I've included the geometry points for reference.

skeleton_export.zip

Does this help?

I see blender has the ability to export a .fbx file? Is it capable of opening one as well?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0