Return to Video

BTVehicle Tutorial: Part 1 (BTVehicle and Joints setup)

  • 0:00 - 0:47
    Hi to everyone. Lets look at the final result of this tutorial. I did a few previews to demonstrate the potential of this setup.
  • 0:48 - 1:25
    let's see how things work here. We can see several dynamic sets. The names of these sets speak for themselves. CarLowSim set does simulation of low poly vehicle (body+wheels+doors), CarDeform deforms car hull, CarGlass breaks the glass parts, CarPartsAttach attaches hi poly parts to low poly proxies, CarGhosts and CarTraj helps to visualize the simulation process.
  • 1:26 - 1:35
    I wired out some contols for covenience. We can turn on/off main dynamic sets, also have vehicle controls (speed, steering), also we can control when doors are allowed to open and detach, glass breaking timing and size of glass pieces.
  • 1:36 - 2:54
    Lets run the low poly vehicle sim. As you can notice it's almost realtime simulation (there is no baked cache). Lets turn on CarGhosts set to see better car behavior then tume vehicle parameters (speed and steering for example) and have an instant feedback.
  • 2:56 - 4:21
    To set initial car position we have a some root helper - just drag it anywhere you want. Lets set different initial position for the car to get more short sim. I'm trying different initial positions for the root helper to get more interesting sim pattern.
  • 4:23 - 5:36
    Ok, let us assume that this simulation is fine (actually it's not but let's pretend). Before turning on CarDeform and CarGlass sets we have to define some events times (door open frame, glass break frame, etc) corresponding to the current simulation.
  • 5:37 - 7:44
    Car hits the ground at 59 frame so lets set DoorOpen frame, MirrosDetach frame and GlassBreak frame to 59. Doors timing is affecting to car sim too much (probably I have to reduce their mass). Now sim is too boring. I'm trying to improve it by tweaking initial car position. No success, lets leave it as it is.
  • 7:46 - 8:11
    Now I want to detach right door at 110 frame so set DoorRDetach to 110. Ok, it's working.
  • 8:14 - 8:56
    Lets turn on CarDeform, CarGlass and CarParts sets and do the preview. I prefer to disable Show Mesh option of CarLow groups because hi poly parts will be displayed instead.
  • 8:58 - 10:04
    Finally lets do the preview. Ok, something is wrong - skinned hi poly car hull isn't moving. That's because SkinWrap modifier is buggy - sometimes you have to re-pick the control objects after opening the scene. Lets do this. Nasty bug but I can live with it - I can bake hull deformation to Point Cache or XMesh after all.
  • 10:05 - 11:11
    Attempt number two. It's not a real time now but it's acceptable sim time. At GlassBreak frame we have slowdown because VolumeBreaker creates glass fragments. Also we can see that GlassBreak frame is wrong because car sim has slightly changed. Now I'm going to pause recording, do some tweaks and do the preview.
  • 11:13 - 11:48
    Here it is. It takes about 4 minutes. Of course this deformations are fake. For true, physically correct metal deformations we have to use different methods. But it's fast and looks ok (for long distance shots at least).
  • 11:50 - 12:18
    Now lets talk about BTVehicle and how to live with it. Everybody knows that in TP5 we have ready car rig for bullet physics called BTVehicle.
  • 12:19 - 12:36
    Obviously we need to pick some objects in a scene to use them as vehicle. Lets see how these objects should be linked and organized.
  • 12:38 - 13:47
    We see some CarRoot point helper which is control initial car position and alignment. Also we have some dummies which are used to set joints positions and alignment (we will use hinge joints for doors so joint alignment is importain). These Joint dummies (they are not a TP helpers, just regular 3ds max dummies) are linked to CarRoot point helper. Low poly doors are linked to these Joint dummies.
  • 13:49 - 14:10
    Most important thing - we have a CarBody linked to the main CarRoot point helper. And we have a low poly CarWheels which are linked to CarBody. NOTHING EXCEPT WHEELS MUST BE LINKED TO CAR BODY. Any object in hierarchy below CarBody will be considered as a wheel (even if it's connected via helper).
  • 14:12 - 15:01
    We need to pick for BTVehicle only ONE object - Car Body. BTVehicle op analyze objects linked to Car Body and consider them as a wheels.
  • 15:02 - 15:24
    Dont forget to reset XForm to all car parts.
  • 15:25 - 18:09
    So lets try to pick our Car Body and do some simple vehicle sim. I already created some groups for low poly car sim. Create new dynamic set and create BTVehicle op in it. Pick CarBody object. Lets create gravity force affecting on CarLow group. Obviously we need a BulletPhysics operator so create one and pick floor node for it.
  • 18:10 - 19:33
    Lets try to run the sim. Nothing. That's because we forgot to define groups for car body and wheels in BTVehicle op. Still nothing. We forgot to define BulletPhysics operator in BTVehicle. Alsow we forgot to turn on Show Mesh option for CarBody and CarWheels groups.
  • 19:34 - 20:20
    Something is going on. Something strange - distance between car body and wheels is too big. Than's because suspension length in BTVehicle op is too big. This parameter in real scene units so be careful with objects scale (I wasn't so I have very small car:)). Lets set suspension Length corresponding to the car scale.
  • 20:21 - 21:18
    At last it's working as it should. Also I forgot to say when you are creating new particle group for Bullet sim don't forget to hit button "Create Parameter" (this button is appear only if you have BulletPhysics operator in your system). It's classic newbie question "Why Bullet doesn't work?" Answer: Because you forgot to create parameter in Bullet rollout in particle group properties.
  • 21:19 - 22:55
    Let's take a look at the options of BTVehicle. Most of the settings (like Mass, Speed, Steer, Suspension Length and Stiffness) are self-explanatory. Actually I'm not a great expert in Bullet so I recommend you to read help about all these parameters. Lets play with Speed and Steer parameters.
  • 22:56 - 24:02
    Sometimes car wheels penetrate through the ground. There is a special note in help about this issue. Also sometimes you need to increase Iteration parameter in BulletPhysics op for more precise sim.
  • 24:03 - 24:21
    Now lets talk about joints and how to attach doors to car body.
  • 24:22 - 25:33
    Lets attach the right door for example. Put door object in to TP using ObjectToParticle op and do this in the same set where BTVehicle - later I'll explain why.
  • 25:34 - 26:10
    Ok, now we have DoorR particle and we need to create joint between it and CarBody particle (important - we have ONLY CarBody particle at the BornParticle* output of BTVehicle op).
  • 26:11 - 27:31
    Create BTJoint operator and feed to ParticleFrom and ParticleTo inputs DoorR and CarBody particles respectively. Set joint type to "hinge ". We need to define world position and world alignment for this joint. Create Node helper, pick Joint dummy and feed position and alignment to BTJoint op.
  • 27:32 - 28:19
    Run the sim. Looks like joint doesn't work at all - вoor simply falls to the ground. Why this happened? Answer: you cant use two initiator or generator (BTVehicle is obviously generator - it creates new particles) operators in one flow without synchronization. We have to synchronize them somehow.
  • 28:20 - 28:35
    We can do this if we turn on one generator operator by the other - it's like a chain reaction. Connect BornParticle* output of BTVehicle to ON input of ObjectToParticle op.
  • 28:36 - 29:09
    Yep, it's working. Next question - how to control this joint? How to set angle limits for example? Because now it can rotate by 180 degrees - that is not right, car door not behave in this way, they have constraints.
  • 29:10 - 29:54
    Now I'll try to set initial position of the car to demonstrate this problem.
  • 29:55 - 30:38
    At last I did it. Also we can see some weird shit is happening when door hits the wheel. Definitely we need to limit maximum allowed rotation angle.
  • 30:39 - 33:16
    Create new set called BTJointData (of course you can name it as you want). We need to get joints to manipulate them. Bring joints using BTJointCounter operator. Now we have to make sure that we will control specific joint (which is connect DoorR to CarBody) - because there will be more than one joint in the system. So we have to get ParticleFrom info from joints. Do this by BTJointData operator and make ParticleFrom out visible.
  • 33:17 - 34:16
    So now we have check particle group. Feed ParticleFrom output to Group condition (which is set to DoorR). Next we have to set angle limits for specific joint by using BTJointData again (connect output of Group condition to ON input of BTJointData - that's why we are sure in specific joint). We are interested in LimitLowerAngle and LimitUpperAngle parameters. Angles are in radians so 3,14 (Pi) = 180 degrees.
  • 34:17 - 35:27
    Set angles by Float helpers. Set LimitLowerAngle = 0 and LimitUpperAngle = 1 (it's 57,4 degrees)
  • 35:27 - 38:36
    Next task - I want to keep door closed until certain moment (moment of impact for example). To do this we need to switch UpperAngle value from 0 to 1 (for example) after some frame. To switch values we can use XtoOne helper and TimeInterval condition.
  • 38:37 - 39:13
    Set DoorOpenFrame to 60 and see what will happen. Looks like nothing. That's becaise we need to steer in to opposite direction to see how door opens.
  • 39:15 - 39:36
    Ok, it's working. Next task - I want to break this joint at some moment.
  • 39:37 - 41:54
    That's easy. Obviously we need another BTJointData op and TimeInterval condition. Feed Bool helper (Bool is set to 1) to Broken input of BTJointData op and turn ON it by Group AND TimeInterval conditions.
  • 41:55 - 42:07
    Set DoorDetachFrame to 170. Everything is working fine.
  • 42:08 - 43:23
    That's all folks) In the next part we will destroy whole thing) Thanks for watching)
Title:
BTVehicle Tutorial: Part 1 (BTVehicle and Joints setup)
Description:

more » « less
Video Language:
Russian
Duration:
43:26

English subtitles

Incomplete

Revisions