Jump to content
Alwarren

Arma Toolbox for Blender - Arma 2/3 exporter script

Recommended Posts

From the CUP_ prefix I would guess the model is one of Community Upgrade Projects models and doubt it would be available. 

It is very important you learn early to look beyond tutorials and can implement the techniques for your own work.

 

It really should not matter what model you use and the Arma 3 Samples have very good example models you can use. Look into the character sample and the RTM sample .p3ds.

Share this post


Link to post
Share on other sites

And you have access to the same resources as Al. Namely the A2 sample files. Just find something you like in those and apply what you see in the video. The mesh layout is fairly consistent between A2 characters, because they have to suit the default animation sets. :)

  • Like 1

Share this post


Link to post
Share on other sites

I managed to copy the weights! finaly! all seem works. Now I need to bound it with armature which I don't know where to find. I can't locate the armature in ArmaRig_V6_1.blend 'cause I'm not familar with the blender. Only thing I can do is to export ArmaRig_V6_1.blend to FBX and then import back but in that case there is a lot redundant (imo) bones. So is there any way to obtain the armature to fit the arma 2 character?

 

p.s.: I still don't understand where to find those files from Al's video. If there's no way to get any of them just tell me this is not possible or something, or did you already?) I don't know where to find A2 sample files (blender file) which would be very helpful. 

 

thanks guys, I'm almost there! :)

Share this post


Link to post
Share on other sites

I managed to copy the weights! finaly! all seem works. Now I need to bound it with armature which I don't know where to find. I can't locate the armature in ArmaRig_V6_1.blend 'cause I'm not familar with the blender. Only thing I can do is to export ArmaRig_V6_1.blend to FBX and then import back but in that case there is a lot redundant (imo) bones. So is there any way to obtain the armature to fit the arma 2 character?

 

p.s.: I still don't understand where to find those files from Al's video. If there's no way to get any of them just tell me this is not possible or something, or did you already?) I don't know where to find A2 sample files (blender file) which would be very helpful. 

 

thanks guys, I'm almost there! :)

 

I have uploaded the skeleton here https://drive.google.com/open?id=0B_C1BxZphNz9RjdFelRNRnVqT2M

 

But be aware that this is just a skeleton with no rigging attached. I really recommend using Macser's ArmaRig. If you want to animate the character, you will need a real rig, not just the skeleton, and if you want to export it you don't need the rig or skeleton. Just throw out the sample character from the ArmaRig and replace it with your own (Drag the object into the rig and chose "parent with armature deform")

Share this post


Link to post
Share on other sites

Alwarren, thanks a lot, everything works!
I'm just wondering why I need to use Macser's rig (or any other rigged character) for applying armature to the original (a2) characters — because, as I understand, imported p3d characters already contains needed information about vertex deformation. I have a feeling that described process just generates weightings based on presented sample rigged weighted char from Macser. My thoughts based on this: after weights are copied I rotated "Spine2" and flask's (both) cap are squeezed along with spine - is it possible that this is original (mean from bi) skin weights? if yes than it's okay.

 

8i6xp151o18n5eu6g.jpg

Share this post


Link to post
Share on other sites

Ok. I want to be crystal clear. The models inside the Armarig blend file are from the BI A3 samples. The weights are unedited. What ever weight distribution you see is from BI. For me to have made any edits would've defeated the purpose of creating it. Usually you would do the weighting after the character has been created. In this case though they already exist. I made absolutely no changes what so ever to the weighting. :)

 

There's no need to use my rig with either the toolbox or for any other purpose. I just made it to give people something to animate with or check out model deformation without having to create their own. Which can be a tedious process if you're not used to it. Or just unfamiliar with Blender.

 

A rig allows you to check your model against the default samples. The best way to find areas that are clipping or deforming badly, is to put the character into some poses, or do some simple animations. This will show up those areas before you start going in game. Otherwise you end up bouncing back and forth from game to modeling software until you get it right.

 

This is probably more important for A3, as the character and the clothing are separate. Which is why Al had to do some reconstruction/adjustment of the meshes. Otherwise the arms, legs and other areas would protrude through the clothing.

 

As for that model. I'm not exactly sure what happened there. If I bring in a default A2 east soldier and just add an armature modifier, I get expected deformation.

 

FF5sy72j.jpga98dFJKn.jpg

Is it a custom mesh? 

Share this post


Link to post
Share on other sites

I think it would be important to establish what exactly you are trying to achieve.

 

I use Macser's rig, for example, to make hand poses and reload anims for my weapons. That is what you need such a rig for, to be able to export an RTM afterwards. RTM export only works via a rig, and Macer's rig is set up so that it only exports the "relevant" deformation bones and not the control bones, IK targets, and other helpers. Animating without such a rig is a pain in the backside, since the XXXRoll bones are supposed to stay in line with the appropriate upper bone, so at the very least you need copy constrains on these, or your arms and legs will get four joints instead of two :)

 

