Presentation is loading. Please wait.

Presentation is loading. Please wait.

Advanced 3D Art and Animation

Similar presentations


Presentation on theme: "Advanced 3D Art and Animation"— Presentation transcript:

1 Advanced 3D Art and Animation
Lesson M (week 13): Revising Motion with Animation Layers Introduction to the Unity Game Engine for Game Artists

2 Animation Layers: What are they for?
Once you have created rough animation for your film character, you are ready to start adding more detailed motions to limbs, body, and face. If you want to try something without changing your original rough motion work, Animation Layers are a perfect solution. Animation Layers store changes to character motion as separate units. Like Photoshop layers, they can be toggled on and off and blended (“weight”). They can be used in animation pipelines in many ways. Film Animators often use them for iteration on character motion. Game Animators will turn one walk cycle into many by adding a pose change in the anim layer, making a normal walk seem tired, or wary, happy, etc. Another good use of Animation layers is to manage looping and non-looping motions. Let us say, for example, we have a character that is walking down a street, and all the while holding a conversation. We can make a layer that animates a few steps and loops that motion. As long as that layer is active, and not suppressed by a higher Override layer, that cycle will continue. On a higher layer we can add animation for the torso, arms, head and face that show specific conversation moments performance. Source notes:

3 Animation Layers: Basic Function
In the Channel Box bottom go to the Anim tab. Click the right-most button (blue ball) to create two layers: Base Animation contains all the objects in the scene and all the keyframes created so far. AnimLayer1 (or other layers created) only contain objects that are selected when AnimLayer is created, or added later (select object, rightclick AnimLayer to Add Selected). Rightclick a layer to set Layer Mode (Additive or Override), Remove Selected objects from a layer, Delete a layer, Merge Layers, etc. Organize new AnimLayers: Name, rightclick red box to set key colors (so the keyframes for each layer are unique). To loop animation: Select one or more objects, and then in the Windows > Animation Editor > Graph Editor select one or more tracks, select a set of keyframes, and in the Graph Editor menu choose Curves > Post Infinity > Cycle (turn off loop: Curves > Post Infinity > Constant) Notes source:

4 What is Unity? Unity is a game engine, which means it is a system for organizing the development of interactive software with robust features such as physics engines, shaders, and ways to build and test scenes. Unity is one of two Engines used by the majority of professional and hobbyist game developers in the world to make games for all platforms: mobile, PC, Console and the web. The other is Unreal, and both are free for students and small-scale projects. Unity uses C# as the preferred programming language (Unreal uses C++ and the robust visual Blueprints system). A lot can by accomplished in Unity with minimal programming. The Unity Learning site, youtube, and others offer a ton of tutorials for making full games from scratch, including all needed code. Unity itself does not include a coding environment; for that we need an IDE, like Visual Studio (free version downloads with Unity, requires free login after trial period) or Monodevelop.

5 Creating a Unity Project
Download the free “Personal” version of Unity here: Long-term users can download Unity Hub to help manage multiple versions over multiple years: Once installed, DoubleClick to open and hit New to create a new project. Choose 3D (default) and set to a folder location for your project: a folder on your desktop. Hit [Create Project]. The Unity screen will disappear while Unity builds a project into that folder. It is building a bigger project that we necessarily need; the downside of working with an established engine is that it inefficiently includes functions we might not need in our project. The upside is that we don’t have to build any of the basic function of almost any game ourselves. NOTE: The Unity game engine is normally intended to be used by a collaboration between artists and programmers, so the normal location would be inside of a folder that is set to be read and written to by an online repository, like GitHub.

6 The Unity Interface There are 6 areas of the interface to begin:
PROJECT: RightClick import assets, create folders, Animators, C# scripts, and others. SCENE: Like Maya: navigate [Alt]+Mouse, hit [f] to focus on selected, [Shift] to add to selection, [W][E][R] to transform. HIERARCHY: List of items in Scene. Objects dropped here are placed in Scene center. Select to adjust properties in the Inspector. INSPECTOR: Name, set Transforms and tags, add and change Components, including physics Colliders and Rigidbody. MENUS: GameObject to add non-mesh items: 3D Objects, Empty GOs, lights, VFX. GAME: Hit “Play.” Any changes made in the Scene or Inspector while in Play mode will be reverted/lost when Play is turned off. Note the “Maximize On Play” option. A Prefab is an object that contains multiple items and settings, created by dragging a prepared object from the Hierarchy to the Project (both turn blue). The prefab in the Project can be right-clicked to Export a Package, which can be ed to project teammates.

