Render 8 Direction Animated Sprites in Blender with Python

แชร์
ฝัง
  • เผยแพร่เมื่อ 6 ต.ค. 2024
  • An overview of how to use Blender to render 3D assets to 8 direction sprites with a python script to save time!
    Python Script:
    github.com/Foo...
    Itch Link: (download the .blend file):
    foozlecc.itch....
    Consider liking, subscribing, or supporting me on Patreon if you enjoyed!
    bit.ly/Patreon...
    Come chat in Discord: / discord
    Pertinent Links:
    Let's Talk Game Design TH-cam Channel:
    / letstalkgamedesign
    Mixamo: (3D Model and Animations)
    www.mixamo.com/
    I enjoyed making this tutorial and I hope you find it useful. Please leave your comments down below on what you would like to see next and if you enjoyed it please subscribe!
    Cheers-
    FoozleCC

ความคิดเห็น • 104

  • @ElliotIF
    @ElliotIF ปีที่แล้ว +7

    this video saved me a lot of work
    i didn't even know there was scripting in blender as i'm just starting out
    made some changes in the original script to set the objects by name instead of selection and rotate the camera instead of the mesh, and added something to generate a single image with all frames as in a sprite sheet and it's working like a charm, thank you!

    • @personalcorner2291
      @personalcorner2291 10 หลายเดือนก่อน +5

      could you post that code please it would be a huge help

    • @davef21370
      @davef21370 9 หลายเดือนก่อน

      @@personalcorner2291 Link's in the description.

  • @DrunkenWizardBattle
    @DrunkenWizardBattle 2 ปีที่แล้ว +9

    excellent and comprehensive tutorial. Thank you for providing the scripting and introducing me to mixamo too... you've shaved weekends off my project. A patreon subscription well earned.

    • @FoozleCC
      @FoozleCC  2 ปีที่แล้ว +2

      Thank you and glad it helped!

  • @tjames6427
    @tjames6427 2 ปีที่แล้ว +9

    I used a very similar method for making frames for the monsters my doom mod such as using mixamo, the only thing is I didn't have a better blender workflow like yours. thank you for the awesome tips and info.

  • @darkwraithcovenantindustries
    @darkwraithcovenantindustries 11 หลายเดือนก่อน +1

    I am so glad I found this, I was right about to do what amounts to stop motion animation with my model (let the animation play a frame, stop, take screenshot, rinse/repeat) before I found this (I am an artist, but a total blender n00b and am not yet fully understanding its capabilities), This will save sooo much time, Thanks mate!

  • @HansMilling
    @HansMilling 7 วันที่ผ่านมา

    This is exactly what I need, thanks for a great tutorial.

  • @Zenith_Star69
    @Zenith_Star69 9 หลายเดือนก่อน +1

    Insanely helpful and has changed how I develop games

  • @skepsys_d
    @skepsys_d 2 ปีที่แล้ว +3

    That was awesome, thank you for taking the time to put this gem of a video together. Cheers and stay safe out there.

    • @FoozleCC
      @FoozleCC  2 ปีที่แล้ว +2

      Thanks! Been tons of fun figuring out how to use Blender for more things

    • @artistic.autist
      @artistic.autist ปีที่แล้ว

      @@FoozleCC Re: "one spritesheet" - Realize you're not needing 1 sheet for your game, for single sheet generation ( I'm using 1 sheet per direction ), add subprocess.call() imagemagick commandline to convert, such as: "magick montage *.png -tile x1 -geometry +0+0 -background none -alpha background spritesheet.png". I'm doing this & also generating a .gif each. You code saved me a lot of time for similar workflow. Thanks for posting this great tutorial!

  • @-INC0GNIT0-
    @-INC0GNIT0- 7 หลายเดือนก่อน

    Thank you for your very good tutorial and the python script as well !
    This will finally make my 3D assets useful for future 2D game development :)
    You just added a huge boost to my indie game production time and I'm very gratefull for that !

  • @guvrd75ecvu6.hgvjkuhtc
    @guvrd75ecvu6.hgvjkuhtc 2 หลายเดือนก่อน

    I found stupid versions of this far superior tutorial before watching yours... So glad I decided to keep looking. Thanks for your work and for freely sharing.

  • @darkandarts227
    @darkandarts227 2 ปีที่แล้ว

    bro, you are my god , normaly nobody want teach this type of things, i looking for this years! when i complete my game i gona credit you men!

    • @FoozleCC
      @FoozleCC  2 ปีที่แล้ว

      Glad it was helpful! Good luck on the game 👍

  • @alexandersemionov5790
    @alexandersemionov5790 11 หลายเดือนก่อน +2

    Thanks a lot for THE script. I made change to restore Objects original animation and rotation though. Also will add resulting file name list export to json config for Phaser js engine to read

    • @aManFromEarth
      @aManFromEarth 11 หลายเดือนก่อน

      Do you know how one could automatically create normals as well using this script?

  • @Anonymousewizard
    @Anonymousewizard 2 ปีที่แล้ว +1

    some of the most interesting ideas come from this channel.. thanks foozle! i just been thinking how i would do this!

    • @FoozleCC
      @FoozleCC  2 ปีที่แล้ว

      Thanks! Glad it was helpful for you

  • @JulioCaesarTM
    @JulioCaesarTM 2 หลายเดือนก่อน

    Thank You for this, still helping out.

  • @zosyn320
    @zosyn320 ปีที่แล้ว

    Wow, I was thinking about doing something like this in my mind for a long time, now I can no excuse to get started, thank you!

  • @ScharneckCB
    @ScharneckCB ปีที่แล้ว

    Thanks this is a very helpful tutorial on using Mixamo assets for animations and rendering. Much appreciated

  • @webtest1192
    @webtest1192 5 หลายเดือนก่อน

    Works like charm. Tested in blender 4.1

    • @horaciomagliacano5452
      @horaciomagliacano5452 4 หลายเดือนก่อน

      also this error came along with it
      RuntimeError: Operator bpy.ops.object.select_all.poll() failed, context is incorrect

  • @omelette2718
    @omelette2718 หลายเดือนก่อน

    Firstly, I'm the 100th comment and holy crap this is so smart and so efficient, thank you so much!

  • @sdsdfdu4437
    @sdsdfdu4437 ปีที่แล้ว +1

    Thanks for this! Would be cool if the script put all the frames in one spritesheet but I think I can handle that myself

    • @artistic.autist
      @artistic.autist ปีที่แล้ว +1

      Re: Sprite Sheet - Here's code I'm using (Windoze ver) to generate GIF & SpriteSheet using ImageMagick from within blender script:
      # Set up the command to Generate the .GIF
      executable_path = 'C:\\Program Files\\ImageMagick-7.1.0-Q16-HDRI\\magick.exe'
      parameter0 = 'convert'
      parameter1 = '-delay'
      parameter2 = '4'
      parameter3 = '-loop'
      parameter4 = '0'
      parameter5 = '-dispose'
      parameter6 = 'previous'
      parameter7 = animation_folder + '\\*.png'
      parameter8 = animation_folder + '\\' + str(a.name) + '.gif'
      command = [executable_path, parameter0, parameter1, parameter2, parameter3, parameter4, parameter5, parameter6, parameter7, parameter8]
      # Call the external file with the parameters using subprocess
      result = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
      # Set up the command to Generate the SpriteSheet
      executable_path = 'C:\\Program Files\\ImageMagick-7.1.0-Q16-HDRI\\magick.exe'
      parameter0 = 'montage'
      parameter1 = animation_folder + '\\*.png'
      parameter2 = '-tile'
      parameter3 = 'x1'
      parameter4 = '-geometry'
      parameter5 = '+0+0'
      parameter6 = '-background'
      parameter7 = 'none'
      parameter8 = '-alpha'
      parameter9 = 'background'
      parameter10 = animation_folder + '\\' + str(a.name) + '.png'
      command = [executable_path, parameter0, parameter1, parameter2, parameter3, parameter4, parameter5, parameter6, parameter7, parameter8, parameter9, parameter10]
      # Call the external file with the parameters using subprocess
      result = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
      #print(result.stdout.decode())

  • @theindiegamedude
    @theindiegamedude 2 ปีที่แล้ว +3

    Amazing content as always! This method for generating assets using 3D models is awesome :) Thanks so much for the ready to go Python Script as well!
    This is going to make things so much easier when using 3D models to create game art assets. I could see running the output images through something like PixelOver to get started turning them into pixel art quickly, or making any other further edits as well to get the desired style. Or do some studying on Blender, and use the Compositing and Shaders like you have. I'm just so used to PixelOver after using it for a month or so.

    • @FoozleCC
      @FoozleCC  2 ปีที่แล้ว +3

      Thanks! Yeah, there are different approaches to using compositing or shaders on materials which can yield awesome results. Post processing is also an option as you suggested- best of luck!

  • @Morituri96
    @Morituri96 10 หลายเดือนก่อน

    Ty buddy! Sometimes you a bit fast, and you sitting in front of settings does not rly help too :D but thats because im a noobie is suppose. I still made it work! Nice video!

  • @andycarr3711
    @andycarr3711 ปีที่แล้ว

    I find rendering high and then rescaling with photoshop can get better results than a smaller render in blender.

  • @btarg1
    @btarg1 2 หลายเดือนก่อน

    Could you do a tutorial combining these into a spritesheet easily?

  • @j.d.6100
    @j.d.6100 ปีที่แล้ว

    exactly the video i needed, thank you!

  • @megaderstable
    @megaderstable 11 หลายเดือนก่อน

    You kinda look like Peter Gibbons from "Office Space", lol. Thanks for the great lesson!

    • @FoozleCC
      @FoozleCC  11 หลายเดือนก่อน

      …Not right now, Lumbergh, I'm kinda busy. In fact, look, I'm gonna have to ask you to just go ahead and come back another time. I got a meeting with the Bobs in a couple of minutes. 😂

  • @XX-gb7zd
    @XX-gb7zd ปีที่แล้ว

    What a god thank you so much for the script

  • @timmy1877
    @timmy1877 2 ปีที่แล้ว

    My hero.
    Instant sub.

  • @Gator732
    @Gator732 หลายเดือนก่อน

    ty for this

  • @lucasbird6367
    @lucasbird6367 ปีที่แล้ว

    Awesome tips! Thank you so mutch :))

  • @raresagegames
    @raresagegames 2 ปีที่แล้ว

    Great video, I havent played with blender, and I dont plan to for a while. But when I do I'll have to try this out!

    • @FoozleCC
      @FoozleCC  2 ปีที่แล้ว +1

      Thanks for the watch and comment! Cheers

  • @DevEnabled
    @DevEnabled 2 ปีที่แล้ว +1

    Very cool. I came straight from the LTGD channel. Did you do something similar to render out the level pieces too? They look like they have a similar style. I'm trying to do something similar for a 2D platformer and considering ways to make tilesets.

    • @FoozleCC
      @FoozleCC  2 ปีที่แล้ว

      Yeah - in SMASH the level layout is done in 3D and rendered out. It has some fake wall angles and stuff to make the look come out that we were going for with our camera angle

    • @DevEnabled
      @DevEnabled 2 ปีที่แล้ว

      Thanks for replying. It's good to know something like that is possible to make look good too. Gives me some hope on trying to setup 2d looking tilesets

  • @karlabellera6346
    @karlabellera6346 11 หลายเดือนก่อน +1

    Thanks for this! At first, the model is not rotating when the script was ran, making all sprites face one direction only. It seems I needed to click the Armature itself instead of the parent Armature (i.e. Armature>Armature). Could be an issue isolated to Blender 3.5.1.

    • @howieb4217
      @howieb4217 9 หลายเดือนก่อน

      I've got the same problem on version 4.0.2, except the direction always remains east regardless of which Armature is selected. It's driving me slightly bonkers!

  • @ginofm7142
    @ginofm7142 2 ปีที่แล้ว +1

    great tool!

  • @alphaecho3094
    @alphaecho3094 ปีที่แล้ว +1

    Great tutorial, but I seem to be having some issues getting the script to work in my own custom scenes, is there a certain set up I need?

  • @developeralley
    @developeralley 3 หลายเดือนก่อน

    ❤awesome

  • @Winstreak1
    @Winstreak1 2 ปีที่แล้ว +1

    It's been a while since you posted, hope SMASH is going well!

    • @FoozleCC
      @FoozleCC  2 ปีที่แล้ว

      Thanks! Yeah, I had a new daughter join the family in the beginning of Feb. so was on a bit of a break :) SMASH is going wel though!

    • @Winstreak1
      @Winstreak1 2 ปีที่แล้ว

      @@FoozleCC Oh ya, I think I read something about that on discord. We'll glad to have you back and welcome to the world new daughter :)

  • @aftamat4ik
    @aftamat4ik ปีที่แล้ว

    amazing!

  • @laserwolve
    @laserwolve 2 ปีที่แล้ว +2

    That's funny, I've made the exact same thing but instead of Blender I did it in Daz Studio.

    • @FoozleCC
      @FoozleCC  2 ปีที่แล้ว +1

      A little bit of effort up front to automate can save a ton of time. Never tried it in Daz / used the software, would be fun to give it a try though after looking into it.

  • @hornachos
    @hornachos 7 หลายเดือนก่อน

    Best video ever!!!!

  • @TheRevecablue
    @TheRevecablue ปีที่แล้ว

    Thank you so much!!!

  • @AF-bc8vr
    @AF-bc8vr ปีที่แล้ว

    Mm, I think there's a problem with the Blender's NLA.
    For some reason when u have multiple characters on the same .blend file, it would always go back to the previews rendered anim, for instance if just rendered a 10 frame anim, then u want to go to a 20 frame anim for another character, if you run the script it would go back to the 10 frame one, and I can't find a way of "cleaning" this up. It's like it gets stuck on that and I have no idea how to fix it.
    Great script btw.

  • @Yasinaktimur
    @Yasinaktimur 5 หลายเดือนก่อน

    tyboss

  • @howieb4217
    @howieb4217 9 หลายเดือนก่อน

    First of all - thanks for the tutorial! It's great. I'm totally stuck getting this to work, tho. I'm selecting the correct object / Amature and am still getting every render facing east. I've tried the suggestions below and older versions of Blender with the same result. The animations all select correctly, just all facing east. It's like the camera is locked. Any suggestions would be much appreciated!

  • @risingforce9648
    @risingforce9648 4 หลายเดือนก่อน

    Any tip in scirpting? to make it for topdown classic rpg? thanks

  • @kenkenflorendo887
    @kenkenflorendo887 4 หลายเดือนก่อน

    Hi good day sir I would like to ask if it is possible to change character animation in Exiled Kingdoms. like for example the warrior, can the warrior weild a sword with two hands? Thank you in advance

  • @death8538
    @death8538 2 ปีที่แล้ว

    Hello. I love you videos and I want to ask if it's possible to make voice chat in construct 3. Also if it's possible Will you make a video about that?

  • @-INC0GNIT0-
    @-INC0GNIT0- 4 หลายเดือนก่อน +1

    I got a certain model where the script only seems to render out the East side for all the directions instead of all directions (setup is done correctly as the script does work for a mixamo model).
    Any ideas where it might go wrong ?

    • @pavlemilosevic8224
      @pavlemilosevic8224 26 วันที่ผ่านมา

      I have same issue, let me know if you found a fix :/

    • @jordanw1643
      @jordanw1643 3 วันที่ผ่านมา

      @@pavlemilosevic8224 I was having dramas too, then just installed blender 3.0 from previous versions on blender website (after selecting 3.0, it lets you select 3.0.1 like he has in the vid) and then everything works perfectly

  • @jbhandler7369
    @jbhandler7369 ปีที่แล้ว

    This is amazing, thanks for the lucid walkthrough. My janky 2d sprites are getting a major overhaul :)
    Anybody know if the exported pngs "include" normal info, or should I think about making normal versions of the frames? Kinda unclear to me.

  • @tuanas458
    @tuanas458 2 ปีที่แล้ว +1

    Can you do more than 8 directions?

    • @FoozleCC
      @FoozleCC  2 ปีที่แล้ว

      Absolutely- just change the python script to have smaller angle increments.

  • @successspotu
    @successspotu ปีที่แล้ว

    Thanks

  • @zaid7713
    @zaid7713 2 ปีที่แล้ว

    Hello man can you make tutorial about shooting game or some like fps 3d

  • @3DPActionFigures
    @3DPActionFigures ปีที่แล้ว

    This is great!
    Btw, what if we want an equipment system for 2d characters. Like, when you equip a weapon, it will display the character holding the weapon, for every animation, for every direction.
    With this system, making many weapons will require too many sprites for every animation for every direction of the character!
    This applies not only to weapons, but also to other items like armors.
    3D has no problem with this, but when you want it to be 2D, it will really be tiresome.
    Is there a way to make this easier just like what you did in this videos? Thanks.

    • @megaderstable
      @megaderstable 11 หลายเดือนก่อน +1

      you have to make some sacrifices, I'm afraid. Like in the original Fallout, where they pre-rendered all the major variations possible (every armor could have either light, heavy or melee weapon equipped). That, or you could go with cartoon style and just slap weapon sprites on top of the character sprites where applicable.

  • @neozoid7009
    @neozoid7009 ปีที่แล้ว

    awesome but is the rendered animations are in isometric or top down perspective ?

    • @pandueka7718
      @pandueka7718 ปีที่แล้ว +1

      It should be isometric

  • @danielpatrascu
    @danielpatrascu 11 หลายเดือนก่อน

    Hi! I am not sure if I missed it in the video, but where do you set the downward angle for your sprite sheet?
    I case I want to make an isometric 2d game, I need to make sure all my sprites are drawn at an e.g. 60 deg downward agle. How do you set this?
    Thank you!

    • @FoozleCC
      @FoozleCC  11 หลายเดือนก่อน +1

      In the "Outliner" panel, make sure you have the Camera selected. Then in the "Properties" panel, select the orange square "Object Properties" along the side of the panel. Under "Transform", I set the "Mode" to XYZ Euler from Quaternion if needed then adjust the Location and Rotation properties until the camera angle is nice. Please also note that if you select an "Orthographic" Lens Type in the Camera properties (green camera along side of the panel section), you can adjust the "Orthographic Scale" to size how large of an area you want to render. A good hot key is to do all this after hitting Numpad 0 in the layout which will show you the camera's current view. Good luck!

  • @jonaszIGD
    @jonaszIGD ปีที่แล้ว

    interesting, you think voxels 3d models into c3 is possible?

  • @AGPMandavel
    @AGPMandavel ปีที่แล้ว

    As far as I'm aware, I set everything up correctly, script is not generating images. I'm in blender 3.3, perhaps that has something to do with it.

    • @banthafoddervo8916
      @banthafoddervo8916 หลายเดือนก่อน

      I think that can be changed in the blender default render settings

  • @indiarocks5731
    @indiarocks5731 2 ปีที่แล้ว

    Hi , what is the camera tilt angle you guys are using ?thanks

  • @op3d472
    @op3d472 3 หลายเดือนก่อน

    are 6 out of the 8 renders just copies? you only really have to render North and North East, the rest are flipped or rotated copies of N and NE. Seems like a waste of resource if it's actually rendering 8 different sprite-sheets no?

    • @FoozleCC
      @FoozleCC  3 หลายเดือนก่อน +1

      I regularly do just 5 directions and mirror NE E and SE for west. Sometimes though you care that the weapon remains in the “right hand” etc and will render out all 8.

  • @LeftyZX
    @LeftyZX ปีที่แล้ว

    the script not working

    • @FoozleCC
      @FoozleCC  ปีที่แล้ว

      Been a while since I have played around with it. Try making sure you have the right object selected. Either way I hope it helps you tweak it for your use case!

  • @Sneaky1ne
    @Sneaky1ne 8 หลายเดือนก่อน

    Anyone know if this method takes a lot more storage for the sprites as opposed to something like bone animation ?

    • @FoozleCC
      @FoozleCC  8 หลายเดือนก่อน +1

      Really depends on a range of factors. This method will have higher image memory needs while bone animation needs CPU. You will need to play with how many frames and resolution you need. Best of luck! For me it works great for be long able to have high enemy count on the screen using the rendered sprites.

    • @Sneaky1ne
      @Sneaky1ne 8 หลายเดือนก่อน

      @@FoozleCC That's a very useful insight, I hadn't considered the cpu tradeoff. Maybe for my case the tradeoff between cpu and storage is worth it, since I am considering a high unit count on screen.
      Thank you!

  • @alanhewitt7450
    @alanhewitt7450 ปีที่แล้ว

    The images exported are all showing the same direction, doesnt matter if it is east, west, etc. All facing east. I am using the blend file you have as a template...what could I be doing wrong here?

    • @FoozleCC
      @FoozleCC  ปีที่แล้ว

      Been a while but I believe you need to have the object selected in case you aren’t.

    • @alanhewitt7450
      @alanhewitt7450 ปีที่แล้ว

      @@FoozleCC I have the armature selected, or does the empty object need to be selected?

    • @alanhewitt7450
      @alanhewitt7450 ปีที่แล้ว

      @@FoozleCC Can this be done with a character exported from UE5? I can get this to work with a mixamo character, but not my UE5 quadruped character.

    • @FoozleCC
      @FoozleCC  ปีที่แล้ว

      @@alanhewitt7450 maybe shoot it to me over on Discord: Foozle#8597

    • @howieb4217
      @howieb4217 9 หลายเดือนก่อน

      Hey man. Did you ever find a fix for this? I'm gettign the same issue - all 8 directions facing east.

  • @NuMoneyKnothead
    @NuMoneyKnothead 4 หลายเดือนก่อน

    DID YOU EVER FINISHED YOUR GAME S.M.A.S.H

    • @FoozleCC
      @FoozleCC  4 หลายเดือนก่อน

      This one hits hard 😢 - Life put a lot of my dev on the shelf. Maybe it will eventually see the light of day in some form!

  • @McApplebees_does_not_exist
    @McApplebees_does_not_exist ปีที่แล้ว +1

    what about a 16 point view angle, i'm going for something like this, th-cam.com/video/-HTrzHkGZ-c/w-d-xo.html

    • @FoozleCC
      @FoozleCC  ปีที่แล้ว +1

      Sure - you should be able to modify the script to be every 22.5 degrees instead of 45

    • @McApplebees_does_not_exist
      @McApplebees_does_not_exist ปีที่แล้ว

      @@FoozleCC fantastic thank you

  • @BritishBastard
    @BritishBastard ปีที่แล้ว

    tried every 22.5, but get this error: 'float' object cannot be interpreted as an integer