If you are making a uniform, then you don't strictly need it. You can just copy the weights from the original Arma 3 sample, paint them yourself, or use a skeleton like the one I posted for automatic weighting (not recommended, that will almost always fail). If you watched my tutorial video, you see that I use the skeleton mostly to check for weighting issues at the "new" parts of the uniform (mainly, arms).

 

Weighting vests is a PITA. Most "structures" on the vest (magazine pouches, bottles, radios etc) are rigid. You will have to edit them if you have copied the weights. For example, rigid items like Radios or bottles should have the same weight in the group, for example, a bottle on approximately the height of Spine1 should have 1.0 weight for Spine1 for all its vertices. You might need to add it with, say, 0.4 or something like that to Spine2 oder Pelvis depending on whether it "moves" or not. Avoid having too much influence from the Arms, the weight copy might assign some RightArm or LeftArm to the fringes of the arm holes of the vest, which will result in weird "drawn-out" deformation of vests. 

 

This process is a lot of trial and error, and having a rig can help you to a certain extend to avoid too many runs through AddonBuilder/pboProject and Game engine.

 

My thoughts based on this: after weights are copied I rotated "Spine2" and flask's (both) cap are squeezed along with spine - is it possible that this is original (mean from bi) skin weights?

 

Copying weights is done by proximity, and as I said above, that isn't necessarily what you want, especially when rigid bodies like the water bottle is concerned. You will have to make some manual adjustments. Uniforms usually work because they are close to the body and flexible, but even then, some manual laber might be needed, especially in the arm pits area.

 

I hope this clears up some of the problems. Weighting can be a frustrating task, and looked like arcane magic to me when I started out.

  • Like 2

Share this post


Link to post
Share on other sites
Okay, this is very kind of you guys to explain such details on the animation/skinning, I'm really appreciate!

 

I understand all you saying because I'm working in 3ds max for 15 years now. As for the clarification of what I want to achieve I can say the following - ideally I need to get original (from bi) weights, bones/armature (if possible) and meshes. The reason why I want the EXACT original is mainly because of learning purposes — I like to see how different artist/animators solves their issues on skinning/modeling characters. Also I really want to bring something new to the arma because I'm not satisfied with animation BI did.

 

So, as I understand the weights imported in blender presented as vertex groups, right? can I bound those vertex groups with armature by names directly?

Share this post


Link to post
Share on other sites

The weights are already present in any available sample model, whether they're characters, vehicles or weapons. They take the form of named selections. In Blender these are represented as vertex groups. They are present when you import a model that already has named selections. On export of a P3D these vertex groups are saved, again, as named selections.

 

As I mentioned already that's how I created my blend file. I didn't create any weights. The bones in the armature are named exactly the same as the selections in the model. The vertex groups. All I did was bring in the A3 samples and apply an armature modifier to them. By default the modifier uses available vertex groups to bind to a mesh. There's no magic or complicated procedure for that part. You don't need to parent the mesh to the rig or do any automatic weights as it's already weighted. Nothing is created by the modifier. It simply grabs the existing vertex groups and forces them to follow the bones, based on the weight distribution.

 

The A2 example I posted above wasn't edited in any way either. It's just a sample model with an armature modifier on it. The modifier is obviously not "applied". It remains active to accommodate deformation.

 

The only editing you would need to do, is what Al did. Make them suitable for an A3 character mesh. Which means pulling around verts to make sure the A3 mesh doesn't poke through any of the clothing,vests and equipment. For a uniform you would need to fill in the gaps in the upper torso, as the A2 meshes have none behind the vests.

 

Of all the processes you might encounter, this is one of the simplest to deal with. Animating and then creating the configs, is the tricky part. 

 

Note:

If you were interested in creating a rig of your own the rigify addon is very easy to setup and modify. 

Share this post


Link to post
Share on other sites

So, as I understand the weights imported in blender presented as vertex groups, right? can I bound those vertex groups with armature by names directly?

 

Yeah, there is a one-to-one mapping between bone names and group names. So the weights in vertex group Spine1 are deformed by the bone of the same name.

Share this post


Link to post
Share on other sites

did you apply the scale before exporting? apply location rotation and scale with CTRL+A before you export

Share this post


Link to post
Share on other sites

