Left 4 Dead 2
62 оценки
Creating Moving Intro Cameras with Blender
От мяFunreal
Learn how to make smooth, animated intros (Or outros) for maps.
   
Награда
Добавяне към любими
В любими
Премахване от любими
Foreword and Requirements
This guide teaches you how to make smooth intro camera animations, using a model animated in blender.

Requirements
This prefab[drive.google.com]
containing a VMF, a Blender save file, a QC file and a pre-built SMD.
Blender[www.blender.org]
SourceIO[github.com]
To import a map to blender.
The addon works on 2.80[download.blender.org] lineage for sure. Not fully tested on newer versions, but it should work.
Placing Entities
1
Download the prefab and open the VMF. Lets have a look at it, because we'll need this first.

  1. INTRO_CAMERA - the model that will end up being the camera model
  2. camera_gamemode_killer - shuts off the intro camera when playing survival or scavenge.
  3. director - starts the intro process and locks spawn positions.
  4. relay_intro_start - the relay holds outputs to start the intro.
  5. relay_intro_setup - handles all the camera attachment stuff.
  6. relay_intro_finished - stops the intro when required.
  7. fade_intro - fades from black into gameplay
  8. gameinstructor_disable - disables hints and other instructor stuff while intro is playing.
  9. gameinstructor_enable - enabled hints and other instructor stuff when intro is finished.
  10. survivorPos_intro_01 ,2, 3, 4 - Player starts, with their own cameras in their heads.
    The player spawns are currently set to use the Idle_Calm_Pistol intro sequence.
    But swapping it out is a matter of seconds.

2
Place all of these entities into your own map.
Replace your player spawns and the director if you have to.
Merge your own director outputs from your map into the ones of my prefab, or the other way around.
But do not keep both.


Place the ERROR somewhere in the intro path. But next to the player spawns is fine.

3
Save your map.
Use Cordons to only have the intro location be compiled into a map.
Also hide everything except:
  • World Brushes
  • func_brush
  • func_detail
  • Props.
    Physics props are not needed, unless they're so large they could clip into the camera path.

Tip: If you want to easily hide everything you do not need, you could use my auto visgroup setting to hide everything but props and brushes. Found in the "more autovisgroup" section of this guide.

When done, your map should look something like this:

Only props, displacements, and the world brushes.
The red box outline means it's been Cordoned. In which case a Skybox is not needed.
If your map is not cordoned, you need to make your own skybox to prevent leaks.

You may now compile the map

Importing map to Blender
4
Open Blender, and open the blender save from my prefab.

Its just a camera you can use for a viewport, and the bones that animate it with a helper model.

5
Head to "File - Import Source Engine Assets - Source map .bsp"


Head to L4D2's map folder and select your bsp.
Make sure the "World Scale" is set to exactly 1.0!


When your map imports, you may need to edit the maximum view distance to see the map.


6
Select all "empties" (or just select everything by pressing A)
in the "SourceIO" tab on the Right hand menu (shows by pressing N) click on "Load Entity"


It will load all vanilla models.
Custom models will need to be added manually.
For example, the "INTRO_CAMERA" is still just an "Empty"


To make things easier for you, zoom out, select the entire world geometry model, enter edit mode, select all skybox material faces and delete them.


Cleanup
7.1
Now we have all relevant parts of the map and the camera setup. but we have not yet placed our camera where we need to have it, and the entire blender scene looks like this now:


The easiest way to fix this is to merge all map models into a single model.
Do so by:
  • Hiding the camera helper model and armature.
  • Pressing A in the viewport to select everything.
  • Making any model the "active" model by clicking on it
  • Pressing Ctrl+J to join everything to that active model.

Now the outliner looks like this. Not really better yet.


7.2
Press A in the outliner and press "Delete" inside the outliner until all Collections are gone.
In newer versions of blender you'll have to select each collection and delete them one by one.


7.3
Select the INTRO_CAMERA empty, press Shift+S and Cursor to Selected


7.4
Select your merged map model, select "Object - Set Origin - Origin to 3D Cursor"
Or Ctrl+Shift+Alt+C like a lunatic


You should now have an orange dot where that empty is, when you select your map.


7.5
Press Shift+C
Your view might zoom out and the cursor should be back at the map center.


7.6
With your map model selected, press Shift+S again and press Selection to cursor
Your entire map will move so that the camera armature and model from the prefab will be where the INTRO_CAMERA empty was. Relative to all other things.


7.7
In object mode, select "Select - Select all by type - Empty"
Delete all empties. they're useless now.


7.8
You may have some leftover armatures, or other things leftover that have no use.
Delete those things too.