7 Creating Basic First-Person Interaction in Unity
To begin exploring 3D interactive spaces in Unity, let’s set-up a ground, a first-person controller, and some stuff to knock around. Create a Cube for a ground: Game Object > 3D Object > Cube. In the Inspector, set height=0.2 and width and length to 30. Name it Ground. NOTE by default it has a Box Collider to block physics-enabled objects. Find Unity Package First Person Controller on the course website and download (can also get from the Unity Asset store as part of the free “Standard Assets” collection). In Unity RightClick the Project window to Import Package > Custom Package and select the FPScontroller. The FPS Controller prefab appears as well as a reduced version of the Standard Assets folder. Drag the FPS Controller into the Hierarchy and in the scene lift it above the ground Cube. In the Hierarchy select and delete “Main Camera” (we only want one camera, the one attached to FP controller). Hit the Play button to walk around with [W][A][S][D] and to move the camera with the mouse. Hit [Esc] to turn off Play.

8 Creating Basic Physics Interaction in Unity
Set the Directional Light darker: select it in the Hierarchy and in the Inspector click the color rectangle to change the color to a darker yellow, so the scene is easier to see. Create a new Cube. In the Inspector, set (a) Size = 0.5, 0.5, 0.5. (b) Name this cube “Stone” and hit [Return]. (c) Hit [Add Component] to choose Physics > RigidBody (which adds gravity and the ability to move). Drag “Stone” from Hierarchy into Project to make a Prefab (both turn blue), so copies will be instances of each other. Make many more copies of Stone to build a wall: select Stone in the Hierarchy, hit [Ctrl/Cm]+[d], and drag the copy up or over in the Scene. Hit Play and try walking into the wall. The Stones will block your way. Hit [Esc] to turn off Play. In the Project, select Stone, and in Inspector, change the RigidBody Mass value from 1 down to 0.1. Because we made the original Prefab, this changes Mass on ALL Stones. Hit Play to channel your inner Kool-Aid Man!

9 Import Textured 3D Assets from Maya into Unity 1
Exporting assets from Maya to Unity is relatively simple: In Maya, change Windows > Settings/Preferences > Preferences > Settings from Centimeters to Meters (the default units in Unity). Create a character proxy: a Cylinder from the Poly Modeling shelf set to 2 meters (units) tall. Turn on Display > Heads Up Display > Poly Count. Create textured objects using this proxy as size-reference (furniture, doorway, etc). These objects need to have a moderate polygon count: Big objects should usually stay under 1-5k triangles and small objects should stay under 100 triangles (select an object to see its poly count). These numbers should be half or less for VR. Here is a basic tree shape: In Front view, use Mesh Tools > Create Poly to draw a leafless tree-shape twice as tall as the Proxy (4 meters) with wide branches. Hit [Return] to complete. In Perp view hit Modeling Toolkit > [Extrude] and pull out a grey 3D form. Hit [w]. Hit [d] to move the pivot to the tree base. In the ChannelBox name the object “Tree”.

10 Import Textured 3D Assets from Maya into Unity 2
Add a texture to your objects: Download the TreeBark PNG. Open Windows > Rendering Editors > Hypershade. Create a Blinn material. In Properties name it Tree_m. Click the color checkered square to add a File node. Click the manila envelope icon to add the TreeBark texture. Apply the material: Select the Tree object, RightClickHold the Tree_m material in the library, choose Assign Material to Selection (top option). Hit [6] to see texture in Viewport. Select the Place2D node to increase tiling U and V to 5x5. Place Tree at world center, standing on the Pers grid. Modify > Freeze Transforms and Edit > Delete by Type > History. With just the object selected, go to File > Export Selection. Be sure format is set to FBX. Set file name Tree and locate in the same folder as the downloaded texture. Hit [Export].

11 Import Textured 3D Assets from Maya into Unity 3
In Unity, RightClick on the Project window to Import New Asset, and select BOTH the Tree FBX and texture PNG. This automatically applies the texture to the 3D object. Drag the Tree FBX into the Hierarchy. Because the Tree was located at world center in Maya with the pivot set to the bottom, the object automatically appear at world center in Unity. Drag away from your FPS Controller. Hit Play. We can walk through the tree because it has no collision applied. Hit [Esc] to turn off Play. With the Hierarchy Tree selected, in the Inspector click [Add Component] to choose Physics > Box Collider. By default, this surrounds the tree, which means we cannot pass under the branches near the trunk; the collision box block will block us. Set the Box Collider size X and Z to much smaller values to only surround the trunk (like 0.2). Hit Play to test, [Esc] to turn off Play. NOTE: We can add another Box Collider to block branches (change size and position) or chose Mesh Collider: each triangle on the mesh becomes a perfect shaped collision but with expensive performance issues . Not recommended for any object more than 100 triangles, especially in VR.

