Blender to Sprite


#61

it a bit over the top, yeah, but its an experiment with very smooth animations. i might reduce them later.
but 1 sprite is only 4kb so its not that big.


#62

eRROR
image


#63

you can reduce the frames by half.
change in the script
for f in range(startFrame,endFrame + 1):
to
for f in range(startFrame,endFrame + 2):

check if you have the object rotationmask in the scene


#64


#65

hmm.
i do not know why that is.
in blender 2.76 this line of code works.
try to copy this here:

camParent = bpy.data.objects['rotationmask']

maybe the ‘’ are wrong, or try “” instead.


#66

Place this line where?


#67

line 6 where the error is. replace it.
should be exactly the same, but maybe the copy pase via forum changes syntax.


#68

Same


#69
import bpy
from math import radians
from os.path import join

S = bpy.context.scene

renderFolder = r"C:\Users\gertrud\Documents\GDevelop projects\Hunters\My project21\sprites\thief suit\noWeapon\yawn"

camParent = bpy.data.objects['rotationmask']

startFrame = 1 # replace with your start frame
endFrame  = 251 # replace with your end frame
numAngles = 4
rotAngle  = 360 / numAngles

for i in range(numAngles):
# Set camera angle via parent
    angle = i * rotAngle
    camParent.rotation_euler.z = radians( angle )

# Render animation
    for f in range(startFrame,endFrame + 2):
        S.frame_set( f ) # Set frame

        frmNum   = str( f-startFrame ).zfill(3) # Formats 5 --> 005
        fileName = "yawn_{a}_{f}".format( a = angle, f = frmNum)
        fileName += S.render.file_extension
        bpy.context.scene.render.filepath = join( renderFolder, fileName )

        bpy.ops.render.render(write_still = True)

try copy this and change the filepath again (line 7)


#70

It worked and then blender crushed lol


#71

blender should work still. check your folder where it saves. there should be pictures showing up.


#72

Blender is rendering only 1 image then it stops working
image


#73

ure sure? blender is not frozen anymore?


#74

While it is frozen maybe that time it render that image then it crash


#75

when i run the script blender freezes (looks like a crash) but is actually rendering the images. when the images are rendered blender runs normal again/defreezes
check the image folder, there should be more showing up.


#76

if you want to just render all 8 angle per hand by yourself, you can do it of cause.
the script is just convenience to run overnight.

I am very glad for your help, and you can do it however you want <3


#77

trying but seams it will crash again


#78

let it “crashed” it should work anyway. let it open


#79

yea it did …


#80

i know how confusing that is. i was amazed to see it still working while beeing white frozen xD