PiBoSo Official Forum

GP Bikes => Mods => Topic started by: RiccoChicco on April 15, 2016, 05:27:42 PM

Title: [HOW-TO] Animate the chain
Post by: RiccoChicco on April 15, 2016, 05:27:42 PM
All of the credits go to JC#21, which made this tutorial in french at motonline-france.com (http://motonline-france.com).

All images are available at full size by clicking it


Part I - Pivot positionning

- Select your chain object
- Go to "Hierarchy"
- Affect to pivot only
- Move the pivot at (0,0,0)
- Be sure to have the axis in the correct directions



(http://img11.hostingpics.net/pics/1499868hh6.png)


Part II - Gearbox output

- Create an object (a sphere is perfect for that)
- Move it to the middle of the gearbox side of the chain using the left view
- The values we'll be using in the gfx.cfg appear at the bottom of 3ds Max

(http://img11.hostingpics.net/pics/626046xvby.png)

Part III - GFX file

- Open your gfx.cfg
- Go to the chain section


chain
{
name = chain
pos
{
x = -63.175
y = 0
z = -10.107
}
engine
{
x = 0.0
y = 0.0
z = 0.00
}
texture = chain
axis = v-
ratio = 0.016666
}


- The values in the "pos" section are the one which need to be changed. (values from 3ds Max)

Note : GP-Bikes and 3ds Max are not using the same axis. Check the previous picture to see how to choose the values.

Here's the corespondences between both :



GPbikes   3ds Max
   X     =    -Y
   Y     =     X
   Z     =    -Z


Part IV - Adjustments

With what we've done here, you should already be able to see a rotating chain ingame. The thing is that it's probably not well positionned. We'll see how to put it in the correct position.

Ingame screenshot :

(http://img11.hostingpics.net/pics/1579031l7x.jpg)

In 3ds Max :

(http://img11.hostingpics.net/pics/3428689v5a.png)

We can see that we need to rotate a bit the chain.

- Rotate de chain arround its axis on the rear wheel.
- Move the sphere we've created before at the correct position compared to the ingame screenshot.
- Update the values in the gfx.cfg.


(http://img11.hostingpics.net/pics/824331ei2c.png)
Part V - Results

Now we've got a beauriful ingame chain, which rotate perfectly!

(http://img11.hostingpics.net/pics/956112px9x.jpg)

Part VI - Possible bugs

If the chain doesn't rotate in the correct direction, it should come from the unwrapping. Just edit the UVW unwrap, by mirroring it. It should works!

Title: Re: [HOW-TO] Animate the chain
Post by: h106frp on April 15, 2016, 06:21:33 PM
Brilliant, could you add a note for the correct method of UV mapping/texturing the chain?
Title: Re: [HOW-TO] Animate the chain
Post by: Blackheart on April 15, 2016, 06:37:02 PM
My chain is "complex" so I just made a occlusion map and painted it (provisionally gold) with shader i think will be good.

Title: Re: [HOW-TO] Animate the chain
Post by: RiccoChicco on April 15, 2016, 07:12:59 PM
Quote from: h106frp on April 15, 2016, 06:21:33 PM
Brilliant, could you add a note for the correct method of UV mapping/texturing the chain?

Well, it depends on your model. I can't provide an exact method. Just unwrap your chain as you want and if it's in the wrong direction, mirror it  :)

@Blackheart

I received your files and I'll take a look tonight . But in your case, it's not the texture that needs to rotate, but the chain object. Not sure how to make it yet since I always used simple chains but maybe I can figure it out  8)
Title: Re: [HOW-TO] Animate the chain
Post by: Blackheart on April 15, 2016, 07:18:10 PM
Ty Ricco, i can make also a simple chain, this was just a experiment. Now my chain link is far from the bike lol Surely I put a wrong value somewhere  ;D

P.S. I hate the chains!  :-X
Title: Re: [HOW-TO] Animate the chain
Post by: Hawk on April 15, 2016, 08:10:29 PM
This is a great job Ricco! Thank you mate!  ;D 8)

@WALKEN/JANAU: Could you make this thread a STICKY please so that it doesn't get lost in the forum posts. Thank you!  ;) 8)

Hawk
PS: You can Delete my post if you like to help keep this thread clean when it's been Stickied.  ;)
Title: Re: [HOW-TO] Animate the chain
Post by: Blackheart on April 16, 2016, 07:41:58 AM
Maybe I understand what is my problem with the chain; i make a new and very simple chain with a temp texture. The texture anim works, but the chain it is too close to the gear, for gpb chain and gear are 2 parts welded together!  :-\

Here a video, solutions?  ;D

https://www.youtube.com/v/b7dDDVum7y0
Title: Re: [HOW-TO] Animate the chain
Post by: HornetMaX on April 16, 2016, 09:12:20 AM
Quote from: RiccoChicco on April 15, 2016, 07:12:59 PM
@Blackheart

I received your files and I'll take a look tonight . But in your case, it's not the texture that needs to rotate, but the chain object. Not sure how to make it yet since I always used simple chains but maybe I can figure it out  8)
I don't think it's possible to do this (have the 3d model "rotate" like in real life).
Title: Re: [HOW-TO] Animate the chain
Post by: h106frp on April 16, 2016, 09:15:43 AM
Looking at the config files chain should a separate named object in 'chassis' to let its texture rotate on its local axis. Notes axis V as in UVW
Title: Re: [HOW-TO] Animate the chain
Post by: Blackheart on April 16, 2016, 09:23:49 AM
Quote from: h106frp on April 16, 2016, 09:15:43 AM
Looking at the config files chain should a separate named object in 'chassis' to let its texture rotate on its local axis. Notes axis V as in UVW

I thought for test insert it in the chassis scene, but also in the JC/Ricco tutorial refers to the rear wheel scene as my model :-\
Title: Re: [HOW-TO] Animate the chain
Post by: h106frp on April 16, 2016, 10:31:53 AM
Quote from: Blackheart on April 16, 2016, 09:23:49 AM
Quote from: h106frp on April 16, 2016, 09:15:43 AM
Looking at the config files chain should a separate named object in 'chassis' to let its texture rotate on its local axis. Notes axis V as in UVW

I thought for test insert it in the chassis scene, but also in the JC/Ricco tutorial refers to the rear wheel scene as my model :-\

In the std gfx.cfg it is referenced in the chassis section as an object and texture 'nchain' and you will need to see how your example models declare their structure in gfx.cfg. If we apply similar logic as we have for the rest of the models in gfx.cfg then it might be easier to create a new model edf just for the chain and declare that. I will give it a try later on, i have avoided tacking the chain up to now  ;)

Creating a separate .edf does not work  :( I will try it on the chassis, then swingarm (rsusp) - makes more sense as it will track the angular position correctly
Title: Re: [HOW-TO] Animate the chain
Post by: Blackheart on April 16, 2016, 11:18:06 AM
Maybe i've a idea... after the sbk i try  :P
Title: Re: [HOW-TO] Animate the chain
Post by: doubledragoncc on April 16, 2016, 11:20:26 AM
Manu has the chain done if I am correct, why not ask him BH?

DD
Title: Re: [HOW-TO] Animate the chain
Post by: Blackheart on April 16, 2016, 11:42:10 AM
Well I think it is more useful a thread on the forum that pm between modders  :P
Title: Re: [HOW-TO] Animate the chain
Post by: doubledragoncc on April 16, 2016, 11:50:10 AM
Very true BH and kind of you to do so, but you could invite Manu to the party?

DD
Title: Re: [HOW-TO] Animate the chain
Post by: Hawk on April 16, 2016, 12:06:30 PM
Quote from: doubledragoncc on April 16, 2016, 11:50:10 AM
Very true BH and kind of you to do so, but you could invite Manu to the party?

DD
+1
It's always great to be asked to a party! LETS PARTY MANU!! Woohoo!! ;D  ;D

Hawk.
Title: Re: [HOW-TO] Animate the chain
Post by: Blackheart on April 17, 2016, 06:27:49 AM
I send to Manu a pm.

Anyway I have not found a solution, it's a shame, because today I had free time.
Title: Re: [HOW-TO] Animate the chain
Post by: doubledragoncc on April 17, 2016, 07:35:04 AM
Well your intentions where good but I am sure Manu will help, he's a cool dude.

best of luck on it.

Wheres the start of the 900 lol

DD
Title: Re: [HOW-TO] Animate the chain
Post by: Blackheart on April 17, 2016, 08:33:43 AM
Lol the next will be a small bike  ;D

Crossing my fingers the chain problem is solved, (I have not yet talked with Manu) if i put the chain in the rear susp scene finally it works.  ;D
Title: Re: [HOW-TO] Animate the chain
Post by: doubledragoncc on April 17, 2016, 08:52:01 AM
The chain thing is great news...............................

Small bike?.......................

I am gonna tell my mummy you wont build me a 900RR and she will come and beat your mummy up and then your mummy will spank your botty!!!

DD
Title: Re: [HOW-TO] Animate the chain
Post by: h106frp on April 17, 2016, 09:28:40 PM
Quote from: Blackheart on April 17, 2016, 08:33:43 AM
Lol the next will be a small bike  ;D

Crossing my fingers the chain problem is solved, (I have not yet talked with Manu) if i put the chain in the rear susp scene finally it works.  ;D

Do you have it animated?

I think i have it mapped correctly now but i cannot animate  :( Did you have to change anything in gfx.cfg?
Title: Re: [HOW-TO] Animate the chain
Post by: Blackheart on April 17, 2016, 09:41:06 PM
Quote from: h106frp on April 17, 2016, 09:28:40 PM
Quote from: Blackheart on April 17, 2016, 08:33:43 AM
Lol the next will be a small bike  ;D

Crossing my fingers the chain problem is solved, (I have not yet talked with Manu) if i put the chain in the rear susp scene finally it works.  ;D

Do you have it animated?

I think i have it mapped correctly now but i cannot animate  :( Did you have to change anything in gfx.cfg?

Same problem here, no anim -.-

Damn i I fixed a problem and now a new one  ;D

I changed my gfx many times, I'm waiting  that Ricco sending me a chain for new tests, maybe mine is wrong.
Title: Re: [HOW-TO] Animate the chain
Post by: h106frp on April 30, 2016, 09:44:23 PM
Okay, a lot of trial and error and numerous comedy chains later and i have got as far as a true running chain that animates  with a few issues :)

https://www.youtube.com/v/nr1QceBfkPY

Worked out why the tutorial would not work for me with the chain in the rear wheel scene, local axes for the chain needed to be Y for the rotation axes, Z up, X front to rear for Blender and its exporter (curiously the same as the spinning clutch).

Worked out that BikeED observes the co-ords for chain>pos>x,y,z (spin the chain link tag :)  ) and got that all sorted with chain link and the chain tracking correctly and the chain staying on both front and rear sprockets with the rear suspension tested through its full arc.

In game i cannot get the front sprocket to track though so it must be something to do with chain>engine>x,y,z which do not seem to do anything in BikeED. Anybody know exactly what these co-ords relate to?

Not sure why, when it works OK in BikeEd the game engine should make it more complex  ???
Title: Re: [HOW-TO] Animate the chain
Post by: Manu on September 12, 2017, 04:38:27 PM
This method is too far-fetched. Mine is much more faster and easier.

Really everything all you need is on bikeed and the result is perfect.