12 Making Interactive Objects in Unity 1
Make a new Cube and set physics: In Unity create a new GameObject > 3D Object > Cube. Name it Pickup. Lift it so it hovers above the ground, 1-2 meters. In the Inspector set the default box Collider to IsTrigger. Hit [Add Component] to apply Physics > RigidBody. Turn on IsKinematic. Create a new Script and open to add the provided code: RightClick the Project window to make a new C# script. Name it Rotator and hit [Return] to set the name inside the script as well (name must match inside script and on file). Drag the script onto the Pickup Cube. DoubleClick the C# script in the Project panel to open an installed coding environment, and paste the following code to replace the Update function (also available on the course site as a text file):        void Update () {               transform.Rotate (new Vector3 (15, 30, 45) * Time.deltaTime); }  Save and close the coding environment. Hit Play to see the cube rotate in the air. How would you make the cube rotate faster on the Y axis?

13 Making Interactive Objects in Unity 2
Add Audio: Download the provided Audio .WAV file, import into Unity. Drag the audio file onto Pickup. In the Inspector, under Audio Source, turn off Play on Awake. Modify the FPS Controller: Select the FPSController in the Hierarchy. In the Inspector set Tag to “Player.” [Add Component] Physics > Capsule Collider, and Set to “isTrigger”. Adjust Capsule Collider “Center” forward on Z (try 2.0). DoubleClick the Rotator script to open it again, and paste in the following below the Update function (but above the final bracket):         void OnTriggerEnter(Collider other){               if (other.gameObject.tag == "Player"){                     GetComponent<AudioSource>().Play();                     StartCoroutine(DestroyThis()); } }         IEnumerator DestroyThis(){               yield return new WaitForSeconds(0.5f);               Destroy(gameObject); }

14 Getting Animated Objects into Unity
The easiest way to import an animated object is to make something that is intended to always animate, to loop. Consider the provided wheelbarrow_broken.fbx and wood.png. In Maya the wheel is positioned by its parent Locator and then animated to spin 360 degrees, frames In Unity RightClick the Project window to import both the FBX and PNG. Drag the FBX into the Hierarchy. If we hit Play it does not animate, and we can walk through it. Select the FBX in the Project panel and choose the Animation tab in the Inspector. Change the name of the clip from take001 to Spin, click Loop Time, and hit [Apply]. In the Project panel open the wheelbarrow_broken.fbx to reveal the Spin clip.

15 Getting Animated Objects in Unity
RightClick the Project panel to create an Animator Controller, and name it AnimatorWB. DoubleClick AnimatorWB to open the Animator panel. Drag the Spin clip into the Animator panel to make it the default animation state (turns orange, gets a transition arrow from “Entry” node). Finally, select the wheelbarrow in the Hierarchy. Drag AnimatorWB onto it from the Project. Hit Play to see the wheelbarrow animate!

16 Game Environment Art: 360 Degrees of Awesome
3D Environment Art for Games and Film differ in one critical way that gives rise to many other differences: In a 3D Film we know where the camera is going to look and make just that shot the exact composition we want. In a 3D Game the player can look in any direction, however long they want. The time they spend looking needs to be rewarded. 3D Game Art therefore needs to be (1) interesting in every direction and (2) visually navigate-able.

17 Game Environment Art: Layers and Contrast
Interesting scenery includes: Spaces that are Layered with Dynamic and Contrasting Forms and Surfaces (materials). Layering assets means having a small interactive area surrounded by a wider non-playable area. Each is filled by forms with good positive/ negative shapes that allow us to see around them to what lies beyond. The player wants to see over shorter buildings, through archways and scaffolding, explore into crevices, around lamp-poles, police boxes, and burning wreckage. They want cover and the excitement of discovery. Build with contrasting forms and textures: wide vs thin forms, short/tall, sharp/curved, stone/metal, wood/plastic, glass/cloth.

18 Game Environment Art: Visually Navigate-able
Visually Navigate-able is about helping the player to parse (break-down, understand) the playable area so they feel able to move around it and find what they want, especially to be able to find exits and to return to a place they have been. Theme parks like Disneyland have made a study of helping users navigate large and intense spaces: create a unique tower that can be seen from most locations (called a “weenie”). Make the sides of a playable area include regions with different materials and colors. Light can be used to obscure what is inessential and highlight where we want players to go. Motion and light will attract the user to that area.

19 Prep a copy of your scene assets for VR next week!
Next week we plan to import your assets into Unity to display in VR using the HTC VIVE. Download the sample VR room file provided on the course site. This scene is set to Meters and the objects within are sized to work well in VR. If they are exported together in these locations, they will appear in Unity in the same relative positions. Import your scene into this file to see if your objects are the right size to view in the VIVE. When they are the correct size, hide the Room display layer. Select all of your meshes to Edit > Delete By Type > History and Modify > Freeze Transforms. Finally, File > Export Selection as a single FBX. For next week, in addition to revision progress on your film, please submit a zipped folder called YourName_VRtest including: a Maya file with a copy of your film setting An FBX containing all of your film setting objects All of your film setting textures


Download ppt "Advanced 3D Art and Animation"

Similar presentations


Ads by Google