Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:01,080 --> 00:00:09,540
Now that we have our animation exported properly we need to go ahead and put that into our ReACT application.
2
00:00:09,600 --> 00:00:16,740
The Jace ON THE BODY MOVE IN exported though actually needs a little bit of tweaking before we can bring
3
00:00:16,740 --> 00:00:18,390
it into our application.
4
00:00:18,390 --> 00:00:24,330
So I'm going to start by walking us through that and then we'll get into actually bringing it into our
5
00:00:24,330 --> 00:00:25,260
code.
6
00:00:25,260 --> 00:00:31,680
But if you had skipped the last video covering all of the body moving stuff you can go ahead and skip
7
00:00:31,680 --> 00:00:38,220
this video as well because we're just tweaking some of the files that were exported from body moving
8
00:00:38,280 --> 00:00:44,370
but in the next video when we go ahead and bring those files into our project we'll just be using files
9
00:00:44,400 --> 00:00:50,430
from the Project 1 files that you had downloaded and they will already be set up correctly so you can
10
00:00:50,430 --> 00:00:55,770
go ahead and skip to the next video if you don't want to go through this configuration and you won't
11
00:00:55,770 --> 00:00:56,690
have to worry.
12
00:00:56,790 --> 00:01:01,830
But otherwise we'll go ahead and get started by tweaking that animation data.
13
00:01:01,830 --> 00:01:09,290
Just a little bit so here on the desktop is where I had exported that animation data.
14
00:01:09,290 --> 00:01:16,190
So I'm gonna go ahead and select that Jason File and I'm going to open that with Adam so that'll open
15
00:01:16,190 --> 00:01:17,600
up in the code editor.
16
00:01:17,780 --> 00:01:24,470
And here it's nicely formatted and if yours isn't try saving it real quick if you have the prettier
17
00:01:24,470 --> 00:01:27,480
setting to refactor your code on save.
18
00:01:27,590 --> 00:01:32,540
And that should make it look better for you and that will make this a little bit easier if you don't
19
00:01:32,540 --> 00:01:33,920
have it looking like this.
20
00:01:34,010 --> 00:01:40,900
Go and look for the assets property and the array of images inside of there.
21
00:01:40,910 --> 00:01:44,300
And that is the important part that we're going to tweak.
22
00:01:44,300 --> 00:01:51,710
Now here is where it is referencing the images that were also exported that contain the different layers
23
00:01:51,710 --> 00:01:53,990
of the animation.
24
00:01:54,000 --> 00:02:01,680
The problem with how this is set up however is that all of the images for all of the animations they
25
00:02:01,680 --> 00:02:08,400
all start at 0 1 2 3 4 and so on for all the different animations.
26
00:02:08,400 --> 00:02:16,260
And so if all of the data files are referencing the 0 1 2 and 3 files well then you can see how it would
27
00:02:16,260 --> 00:02:17,210
get confusing.
28
00:02:17,220 --> 00:02:20,060
And that's obviously why it wouldn't work.
29
00:02:20,100 --> 00:02:25,440
They also are looking for the images at a images U.R.L..
30
00:02:25,440 --> 00:02:33,390
And so the solution that I found for production is that people were hosting in images folder in the
31
00:02:33,420 --> 00:02:38,530
public directory and then referencing the images from there within their code.
32
00:02:38,580 --> 00:02:40,190
But I didn't really like that.
33
00:02:40,200 --> 00:02:45,050
So I kept searching and I found a better solution that I think works a lot better.
34
00:02:46,130 --> 00:02:52,850
We'll start by and go ahead and select all of this code and we'll copy that and then let's start and
35
00:02:52,850 --> 00:02:56,810
create a new file and let's save this real quick.
36
00:02:56,810 --> 00:03:03,350
And I'm actually going to put it on the desktop where the data dot Jason File is and we'll name this
37
00:03:03,350 --> 00:03:06,050
data dot J Yes.
38
00:03:06,320 --> 00:03:08,180
So we'll save that.
39
00:03:08,250 --> 00:03:14,150
And now let's start at the top by importing react from react.
40
00:03:14,150 --> 00:03:23,630
And then underneath the import statement for react let's go ahead and we'll import Image 0 from da slash
41
00:03:24,020 --> 00:03:37,810
images image 0 import Image 1 from dot slash images image 1 import Image 2.
42
00:03:38,060 --> 00:03:42,230
We're just going to do this for all of them image to
43
00:03:45,730 --> 00:03:49,380
improve three
44
00:04:03,270 --> 00:04:04,550
and image four.
45
00:04:04,650 --> 00:04:08,070
OK so we have all of the images loaded in now.
46
00:04:08,400 --> 00:04:11,550
And I keep doing that and it will come down.
47
00:04:11,550 --> 00:04:19,470
And now we will export defaults and then just paste in all of that J song that we had copied.
48
00:04:19,470 --> 00:04:22,450
So we'll scroll back up to the top of this.
49
00:04:22,590 --> 00:04:32,130
And now where it has the image property in this array for all of the U R L's and the paths we're now
50
00:04:32,130 --> 00:04:36,450
going to change it to just reference these images right here.
51
00:04:36,450 --> 00:04:41,120
So now there actually is not a U.R.L. that we're going to be specifying.
52
00:04:41,160 --> 00:04:45,320
So the U R L you can actually just make an empty string.
53
00:04:45,510 --> 00:04:49,550
So go ahead and we'll do that for all of these images.
54
00:04:49,680 --> 00:04:51,080
We will just get rid of that.
55
00:04:51,100 --> 00:04:57,980
Make nice empty string and make sure you just change those top ones.
56
00:04:57,990 --> 00:04:58,890
That's it.
57
00:04:58,890 --> 00:05:03,210
So change all of those EU properties to the empty string.
58
00:05:03,210 --> 00:05:07,950
And now for the P property which specifies the image itself.
59
00:05:07,950 --> 00:05:14,820
Let's go ahead and replace that string entirely with the image zero that we have imported and we'll
60
00:05:14,820 --> 00:05:16,770
do the same for each of these.
61
00:05:16,900 --> 00:05:20,270
Image 1 2
62
00:05:22,970 --> 00:05:24,590
3 3
63
00:05:27,930 --> 00:05:29,060
and 4.
64
00:05:29,130 --> 00:05:37,230
And now if we save this you would now be able to import this and use it directly without having to worry
65
00:05:37,230 --> 00:05:42,330
about whether or not the images are going to be properly included because they're just going to be bundled
66
00:05:42,570 --> 00:05:44,780
within this javascript file.
67
00:05:44,790 --> 00:05:51,270
So this was a really nice solution and there I had found online and you can see if we go into the animations
68
00:05:51,270 --> 00:05:57,360
folder that we had set up out of the project one files we can open this up and you'll see all of these
69
00:05:57,390 --> 00:05:58,660
other little folders.
70
00:05:58,740 --> 00:06:05,490
So save for the landing animation inside this folder you now see the data dot J.S. file like we had
71
00:06:05,490 --> 00:06:12,300
just created the data dot Jason File which was exported by body move in and all of the images that were
72
00:06:12,300 --> 00:06:18,980
exported by body move in as well here I actually got rid of the images folder and just put all of the
73
00:06:18,980 --> 00:06:27,030
images in the same folder so that the data dot J.S. simply imports the images and exports the Jason.
74
00:06:27,110 --> 00:06:33,890
And it actually looks like here I'm not even importing react so I think I don't even need that.
75
00:06:33,920 --> 00:06:39,320
And so we could go ahead get rid of the import react and now it would still work because this is just
76
00:06:39,680 --> 00:06:41,350
plain javascript.
77
00:06:41,600 --> 00:06:48,560
So we'll just be referencing the data files out of the each of these animation folders which have all
78
00:06:48,560 --> 00:06:50,610
already been set up correctly.
79
00:06:50,630 --> 00:06:52,490
So we won't have to worry about that.
80
00:06:52,490 --> 00:06:57,520
We can close out of those and you can go ahead and delete the data.
81
00:06:57,560 --> 00:07:05,420
Jason the images and the data J.S. files that we had just been working with from wherever you had exported
82
00:07:05,420 --> 00:07:12,050
them to so I'm going to go ahead and get rid of those and now we are ready to begin bringing the animation
83
00:07:12,050 --> 00:07:13,340
into the application.
8658
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.