All we should have now is the model of the map, the camera, an armature and helper model.
Animating
8
Now we can finally start making that dang ol animation for the camera.
Head to the "Animation" tab of blender.
If you loaded my interface with the blend save, it should look like this.

  1. Action Editor - Holds all keyframes
  2. Graph Editor - Helpful for making camera movement better.
  3. 3D View of entire scene
  4. View of what the camera in L4D2 will see. FOV is a little off, but good enough.

I reccommend turning on "Auto Keying". represented by this little dot.
This allows you to make any pose, which will be immediately saved as a keyframe.


Like so:


ANYHOW:
Now is the time where you can animate this thing.
Use the "Cam" bone to position and move the camera how you want to.

Tip:
it is best to animate on 60FPS and in batches of 60 frames. It's easier to do maths with. Example: You'll know that one second passes after 60 frames. And you'll end up needing a relay with delay in seconds to "stop" the intro. If your intro is exactly 600 frames long, you'll know its 10 seconds long. If it was 950 frames long, it would be 15.5 seconds. But if it was 467 frames, you'd have to count the exact time the sequence takes to stop. Add one more second of idle frames to the very end as a "buffer" so the animation would continue playing, but the relay will cut it short. If the sequence is exactly as long as the timer on turning it off, the camera could reset to its ref pose for a split second before the timer to disable it fires. The transition from "Last frame of sequence" to "camera going into players head" is done automatically. if your camera is looking at the players face, the view will turn in whatever way the game deems shortest. which may not look like you want it. So keep that in mind. Every player could have its very own intro camera. Every "point_viewcontrol_survivor" entity would need to be either parented to a different camera model, or you need to add more bones for other attachments to the same model. The "relay_intro_setup" relay would also need to be changed to change the attachment name, if you add more atachments to one and the same model. Else, just parent the "point_viewcontrol_survivor" to a different intro camera prop_dynamic each.

By the way, the map should have textures. Not really required, but may help visualize things.


Here's a basic sequence i did.
It looks like a stuttery mess because i can only upload up to 2mb gifs.


9
When you are reasonably happy with your movement, give it a name and export the animation.
Select the armature in the outliner, fold out the "animation" and rename the sequence name if you want to, I'd just name it "intro"


Then head to the source exporter, pick an export location and export the smd.


You should now have the following things:

Preferably keep all of this in a subfolder, where your vmf files are.
Compiling Model
10
Open introcam.qc
The $Modelname and the $Sequence, need to be changed to use your data.

"Snap" Stops odd blending from the ref bose to the intro pose. so it starts exactly where it should.
"FPS 60" makes the sequence run on 60 fps.


11
Drag the modified introcam.qc onto Crowbar to compile the model.

make sure there's no error messages.
Using model in map
12
Open your map and swap the INTRO_CAMERA model, which is currently an ERROR to your model.


Go to the "Model" tab and pick your intro sequence.
You'll see the axis helper stay put, but the camera now moves across the map.
It is very possible that you need to rotate the model on the spot it is. I had to turn it 180°


13
Open the "Relay_Intro_Start" relay and look at its outputs.


The output for //Director would make the players immortal and stops SI and MOB spawns.
It is "commented", or simply broken, because maybe your people spawn in a room nobody can get in.
If you are in the open, like the C1M1_Hotel Rooftop, uncomment it so the output fires.

The "Relay_Intro_Finished" output, with a delay of 14 seconds is what makes the intro stop.
I used 600 frames (+60 frames of buffer), at 60 fps. Therefore my delay would be 10 seconds instead.

All other entities are set up to work as is.
You could add more outputs so the players would start saying something, but remove nothing.
For example, this very same relay used to have an output to have someone start talking after six seconds.

Important
Make sure your camera model is still set to "Don't render" and "Not solid".
Else you might see it just chilling around, cracking a leak with the boys.
Camera FOV
Blender and Hammer both have different ways of setting FOV.

But if you set Blender's camera up with these settings:


And in hammer with a FOV of 30:


The FOV should match pretty well.

Closing words
You can now compile the map and test it ingame.

This 2mb limit is chocking me hard. Nevermind me forgetting to set the delay for that relay.



If you need help with modding, join the Dead 4 Mods Discord server[discord.gg].
I have My own Discord server[discord.gg] aswell.
I also got Paypal[paypal.me], for don't-ations.
6 коментара
HerobrineAce 4 окт. 2022 в 6:14 
Nice
Maj. Problem 6 окт. 2021 в 6:37 
wait theres more then moving a camera? NOOOOOOOOOOOOOO
抓不到鱼的喵 6 окт. 2021 в 1:35 
ABC
ratatuji 1 окт. 2021 в 16:22 
Awesome :steamthumbsup:
Monesy 1 окт. 2021 в 1:14 
nice dude, you're amazing
erkyp3rky 30 септ. 2021 в 19:57 
thank you