How to render the weapon animation separately, without a character, to create a video game sprites?

Hi guys,
I need to create some weapon sprites in Blender, that will be used in a video game. First I need to export the png sequences of character animation without weapons and then export the same action with a weapon only, on transparent background. But the most important thing is, to have the impact of the character in the weapon animation. I.e if it’s about sword, it has to be rendered with a placeholder of the character hand, which means that the grip of the sword will have a hole (which is meant to be a character hand ), so that if the sword animation sequence is placed above the character animation, it looked as if the character is holding the sword.

When I try to export only the weapon sequence, it is rendered as the character was transparent, rendereing the sword fully in all positions… Please help

Thought you’d be able to draw the sword first then the hand over it in most game engines. :man_shrugging:

Anyway, you could look up Object ID and Material ID and how to use either as a mask to mix a Holdout or Transparent shader.

Edit: Object Index example added.


Everything you want to render transparent should be left with a Pass Index of 0 (the default).

@LoboTommy Hey, thanks. I followed your image as much as I could by the screenshot you uploaded, but it didn’t work… Can you give me some additional information?

I’ve found this link and followed it as well. It kinda works, but can’t get rid of the white background for some reason, although the alpha is turned on…

Maybe if you tell me what settings you changed and posted a render result?

Try using render layers and see if that is what you want. Put your character on say layer 1 in blender. Your weapon on say layer 2. You can exclude or mask the layers as needed for the render. If the character is behind the weapon, you can mask out that part of the character or not. Then you can just render the weapon layer and mask out the character which will leave your “hole”. (Of course put the lights in a layer which I only left on layer 1 before I rendered the sword.)

Here is what I did. Render with sword with character. Sword masked with character. Character masked with sword.
Will any of these work?

@stilltrying U’re god damn good!!! It worked! Thanks

1 Like

@LoboTommy Hey, I solved the problem, at least until now ))) Thank you very much, I really appreciate that you replied so many times to my questions