Converting a Blender camera animation to DEC/ZScript states

If it's not ZDoom, it goes here.

Converting a Blender camera animation to DEC/ZScript states

Postby Nash » Sat Dec 29, 2018 11:35 am

A long-ass time ago, I proposed the idea of a workflow to animate a camera in Blender and have a script spew out DECORATE (and now ZScript) code for you to copy and paste. The idea was an artist-driven solution that would allow you to create completely organic camera animations, using a set of tools specifically tailored for such tasks, and in the fraction of the time than the traditional "type everything in DECORATE manually while mentally figuring out the angles for every state".

Despite all the nay-saying back there, I've finally achieved it. Well, a huge part of it, at least.

Image

Notice how all angles are animated here: angle, pitch, roll. And it works relative to whatever direction the player is facing, too. Notice how it also cleanly returns you back to your original angle before the attack was executed. AKA it just works.

The animation was done in less than a minute in Blender. I have purposely exaggerated the movements here and of course if I'd spend more time on the animation (and make it more subtle and realistic perhaps), it would look better in-game, but the point is, this script already works.

The script generated a 183-line long (technically 366 lines in total; there are 2 animations here, left and right) ZScript file that I could NOT have possibly done by hand while still maintaining my sanity AND making it look very organic. Check this out:

Spoiler:


So currently, this only does angles (angle, pitch, roll). I want it to do position too (X, Y and Z) so that you can animate your camera in Blender and it'll generate some commands to move actors about in the map (therefore simulating walking - no path nodes needed). So you could compose a full cutscene in Blender (not unlike those seen in Half-Life 2 or Dying Light) and with 1 click, have it auto-generated for you. Once I figure the movement part out, I'll release this script.
User avatar
Nash
Nash Muhandes
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia

Re: Converting a Blender camera animation to DEC/ZScript sta

Postby neoworm » Sat Dec 29, 2018 2:01 pm

I suppose it will be compatible with your's tilt script? I tried to add roll to weapon animations some time ago and coudn't make it work.
User avatar
neoworm
 
Joined: 23 Sep 2005
Location: Czech Republic

Re: Converting a Blender camera animation to DEC/ZScript sta

Postby Dancso » Sat Dec 29, 2018 2:06 pm

This may be the coolest thing I've seen in a very long time. Great work!
User avatar
Dancso
bow wow
 
Joined: 11 Oct 2006
Location: at home.. Status: lazy like hell

Re: Converting a Blender camera animation to DEC/ZScript sta

Postby Nash » Sat Dec 29, 2018 3:06 pm

neoworm wrote:I suppose it will be compatible with your's tilt script? I tried to add roll to weapon animations some time ago and coudn't make it work.


Yes. I've recently updated Tilt++ to call A_SetRoll in such a way that it will never overwrite previous tilt values. And therefore, this Blender script I am talking about in the OP also uses similar technique of setting roll additively. So everything can be combined.
User avatar
Nash
Nash Muhandes
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia

Re: Converting a Blender camera animation to DEC/ZScript sta

Postby Kinsie » Sun Dec 30, 2018 8:25 am

I always thought Doom was missing my crosshair constantly swinging around so I couldn't land a hit. Nice touch.
User avatar
Kinsie
A Concept Utterly Obsolete
 
Joined: 22 Oct 2004
Location: MAP33
Discord: Find Me...
Twitch ID: thekinsie

Re: Converting a Blender camera animation to DEC/ZScript sta

Postby Apeirogon » Sun Dec 30, 2018 9:17 am

I think that for such script you need to know on what distance, from the vertex of the cone of view, blender and gzdoom render images.
Or "teach" gzdoom spherical geometry and use it, without help of other programs, for such effects.
Apeirogon
I have a strange sense of humour
 
Joined: 12 Jun 2017

Re: Converting a Blender camera animation to DEC/ZScript sta

Postby Tormentor667 » Sun Dec 30, 2018 9:25 am

You are Crazy :)
User avatar
Tormentor667
needs more detail
 
Joined: 16 Jul 2003
Location: Germany

Re: Converting a Blender camera animation to DEC/ZScript sta

Postby Enjay » Sun Dec 30, 2018 9:42 am

It's impressive - and once again Nash does something really cunning with the game - but who waves their head around like that when trying to hit something? People who miss the thing their trying to hit, that's who. ;)
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: Converting a Blender camera animation to DEC/ZScript sta

Postby gramps » Sun Dec 30, 2018 3:23 pm

Clearly he's holding that crowbar-wielding severed hand in his teeth ;)
gramps
 
Joined: 18 Oct 2018


Return to Off-Topic

Who is online

Users browsing this forum: No registered users and 1 guest