Converting a Blender camera animation to DEC/ZScript states

If it's not ZDoom, it goes here.
Post Reply
User avatar
Nash
 
 
Posts: 17434
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Converting a Blender camera animation to DEC/ZScript states

Post by Nash »

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
neoworm
Posts: 1740
Joined: Fri Sep 23, 2005 9:17 am
Location: Czech Republic

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

Post by neoworm »

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
Dancso
Posts: 1906
Joined: Wed Oct 11, 2006 10:39 am
Location: at home.. Status: lazy like hell

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

Post by Dancso »

This may be the coolest thing I've seen in a very long time. Great work!
User avatar
Nash
 
 
Posts: 17434
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

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

Post by Nash »

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
Kinsie
Posts: 7399
Joined: Fri Oct 22, 2004 9:22 am
Graphics Processor: nVidia with Vulkan support
Location: MAP33
Contact:

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

Post by Kinsie »

I always thought Doom was missing my crosshair constantly swinging around so I couldn't land a hit. Nice touch.
User avatar
Apeirogon
Posts: 1605
Joined: Mon Jun 12, 2017 12:57 am

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

Post by Apeirogon »

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.
User avatar
Tormentor667
Posts: 13530
Joined: Wed Jul 16, 2003 3:52 am
Contact:

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

Post by Tormentor667 »

You are Crazy :)
User avatar
Enjay
 
 
Posts: 26517
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

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

Post by Enjay »

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. ;)
gramps
Posts: 300
Joined: Thu Oct 18, 2018 2:16 pm

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

Post by gramps »

Clearly he's holding that crowbar-wielding severed hand in his teeth ;)
User avatar
Nash
 
 
Posts: 17434
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

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

Post by Nash »

Some more progress...

Image
Image

Yes, the camera animation is exaggerated. This is just meant to clearly show the results. In a proper production, the animation would be done more carefully.

Here's where I am right now with what I am now going to name GZAnimTools. These will be a set of tools that allow one to author camera animations, and - newly added - weapon sprite animations in Blender.

- It utilizes the in-progress submission by MajorCooke to rotate and scale the weapon sprite at run-time.
- It can do camera animation, and weapon sprite animation
- Weapon sprites can have multiple layers. In the example animation, the shotgun and the muzzle flash are placed on two separate layers in Blender. GZAnimTools will generate separate overlay scripts for you.

Here's what the generated ZScript looks like:



GZAnimTools is being used in a couple of currently-in-progress GZDoom TCs and will be released after said projects have been released.

(And no, the animations won't be as bumpy as what I'm showing here. I say again, that these were hastily-done examples to show what's possible with it. If I made the animations too subtle, it would be difficult to see what's going on in these tiny animated GIFs)
Post Reply

Return to “Off-Topic”