Dieting Hippo Posted February 20, 2021 (edited) Hi! I recently finished working on an Add-On for Blender 2.83 - 2.92 called Palette Studio, which streamlines the process for creating Doom sprites. With this you can pose a model in Blender, then press render once and get one, eight, or sixteen angles for a sprite with the selected palette colors applied. With some extra compositor Scale/Crop nodes in the Scene Graph, the output can also be resized/cropped to the sprite size needed. Screenshot of Palette Studio and the rendered output: Spoiler It's also not limited to PLAYPAL.pal, pop in any other palette and you'll get some great results! Please grab it and enjoy, I've been having loads of fun messing around with it. Do also leave any feedback/comments/suggestions/bug reports! Also, be sure to read the Readme.txt below. It provides step-by-step instructions on setting up a scene for rendering with Palette Studio. Download: Palette Studio v1.2 (Feb. 28, 2021) Latest Changes: https://dietinghippo.itch.io/palette-studio/devlog/227087/palette-studio-v12-out Readme.txt: https://dietinghippo.itch.io/palette-studio/devlog/224145/readmetxt Where to get palettes: https://lospec.com/palette-list Check out a video example of what Palette Studio can do in Doom below: Spoiler Edited March 1, 2021 by Dieting Hippo : Updated to Palette Studio v1.2 18 Share this post Link to post
NeoWorm Posted February 24, 2021 I have to test this. I am using Nash's blender sprite rendered that is not updated to latest blender. I am nor really keen on automatic conversion to palette straight from blender, sice I want to do hand modification to sprites to make them fit the rest of DooM/HeXen sprites, so that feature is not really interesting to me. Also Nash's renderer is actually rotating the model instead of using multiple cameras which means lights can be setup that the sprite is illuminated from front on all sides. I fear that would be the biggest problem I have with this. I will see this weekend, I won't be able to get to it sooner. 0 Share this post Link to post
Dieting Hippo Posted February 24, 2021 Thanks for checkin' it out soon! Re: Palette application, that's the main draw of Palette Studio and you won't be able to render out without having a palette selected. If you need to render without a palette, Blender itself is more than adequate for that. However, if you do still want to modify the color-indexed sprites after rendering you can! All sprite images are saved as .png in the selected output folder, so you can open the sprites up in your image/sprite editor of choice and clean them up as needed. Additionally, since the sprite colors are already set to the colors of the palette selected, you can be sure that the colors applied to the sprite will also be the same colors in-game or in-editor with the indexed palette applied. For lights, you can see in the Luigi Imp video at the bottom of the post that lighting can be evenly applied to all sides of the sprite without rotating any light sources. I currently use two sun light sources that are angled down toward the model, with the angles rotated 180 degrees around the Z axis. This provides a large amount of light coverage, while still allowing for some small adjustment lighting to be added. I do plan on adding in the ability to select a group of lights with Palette Studio, which would then be rotated around the rig for each angle. However, that's on my pinboard of future feature ideas so I can't guarantee when that'll go in. If you do find any bugs though, please let me know! v1.1 already squashed a lot of bugs, but I'm sure there's extra cases I haven't covered yet. 0 Share this post Link to post
NeoWorm Posted February 25, 2021 Ok, if the palette is forced than it's worthless to me. It means losing color data and making the editing afterwards even more tedious. Getting the lightning setup in blender to fully emulate DooM or HeXen style is next to impossible and it needs the hand touchups and hand coloring some parts color from precise palette ranges. Automatic will choose nearest color regardless of palette range and introduce more color crunching once I try to fix that. And the lightning is another deal breaker. The Luigi sprites looks really washed up and flat. I use light from above and slightly from front a fill light and sometimes a rim light to punch up the volume of the object even more and that is still not enough to make it work without hand modifications. Sorry if I sound kinda awful, I don't want to be too critical of hateful. I am interested in creating sprites to be as close to DooM and HeXen and this looks like more problems than solutions in the end. Vanilla Blender have one huge problem and that is lack of automatization for this specific thing of rendering sprites in 8 angles with consistent lightning. It's probably not that hard to make a script for that, but I have zero knowledge about blender scripting so I am destined to leech off projects like this or do the rendering by rotating and rendering the models by hand. 0 Share this post Link to post
Dieting Hippo Posted February 25, 2021 It is pretty harsh, not gonna' lie. The Luigis were more a proof of concept and can be redone with better lighting. However I do believe you don't need a plugin, and this script will do what you need: import bpy from math import radians from mathutils import Matrix ## Enter object name below ## object_name = 'Cube' ## Enter file prefix below ## file_prefix = 'CUBE' ## Enter file extension below ## file_ext = '.png' ## Set true if global object rotation, false for local ## rotation_global = True ## Set axis to rotate around ## rotation_axis = 'Z' ## #### ## def rotate_object(obj, angle_degrees, axis='Z'): if rotation_global: obj.rotation_euler = (Matrix.Rotation(radians(angle_degrees), 3, axis) @ obj.rotation_euler.to_matrix()).to_euler() else: obj.rotation_euler = (obj.rotation_euler.to_matrix() @ Matrix.Rotation(radians(angle_degrees), 3, axis)).to_euler() object = bpy.context.scene.objects[object_name] filepath = bpy.context.scene.render.filepath absolutepath = bpy.path.abspath(filepath) for i in range(0, 8): bpy.context.scene.render.filepath = absolutepath + file_prefix + str(i+1) + file_ext bpy.ops.render.render(write_still=True) rotate_object(object, 45, rotation_axis) bpy.context.scene.render.filepath = absolutepath Toss it in a text editor window in Blender, change "object_name" to the name of the object in the scene to rotate, "file_prefix" to whatever you need, and the rest of the options as needed. Once that's all done, press the play button at the top of the text editor. As it is now this will rotate an object named "Cube" around its Z axis and render out to files CUBE1.png, CUBE2.png, and so on. The output directory will be what your current render path is set to, so be sure to set that beforehand. I understand the frustration of not being able to find something like this easily (especially Blender scripting), but don't be harsh when it's a tool not specifically designed for what you have in mind. I hope the above script helps you out. 2 Share this post Link to post
thelazyqdude Posted February 25, 2021 Aahh... now to learn how to use blender. 2 Share this post Link to post
Tango Posted February 25, 2021 this is awesome mate, you are a saint for making and sharing something like this! 1 Share this post Link to post
Mr.Rocket Posted February 25, 2021 I don't know about you guys but I wanna cruze that little motorcycle/chopper thing around! :P Do you think your Add-On for Blender may stay compatible with future versions of Blender? I remember Add-On script authors having to update their script when ever a new Blender version was released, is this still the case? 1 Share this post Link to post
Dieting Hippo Posted February 25, 2021 Thanks y'all! I hope it does stay compatible for a while. There was a large jump between Blender 2.79 and 2.80 which broke a lot of plugins, but I wouldn't anticipate any large breaking Blender updates for a while. If anything does break due to an update I will try my best to fix it though! 1 Share this post Link to post
NeoWorm Posted February 25, 2021 13 hours ago, Dieting Hippo said: It is pretty harsh, not gonna' lie. The Luigis were more a proof of concept and can be redone with better lighting. However I do believe you don't need a plugin, and this script will do what you need: import bpy from math import radians from mathutils import Matrix ## Enter object name below ## object_name = 'Cube' ## Enter file prefix below ## file_prefix = 'CUBE' ## Enter file extension below ## file_ext = '.png' ## Set true if global object rotation, false for local ## rotation_global = True ## Set axis to rotate around ## rotation_axis = 'Z' ## #### ## def rotate_object(obj, angle_degrees, axis='Z'): if rotation_global: obj.rotation_euler = (Matrix.Rotation(radians(angle_degrees), 3, axis) @ obj.rotation_euler.to_matrix()).to_euler() else: obj.rotation_euler = (obj.rotation_euler.to_matrix() @ Matrix.Rotation(radians(angle_degrees), 3, axis)).to_euler() object = bpy.context.scene.objects[object_name] filepath = bpy.context.scene.render.filepath absolutepath = bpy.path.abspath(filepath) for i in range(0, 8): bpy.context.scene.render.filepath = absolutepath + file_prefix + str(i+1) + file_ext bpy.ops.render.render(write_still=True) rotate_object(object, 45, rotation_axis) bpy.context.scene.render.filepath = absolutepath Toss it in a text editor window in Blender, change "object_name" to the name of the object in the scene to rotate, "file_prefix" to whatever you need, and the rest of the options as needed. Once that's all done, press the play button at the top of the text editor. As it is now this will rotate an object named "Cube" around its Z axis and render out to files CUBE1.png, CUBE2.png, and so on. The output directory will be what your current render path is set to, so be sure to set that beforehand. I understand the frustration of not being able to find something like this easily (especially Blender scripting), but don't be harsh when it's a tool not specifically designed for what you have in mind. I hope the above script helps you out. I am really sorry for sounding so harsh. For me the flexible and precise automatic rendering is just endlessly more interesting than palette conversion that can be done very easilly in many programs including SLADE. But thank you a lot for the script, I will try it too. 1 Share this post Link to post
Dieting Hippo Posted March 1, 2021 Palette Studio v1.2 is out! Check out all the nifty stuff I added in this release: Select individual indices of a palette. (ex: 0,3,9,11,12,13 or 0,3,9,11-13) Use 1, 8, or 16 cameras. Each selection will set the appropriate ID character for the filename, including 9-G for ZDoom's 16-angle support. Create a light rig and parent lights to it to rotate the lighting for each render. More details in this devpost here: https://dietinghippo.itch.io/palette-studio/devlog/227087/palette-studio-v12-out This is a huge release, and I hope these additions add features that help people out that weren't feasible before. As always, let me know if there's any bugs and I'll try address them. If you do make sprites with Palette Studio, please post 'em! 2 Share this post Link to post