I tried to scale everything at once which was the problem (I didn't know I had to apply it). I went into edit mode on each one and it worked fine.

Share this post


Link to post
Share on other sites

I think that's the one thing that catches everyone in the initial stages. It's caught me on more than one occasion. :smile_o:

 

It'd be nice if the foundation put in a small warning message, even on the top bar, about applying changes made in object mode.

  • Like 1

Share this post


Link to post
Share on other sites

i was hunting a bug that i thought was a weighting issue for 2 hours the other day, turns out the model exported slightly too small (the scale was at 1.1 instead of 1) which resulted in clipping issues on the shoulders

Share this post


Link to post
Share on other sites
i was hunting a bug that i thought was a weighting issue for 2 hours the other day, turns out the model exported slightly too small (the scale was at 1.1 instead of 1) which resulted in clipping issues on the shoulders

Can you elaborate? What scale are you referring to?

Send from my tablet, so pardon any autocorrect bollocks

Share this post


Link to post
Share on other sites

i simply forgot to apply the scale. the scale should be 1 when you export but mine was 1.1, so it exported with an actual scale of 0.9 and the vest was therefor slightly smaller than it should be, resulting in clipping issues. it was an oversight on my part that cost me multiple hours

Share this post


Link to post
Share on other sites
5 hours ago, Mr.Skellington said:

i simply forgot to apply the scale. the scale should be 1 when you export but mine was 1.1, so it exported with an actual scale of 0.9 and the vest was therefor slightly smaller than it should be, resulting in clipping issues. it was an oversight on my part that cost me multiple hours

 

Ah, okay. I will add a warning message to the next version that will tell when there is a non-1.0 scale on an object, or maybe I'll just apply the transformation internally.. will consider.

 

I seriously wish Blender's UI was better and easier to program. Even a thing as a yes/no message box is already a challenge :|

  • Like 1

Share this post


Link to post
Share on other sites
On ‎25‎/‎01‎/‎2017 at 10:42 PM, Macser said:

I think that's the one thing that catches everyone in the initial stages. It's caught me on more than one occasion. :smile_o:

 

It'd be nice if the foundation put in a small warning message, even on the top bar, about applying changes made in object mode.

Yeah, i'll admit to it, i'm a Blender noob.

Share this post


Link to post
Share on other sites

Hi Alwarren and thanks for this awsome tool, i completly switched to Blender.

 

I there an equivalent to Find Components ? That would be awsome.

 

I ran into difficulties that could have been by-passed with some interesting functionnalites, so i thought i could suggest them here.

Since i'm pretty new to Blender maybe there is a way to do it and i just missed it.

i'm just saying what could have imporved Arma pipe in my case.

 

- Apply Modifiers option on export, it may help when you want to keep things non-destructive and use an object later as a basis for your LODs.

- Merging same LOD objects, i noticed here that this option may have existed. Once again, it may help when you have various modifiers on different objects and you don't want to go destructive.

 

:thumbsup:

Share this post


Link to post
Share on other sites
2 hours ago, zgmrvn said:

Hi Alwarren and thanks for this awsome tool, i completly switched to Blender.

 

Glad you like it :)

 

2 hours ago, zgmrvn said:

I there an equivalent to Find Components ? That would be awsome.

 

No, at least not yet. I ran into such a situation recently myself and thought it would be something that would be "good to have" (tm), it's just that so far I didn't get the time for that. It's definitely on my todo list.

 

 

2 hours ago, zgmrvn said:

- Apply Modifiers option on export, it may help when you want to keep things non-destructive and use an object later as a basis for your LODs.

 

Yeah, same thing as above. I also wanted to add a warning and/or automatically apply scale/location/rotation if they aren't non-zero; I once ended up with an ACR of around 14 meter size because I had not applied the scale.

 

 

2 hours ago, zgmrvn said:

- Merging same LOD objects, i noticed here that this option may have existed. Once again, it may help when you have various modifiers on different objects and you don't want to go destructive.

 

The feature was sort-of available once, but I dropped it because it never worked and it was too much work trying to fix it. 

 

There are a few things that are kind of awkward to do in Blender. For example, the normals exported by the Toolbox are botched, so I pipe the result through o2script (the scrip processor of ObjectBuilder) which fixes them. I had tried to do that inside of Blender but ended up using insane amount of memory.

In the long term, I am planning a major rewrite of the import/export that would use an external program that reads a temporary blend file and extracts the data itself, which could make import/export much faster than it is right now. Funnily enough, most of the time is wasted on selections, because of fundamental differences in how Blender internally stores the vertex groups (as opposed to how O2 stores them). But there are all long-term plans and I don't know when that will happen.

 

Anyway, thank you for your feedback. I hope I can sneak in some work on the toolbox, also since I have an improved version ready since a while that I couldn't release yet.

 

  • Like 1

Share this post


Link to post
Share on other sites

Alright, I have decided to put this out here since otherwise it will never see the light of day.

 

A new (experimental) version of the toolbox is available now, you can download it here

 

As the "experimental" suggests, this might not be for the faint-hearted. There have been quite substantial changes to the handling of things, and some manual labor might be required to update your .blend models to work with this - I definitely recommend making backups. Handling of weights and proxies are the major changes in this, plus too many other things to remember. I will try to start a series of tutorial videos on how to use this etc, but a) my time is limited and b) I suck at making videos, so that might take a while.

 

Still, this might be useful for some. If you have questions or suggestions, make sure to report them here. If you are easily scared, you might want to stick with the old release until I have found time to explain the changes.

 

Enjoy!

  • Like 4

Share this post


Link to post
Share on other sites
13 hours ago, Bruce Conway said:

@AlwarrenIs there currently any way to export multiple objects within the same LOD?


No. If you will need to merge these objects first before you can export them.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×