LGT(Leo's Games Tools)

General => Random => Topic started by: Ivan Enzhaev on November 26, 2019, 03:10:19 pm


Title: Plugin for importing bones and animations to Blender from .anim (RE1MV)
Post by: Ivan Enzhaev on November 26, 2019, 03:10:19 pm
Hello, Guys

I need this plugin. I want to export bone hierarchy and animations animations from Blender to .dae (Collada). I will write my 3D Engine for Resident Evil with Sockets (for coop mode). It will be a browser demo in pure WebGL 1.0 and TypeScript. I will write a server using Node.js, SocketIO, MySQL and TypeScript. Maybe I need to write this plugin by myself.

But now I need a help to understand the .anim format that is created by RE1MV (http://lgt.createaforum.com/new-board-17/emdviewer-a-tool-to-edit-emd-files/). Could someone to explain this file format?

CHAR11_01.ANI

Code: [Select]
15
4 1 2 9 12
0
2 3 6
1 4
1 5
0
1 7
1 8
0
1 10
1 11
0
1 13
1 14
0
0.000 0.000 32.260
0.000 -0.380 12.340
0.000 0.000 0.000
-3.320 -0.440 -3.980
0.200 -0.200 -12.040
0.040 -0.400 -16.160
2.700 -0.440 -3.980
0.020 -0.400 -12.060
0.040 -0.200 -16.160
-5.520 -0.700 11.500
-1.280 -0.140 -8.440
-1.080 0.280 -7.760
5.300 -0.720 11.280
1.320 0.000 -7.980
0.880 0.260 -7.160
25
-0.020 0.000 33.640
-0.791 -0.615 0.703
5.187 -8.615 -1.143
-5.978 8.352 -0.879
12.571 47.297 2.813
72.703 -13.363 -63.385
-25.407 23.209 -12.308
1.670 13.011 -14.330
-7.912 -2.989 0.352
18.198 -14.154 -4.220
0.000 0.352 14.681
-4.571 2.374 -0.176
16.527 -7.560 -2.110
-16.088 -1.582 -1.231
-18.989 -17.495 0.527
3.692 6.681 0.000
-0.020 0.000 33.620
-0.879 -0.527 0.703
4.923 -8.791 -1.055
-5.978 8.352 -0.879
12.571 48.088 3.165
74.637 -11.604 -63.473
-25.758 22.769 -12.308
1.846 13.099 -14.418
-7.736 -2.989 0.352
18.198 -14.505 -4.308
0.088 0.440 14.857
-4.659 2.374 -0.176
16.791 -7.824 -2.198
-16.264 -1.495 -1.319
-19.165 -17.846 0.615
3.780 6.857 0.000
-0.020 0.000 33.580
-0.967 -0.264 0.703
4.835 -8.879 -1.055
-5.978 8.352 -0.879
12.659 48.703 3.429
76.220 -10.198 -63.560
-26.022 22.505 -12.220
2.022 13.187 -14.505
-7.473 -2.989 0.352
18.198 -14.681 -4.396
0.264 0.440 15.033
-4.747 2.374 -0.264
16.967 -8.088 -2.286
-16.440 -1.407 -1.319
-19.341 -18.110 0.703
3.780 6.945 0.000
-0.020 0.000 33.560
-1.055 0.000 0.703
4.659 -8.879 -1.055
-6.066 8.352 -0.879
12.659 49.231 3.604
77.538 -8.967 -63.560
-26.198 22.242 -12.220
2.198 13.187 -14.505
-7.385 -2.989 0.352
18.198 -14.945 -4.484
0.352 0.440 15.121
-4.835 2.374 -0.264
17.143 -8.264 -2.374
-16.615 -1.407 -1.319
-19.429 -18.374 0.703
3.868 7.121 0.000
-0.020 0.000 33.540
-1.055 0.176 0.703
4.571 -8.967 -1.055
-6.066 8.440 -0.879
12.747 49.670 3.780
78.593 -8.088 -63.560
-26.374 22.066 -12.132
2.286 13.275 -14.593
-7.209 -2.989 0.264
18.110 -15.033 -4.484
0.440 0.440 15.209
-4.923 2.374 -0.264
17.231 -8.352 -2.462
-16.703 -1.319 -1.407
-19.516 -18.549 0.791
3.868 7.121 0.000
-0.020 0.000 33.520
-1.055 0.440 0.703
4.484 -9.055 -1.055
-6.066 8.440 -0.879
12.747 49.934 3.956
79.297 -7.385 -63.560
-26.462 21.890 -12.132
2.374 13.275 -14.593
-7.121 -2.989 0.264
18.110 -15.121 -4.571
0.527 0.440 15.297
-4.923 2.374 -0.264
17.319 -8.440 -2.462
-16.791 -1.319 -1.407
-19.604 -18.725 0.791
3.956 7.209 0.000
-0.020 0.000 33.520
-0.967 0.527 0.703
4.484 -9.055 -1.055
-6.066 8.440 -0.879
12.747 50.110 4.044
79.736 -7.033 -63.560
-26.549 21.802 -12.132
2.374 13.275 -14.593
-7.121 -2.989 0.264
18.110 -15.209 -4.571
0.527 0.440 15.297
-4.923 2.374 -0.264
17.319 -8.527 -2.549
-16.791 -1.319 -1.407
-19.692 -18.813 0.791
3.956 7.209 0.000
-0.020 0.000 33.520
-0.967 0.352 0.703
4.484 -9.055 -1.055
-6.066 8.440 -0.879
12.747 50.198 4.044
80.000 -6.857 -63.560
-26.549 21.802 -12.132
2.374 13.275 -14.593
-7.033 -2.989 0.264
18.110 -15.209 -4.571
0.527 0.440 15.297
-4.923 2.374 -0.264
17.407 -8.527 -2.549
-16.791 -1.319 -1.407
-19.692 -18.813 0.791
3.956 7.209 0.000
-0.020 0.000 33.520
-0.967 0.000 0.703
4.484 -9.055 -1.055
-6.066 8.440 -0.879
12.747 50.198 4.044
79.912 -6.857 -63.560
-26.549 21.802 -12.132
2.374 13.275 -14.593
-7.121 -2.989 0.264
18.110 -15.209 -4.571
0.527 0.440 15.297
-4.923 2.374 -0.264
17.407 -8.527 -2.549
-16.791 -1.319 -1.407
-19.692 -18.813 0.791
3.956 7.209 0.000
-0.020 0.000 33.520
-0.967 -0.879 0.703
4.484 -9.055 -1.055
-6.066 8.440 -0.879
12.747 50.110 3.956
79.648 -7.121 -63.560
-26.549 21.890 -12.132
2.374 13.275 -14.593
-7.121 -2.989 0.264
18.110 -15.209 -4.571
0.527 0.440 15.297
-4.923 2.374 -0.264
17.319 -8.527 -2.549
-16.791 -1.319 -1.407
-19.604 -18.725 0.791
3.956 7.209 0.000
-0.020 0.000 33.540
-0.879 -3.341 0.791
4.484 -8.967 -1.055
-6.066 8.440 -0.879
12.747 49.934 3.956
79.297 -7.473 -63.560
-26.462 21.890 -12.132
2.374 13.275 -14.593
-7.121 -2.989 0.264
18.110 -15.121 -4.571
0.527 0.440 15.297
-4.923 2.374 -0.264
17.319 -8.440 -2.462
-16.791 -1.319 -1.407
-19.604 -18.725 0.791
3.956 7.209 0.000
-0.020 0.000 33.540
-0.791 -7.473 0.791
4.571 -8.967 -1.055
-6.066 8.440 -0.879
12.747 49.758 3.868
78.681 -7.912 -63.560
-26.374 22.066 -12.132
2.286 13.275 -14.593
-7.209 -2.989 0.264
18.110 -15.033 -4.484
0.440 0.440 15.209
-4.923 2.374 -0.264
17.231 -8.352 -2.462
-16.703 -1.319 -1.407
-19.604 -18.549 0.791
3.868 7.121 0.000
-0.020 0.000 33.560
-0.703 -12.044 0.879
4.659 -8.967 -1.055
-6.066 8.440 -0.879
12.747 49.495 3.692
78.066 -8.527 -63.560
-26.286 22.154 -12.132
2.198 13.187 -14.593
-7.297 -2.989 0.352
18.198 -14.945 -4.484
0.440 0.440 15.121
-4.835 2.374 -0.264
17.143 -8.264 -2.462
-16.615 -1.407 -1.407
-19.516 -18.462 0.703
3.868 7.121 0.000
-0.020 0.000 33.560
-0.615 -15.736 0.879
4.747 -8.879 -1.055
-6.066 8.352 -0.879
12.659 49.143 3.604
77.275 -9.231 -63.560
-26.110 22.330 -12.220
2.110 13.187 -14.505
-7.385 -2.989 0.352
18.198 -14.857 -4.484
0.352 0.440 15.121
-4.835 2.374 -0.264
17.055 -8.176 -2.374
-16.527 -1.407 -1.319
-19.429 -18.286 0.703
3.868 7.033 0.000
-0.020 0.000 33.580
-0.615 -17.319 0.879
4.747 -8.879 -1.055
-5.978 8.352 -0.879
12.659 48.791 3.429
76.484 -10.022 -63.560
-26.022 22.418 -12.220
2.110 13.187 -14.505
-7.473 -2.989 0.352
18.198 -14.769 -4.396
0.264 0.440 15.033
-4.747 2.374 -0.264
16.967 -8.088 -2.286
-16.440 -1.407 -1.319
-19.341 -18.198 0.703
3.780 7.033 0.000
-0.020 0.000 33.600
-0.615 -15.824 0.879
4.835 -8.791 -1.055
-5.978 8.352 -0.879
12.659 48.440 3.341
75.604 -10.725 -63.473
-25.846 22.593 -12.220
2.022 13.187 -14.505
-7.560 -2.989 0.352
18.198 -14.593 -4.396
0.264 0.352 14.945
-4.747 2.374 -0.264
16.879 -8.000 -2.286
-16.352 -1.495 -1.319
-19.253 -18.022 0.615
3.780 6.945 0.000
-0.020 0.000 33.600
-0.615 -12.220 0.791
4.923 -8.791 -1.055
-5.978 8.352 -0.879
12.571 48.088 3.165
74.725 -11.516 -63.473
-25.758 22.769 -12.308
1.934 13.099 -14.418
-7.648 -2.989 0.352
18.198 -14.505 -4.308
0.176 0.352 14.857
-4.659 2.374 -0.176
16.791 -7.824 -2.198
-16.264 -1.495 -1.319
-19.253 -17.846 0.615
3.780 6.857 0.000
-0.020 0.000 33.620
-0.615 -7.736 0.791
5.011 -8.703 -1.055
-5.978 8.352 -0.879
12.571 47.736 2.989
73.846 -12.308 -63.385
-25.582 22.945 -12.308
1.846 13.099 -14.418
-7.824 -2.989 0.352
18.198 -14.330 -4.308
0.088 0.352 14.769
-4.659 2.374 -0.176
16.703 -7.736 -2.198
-16.176 -1.495 -1.319
-19.165 -17.670 0.615
3.692 6.769 0.000
-0.020 0.000 33.640
-0.703 -3.516 0.703
5.099 -8.703 -1.143
-5.978 8.352 -0.879
12.571 47.473 2.901
73.055 -13.011 -63.385
-25.495 23.121 -12.308
1.758 13.099 -14.330
-7.912 -2.989 0.352
18.198 -14.242 -4.308
0.000 0.352 14.681
-4.571 2.374 -0.176
16.615 -7.648 -2.110
-16.088 -1.582 -1.231
-19.077 -17.582 0.527
3.692 6.769 0.000
-0.020 0.000 33.660
-0.703 -0.703 0.615
5.187 -8.615 -1.143
-5.978 8.352 -0.879
12.571 47.121 2.813
72.352 -13.714 -63.297
-25.319 23.209 -12.308
1.670 13.011 -14.330
-8.000 -2.989 0.352
18.198 -14.154 -4.220
0.000 0.352 14.681
-4.571 2.374 -0.176
16.527 -7.560 -2.110
-16.000 -1.582 -1.231
-18.989 -17.407 0.527
3.604 6.681 0.000
-0.020 0.000 33.660
-0.703 0.176 0.615
5.275 -8.615 -1.143
-5.978 8.264 -0.879
12.484 46.857 2.637
71.736 -14.242 -63.297
-25.231 23.385 -12.308
1.582 13.011 -14.330
-8.088 -2.989 0.352
18.198 -14.066 -4.220
0.000 0.352 14.593
-4.484 2.374 -0.176
16.440 -7.385 -2.022
-16.000 -1.582 -1.231
-18.901 -17.231 0.527
3.604 6.681 0.000
-0.020 0.000 33.680
-0.615 0.440 0.615
5.275 -8.527 -1.143
-5.978 8.264 -0.879
12.484 46.593 2.549
71.209 -14.769 -63.209
-25.143 23.473 -12.396
1.495 13.011 -14.330
-8.176 -2.989 0.352
18.198 -13.978 -4.220
0.000 0.352 14.505
-4.484 2.374 -0.176
16.352 -7.385 -2.022
-15.912 -1.670 -1.231
-18.901 -17.143 0.527
3.604 6.593 0.000
-0.020 0.000 33.680
-0.615 0.088 0.615
5.363 -8.527 -1.143
-5.978 8.264 -0.879
12.484 46.418 2.462
70.769 -15.121 -63.209
-25.055 23.560 -12.396
1.495 13.011 -14.242
-8.176 -2.989 0.352
18.198 -13.890 -4.132
0.000 0.352 14.505
-4.484 2.374 -0.176
16.264 -7.297 -2.022
-15.824 -1.670 -1.231
-18.813 -17.055 0.440
3.604 6.593 0.000
-0.020 0.000 33.680
-0.615 -0.264 0.615
5.363 -8.527 -1.143
-5.978 8.264 -0.879
12.484 46.330 2.462
70.505 -15.385 -63.209
-25.055 23.648 -12.396
1.495 13.011 -14.242
-8.264 -2.989 0.352
18.198 -13.802 -4.132
0.000 0.352 14.505
-4.484 2.374 -0.176
16.264 -7.209 -2.022
-15.824 -1.670 -1.231
-18.813 -17.055 0.440
3.604 6.505 0.000
-0.020 0.000 33.680
-0.615 -0.440 0.615
5.363 -8.527 -1.143
-5.978 8.264 -0.879
12.484 46.242 2.462
70.418 -15.473 -63.209
-25.055 23.648 -12.396
1.495 13.011 -14.242
-8.264 -2.989 0.352
18.198 -13.802 -4.132
0.000 0.352 14.418
-4.396 2.374 -0.176
16.264 -7.209 -1.934
-15.824 -1.670 -1.231
-18.813 -16.967 0.440
3.516 6.505 0.000

RE1MVAS.ms

Code: [Select]
macroScript RE1MVAS category:"RE1MV"
tooltip:"RE1MV Animation Script..." Icon:#("Maxscript", 3)
(
rollout Main_Form "RE1MVAS v0.1b" width:416 height:172
(
button btn1 "Import ANI" pos:[8,8] width:128 height:24
button btn2 "Export ANI" pos:[144,8] width:128 height:24 enabled:false
button btn3 "About" pos:[280,8] width:128 height:24
progressBar pb1 "ProgressBar" pos:[136,40] width:272 height:14
label lbl1 "Part: 0" pos:[8,40] width:56 height:16
label lbl2 "Frame: 0" pos:[72,40] width:56 height:16
---Import ANI---
on btn1 pressed do
(
---Global Variable---
global Part_Count
global Part_Link_Count
global Part_Index
global Frame_Count
global All_Object
global POS_File
---Open File---
POS_File = getOpenFileName types:"RE2MV ANI(*.ANI)|*.ANI|"
if POS_File != undefined then
(
--POS_File = openFile "C:\LEON.POS"
POS_File = openFile POS_File
----Set Part---
All_Object = geometry as array
---Part Count---
Part_Count = readValue POS_File
lbl1.caption = "Part: " + Part_Count as String
---Reset Part Angle---
fn Reset_Part pt =
(
All_Object[pt].rotation.x_rotation = 0
All_Object[pt].rotation.y_rotation = 0
All_Object[pt].rotation.z_rotation = 0
)
---Reset All Part Angle And Position---
for i = 1 to Part_Count do
(
Reset_Part i
All_Object[i].pos = [0, 0, 0]
deleteKeys All_Object[i] #allKeys
)
---Link Part---
for i = 1 to Part_Count do
(
Part_Link_Count = readValue POS_File
for ii = 1 to Part_Link_Count do
(
if Part_Link_Count > 0 then
(
Part_Index = readValue POS_File
All_Object[Part_Index +1].parent = All_Object[i]
)
)
)
---Set Part Pos---
for i = 1 to Part_Count do
(
local pos_x = readValue POS_File
local pos_y = readValue POS_File
local pos_z = readValue POS_File
move All_Object[i] [pos_x, pos_y, pos_z]
)
---Rotate Part Angle---
fn Rotate_Part pt =
(
local ang_x = readValue POS_File
local ang_y = readValue POS_File
local ang_z = readValue POS_File
rotate All_Object[pt] (angleaxis ang_x [1,0,0])
rotate All_Object[pt] (angleaxis ang_z [0,0,1])
rotate All_Object[pt] (angleaxis ang_y [0,1,0])
)
---Animate Part---
Frame_Count = readValue POS_File
lbl2.caption = "Frame: " + Frame_Count as String
Frame_Count -= 1
animationRange = interval 0 Frame_Count
with animate on
(
---Main Body Position---
for i = 0 to Frame_Count do
(
local pos_x = readValue POS_File
local pos_y = readValue POS_File
local pos_z = readValue POS_File
at time i All_Object[1].pos = [pos_x, pos_y, pos_z]
---Reset Angle---
for ii = 1 to Part_Count do at time i Reset_Part ii
---Read Angle---
Temp = Part_Count
while Temp > 0 do
(
at time i Rotate_Part Temp
Temp -= 1
)
---Proggres---
pb1.value = 100.*i/Frame_Count
)
)
sliderTime = 0
----Close File----
close POS_File
)
)
---Export ANI---
on btn2 pressed do
(

)
---About---
on btn3 pressed do
(
MessageBox "RE1MVAS v0.1b By Leo2236!" title: "About" beep: false
)
)
createdialog Main_Form width:416 height:62
)
Title: Re: Plugin for importing bones and animations to Blender from .anim (RE1MV)
Post by: Ivan Enzhaev on November 26, 2019, 05:01:17 pm
"15" is amount of bones. But what is the next line:

Code: [Select]
4 1 2 9 12
Title: Re: Plugin for importing bones and animations to Blender from .anim (RE1MV)
Post by: Leo2236 on November 27, 2019, 11:36:46 am
"15" is amount of bones. But what is the next line:

Code: [Select]
4 1 2 9 12
Hi, the next line"4 1 2 9 12" is description of attached parts for the first part of the model which is torso, the first value(4) is amount of parts that attached to the torso and the rest are the parts indexes.

The next line"0" would be for the second part which is head and since it doesn't have any attached part to it the value amount equal 0...

And so on...
Title: Re: Plugin for importing bones and animations to Blender from .anim (RE1MV)
Post by: Ivan Enzhaev on November 30, 2019, 12:10:09 am
Hi, Leo

I try to import the "CHAR11.OBJ" model to Blender. I will describe by steps. If I wrong say me about it. I see that body parts of the model are very big. I think I will have problems with positions of body parts that describes in the ".anim" file.

I cannot upload screenshots on your web site. I will upload them on DropBox. But if I delete them from DropBox no one will see them here on the forum.

(https://dl.dropboxusercontent.com/s/qi878prlt3jb3ii/import-model-to-blender-001.png)

I selected the "Torso" object and I see that it is the "Object_0" element because it has 56 vertices in the ".obj" file. The "1 2 9 12" indices are children of the "torso" bone. The "1" have 88 vertices and it is the head. And so on.

I think I will to begin to write a plugin that will parse data from the ".anim" file.
Title: Re: Plugin for importing bones and animations to Blender from .anim (RE1MV)
Post by: Ivan Enzhaev on December 06, 2019, 05:05:27 am
I will write the plugin for Blender later. Now I study skeletal animation realization using WebGL and TypeScript. I read this book: 3D Graphics for Game Programming (https://www.amazon.com/Graphics-Game-Programming-JungHyun-Han/dp/1439827370) and I study a code from this tutorial:

https://www.youtube.com/watch?v=f3Cr8Yx3GGA
Title: Re: Plugin for importing bones and animations to Blender from .anim (RE1MV)
Post by: Ivan Enzhaev on September 03, 2020, 04:48:28 pm
I understand that data after bone's hierarchy are positions of bones. But what does mean "25" and data after "25"?

Code: [Select]
25
-0.020 0.000 33.640
-0.791 -0.615 0.703
5.187 -8.615 -1.143
-5.978 8.352 -0.879
12.571 47.297 2.813
72.703 -13.363 -63.385
-25.407 23.209 -12.308
1.670 13.011 -14.330
-7.912 -2.989 0.352
18.198 -14.154 -4.220
0.000 0.352 14.681
-4.571 2.374 -0.176
16.527 -7.560 -2.110
-16.088 -1.582 -1.231
-18.989 -17.495 0.527
3.692 6.681 0.000
-0.020 0.000 33.620
-0.879 -0.527 0.703
4.923 -8.791 -1.055
-5.978 8.352 -0.879
12.571 48.088 3.165
74.637 -11.604 -63.473
-25.758 22.769 -12.308
1.846 13.099 -14.418
-7.736 -2.989 0.352
18.198 -14.505 -4.308
0.088 0.440 14.857
-4.659 2.374 -0.176
16.791 -7.824 -2.198
-16.264 -1.495 -1.319
-19.165 -17.846 0.615
3.780 6.857 0.000
-0.020 0.000 33.580
-0.967 -0.264 0.703
4.835 -8.879 -1.055
-5.978 8.352 -0.879
12.659 48.703 3.429
76.220 -10.198 -63.560
-26.022 22.505 -12.220
2.022 13.187 -14.505
-7.473 -2.989 0.352
18.198 -14.681 -4.396
0.264 0.440 15.033
-4.747 2.374 -0.264
16.967 -8.088 -2.286
-16.440 -1.407 -1.319
-19.341 -18.110 0.703
3.780 6.945 0.000
-0.020 0.000 33.560
-1.055 0.000 0.703
4.659 -8.879 -1.055
-6.066 8.352 -0.879
12.659 49.231 3.604
77.538 -8.967 -63.560
-26.198 22.242 -12.220
2.198 13.187 -14.505
-7.385 -2.989 0.352
18.198 -14.945 -4.484
0.352 0.440 15.121
-4.835 2.374 -0.264
17.143 -8.264 -2.374
-16.615 -1.407 -1.319
-19.429 -18.374 0.703
3.868 7.121 0.000
-0.020 0.000 33.540
-1.055 0.176 0.703
4.571 -8.967 -1.055
-6.066 8.440 -0.879
12.747 49.670 3.780
78.593 -8.088 -63.560
-26.374 22.066 -12.132
2.286 13.275 -14.593
-7.209 -2.989 0.264
18.110 -15.033 -4.484
0.440 0.440 15.209
-4.923 2.374 -0.264
17.231 -8.352 -2.462
-16.703 -1.319 -1.407
-19.516 -18.549 0.791
3.868 7.121 0.000
-0.020 0.000 33.520
-1.055 0.440 0.703
4.484 -9.055 -1.055
-6.066 8.440 -0.879
12.747 49.934 3.956
79.297 -7.385 -63.560
-26.462 21.890 -12.132
2.374 13.275 -14.593
-7.121 -2.989 0.264
18.110 -15.121 -4.571
0.527 0.440 15.297
-4.923 2.374 -0.264
17.319 -8.440 -2.462
-16.791 -1.319 -1.407
-19.604 -18.725 0.791
3.956 7.209 0.000
-0.020 0.000 33.520
-0.967 0.527 0.703
4.484 -9.055 -1.055
-6.066 8.440 -0.879
12.747 50.110 4.044
79.736 -7.033 -63.560
-26.549 21.802 -12.132
2.374 13.275 -14.593
-7.121 -2.989 0.264
18.110 -15.209 -4.571
0.527 0.440 15.297
-4.923 2.374 -0.264
17.319 -8.527 -2.549
-16.791 -1.319 -1.407
-19.692 -18.813 0.791
3.956 7.209 0.000
-0.020 0.000 33.520
-0.967 0.352 0.703
4.484 -9.055 -1.055
-6.066 8.440 -0.879
12.747 50.198 4.044
80.000 -6.857 -63.560
-26.549 21.802 -12.132
2.374 13.275 -14.593
-7.033 -2.989 0.264
18.110 -15.209 -4.571
0.527 0.440 15.297
-4.923 2.374 -0.264
17.407 -8.527 -2.549
-16.791 -1.319 -1.407
-19.692 -18.813 0.791
3.956 7.209 0.000
-0.020 0.000 33.520
-0.967 0.000 0.703
4.484 -9.055 -1.055
-6.066 8.440 -0.879
12.747 50.198 4.044
79.912 -6.857 -63.560
-26.549 21.802 -12.132
2.374 13.275 -14.593
-7.121 -2.989 0.264
18.110 -15.209 -4.571
0.527 0.440 15.297
-4.923 2.374 -0.264
17.407 -8.527 -2.549
-16.791 -1.319 -1.407
-19.692 -18.813 0.791
3.956 7.209 0.000
-0.020 0.000 33.520
-0.967 -0.879 0.703
4.484 -9.055 -1.055
-6.066 8.440 -0.879
12.747 50.110 3.956
79.648 -7.121 -63.560
-26.549 21.890 -12.132
2.374 13.275 -14.593
-7.121 -2.989 0.264
18.110 -15.209 -4.571
0.527 0.440 15.297
-4.923 2.374 -0.264
17.319 -8.527 -2.549
-16.791 -1.319 -1.407
-19.604 -18.725 0.791
3.956 7.209 0.000
-0.020 0.000 33.540
-0.879 -3.341 0.791
4.484 -8.967 -1.055
-6.066 8.440 -0.879
12.747 49.934 3.956
79.297 -7.473 -63.560
-26.462 21.890 -12.132
2.374 13.275 -14.593
-7.121 -2.989 0.264
18.110 -15.121 -4.571
0.527 0.440 15.297
-4.923 2.374 -0.264
17.319 -8.440 -2.462
-16.791 -1.319 -1.407
-19.604 -18.725 0.791
3.956 7.209 0.000
-0.020 0.000 33.540
-0.791 -7.473 0.791
4.571 -8.967 -1.055
-6.066 8.440 -0.879
12.747 49.758 3.868
78.681 -7.912 -63.560
-26.374 22.066 -12.132
2.286 13.275 -14.593
-7.209 -2.989 0.264
18.110 -15.033 -4.484
0.440 0.440 15.209
-4.923 2.374 -0.264
17.231 -8.352 -2.462
-16.703 -1.319 -1.407
-19.604 -18.549 0.791
3.868 7.121 0.000
-0.020 0.000 33.560
-0.703 -12.044 0.879
4.659 -8.967 -1.055
-6.066 8.440 -0.879
12.747 49.495 3.692
78.066 -8.527 -63.560
-26.286 22.154 -12.132
2.198 13.187 -14.593
-7.297 -2.989 0.352
18.198 -14.945 -4.484
0.440 0.440 15.121
-4.835 2.374 -0.264
17.143 -8.264 -2.462
-16.615 -1.407 -1.407
-19.516 -18.462 0.703
3.868 7.121 0.000
-0.020 0.000 33.560
-0.615 -15.736 0.879
4.747 -8.879 -1.055
-6.066 8.352 -0.879
12.659 49.143 3.604
77.275 -9.231 -63.560
-26.110 22.330 -12.220
2.110 13.187 -14.505
-7.385 -2.989 0.352
18.198 -14.857 -4.484
0.352 0.440 15.121
-4.835 2.374 -0.264
17.055 -8.176 -2.374
-16.527 -1.407 -1.319
-19.429 -18.286 0.703
3.868 7.033 0.000
-0.020 0.000 33.580
-0.615 -17.319 0.879
4.747 -8.879 -1.055
-5.978 8.352 -0.879
12.659 48.791 3.429
76.484 -10.022 -63.560
-26.022 22.418 -12.220
2.110 13.187 -14.505
-7.473 -2.989 0.352
18.198 -14.769 -4.396
0.264 0.440 15.033
-4.747 2.374 -0.264
16.967 -8.088 -2.286
-16.440 -1.407 -1.319
-19.341 -18.198 0.703
3.780 7.033 0.000
-0.020 0.000 33.600
-0.615 -15.824 0.879
4.835 -8.791 -1.055
-5.978 8.352 -0.879
12.659 48.440 3.341
75.604 -10.725 -63.473
-25.846 22.593 -12.220
2.022 13.187 -14.505
-7.560 -2.989 0.352
18.198 -14.593 -4.396
0.264 0.352 14.945
-4.747 2.374 -0.264
16.879 -8.000 -2.286
-16.352 -1.495 -1.319
-19.253 -18.022 0.615
3.780 6.945 0.000
-0.020 0.000 33.600
-0.615 -12.220 0.791
4.923 -8.791 -1.055
-5.978 8.352 -0.879
12.571 48.088 3.165
74.725 -11.516 -63.473
-25.758 22.769 -12.308
1.934 13.099 -14.418
-7.648 -2.989 0.352
18.198 -14.505 -4.308
0.176 0.352 14.857
-4.659 2.374 -0.176
16.791 -7.824 -2.198
-16.264 -1.495 -1.319
-19.253 -17.846 0.615
3.780 6.857 0.000
-0.020 0.000 33.620
-0.615 -7.736 0.791
5.011 -8.703 -1.055
-5.978 8.352 -0.879
12.571 47.736 2.989
73.846 -12.308 -63.385
-25.582 22.945 -12.308
1.846 13.099 -14.418
-7.824 -2.989 0.352
18.198 -14.330 -4.308
0.088 0.352 14.769
-4.659 2.374 -0.176
16.703 -7.736 -2.198
-16.176 -1.495 -1.319
-19.165 -17.670 0.615
3.692 6.769 0.000
-0.020 0.000 33.640
-0.703 -3.516 0.703
5.099 -8.703 -1.143
-5.978 8.352 -0.879
12.571 47.473 2.901
73.055 -13.011 -63.385
-25.495 23.121 -12.308
1.758 13.099 -14.330
-7.912 -2.989 0.352
18.198 -14.242 -4.308
0.000 0.352 14.681
-4.571 2.374 -0.176
16.615 -7.648 -2.110
-16.088 -1.582 -1.231
-19.077 -17.582 0.527
3.692 6.769 0.000
-0.020 0.000 33.660
-0.703 -0.703 0.615
5.187 -8.615 -1.143
-5.978 8.352 -0.879
12.571 47.121 2.813
72.352 -13.714 -63.297
-25.319 23.209 -12.308
1.670 13.011 -14.330
-8.000 -2.989 0.352
18.198 -14.154 -4.220
0.000 0.352 14.681
-4.571 2.374 -0.176
16.527 -7.560 -2.110
-16.000 -1.582 -1.231
-18.989 -17.407 0.527
3.604 6.681 0.000
-0.020 0.000 33.660
-0.703 0.176 0.615
5.275 -8.615 -1.143
-5.978 8.264 -0.879
12.484 46.857 2.637
71.736 -14.242 -63.297
-25.231 23.385 -12.308
1.582 13.011 -14.330
-8.088 -2.989 0.352
18.198 -14.066 -4.220
0.000 0.352 14.593
-4.484 2.374 -0.176
16.440 -7.385 -2.022
-16.000 -1.582 -1.231
-18.901 -17.231 0.527
3.604 6.681 0.000
-0.020 0.000 33.680
-0.615 0.440 0.615
5.275 -8.527 -1.143
-5.978 8.264 -0.879
12.484 46.593 2.549
71.209 -14.769 -63.209
-25.143 23.473 -12.396
1.495 13.011 -14.330
-8.176 -2.989 0.352
18.198 -13.978 -4.220
0.000 0.352 14.505
-4.484 2.374 -0.176
16.352 -7.385 -2.022
-15.912 -1.670 -1.231
-18.901 -17.143 0.527
3.604 6.593 0.000
-0.020 0.000 33.680
-0.615 0.088 0.615
5.363 -8.527 -1.143
-5.978 8.264 -0.879
12.484 46.418 2.462
70.769 -15.121 -63.209
-25.055 23.560 -12.396
1.495 13.011 -14.242
-8.176 -2.989 0.352
18.198 -13.890 -4.132
0.000 0.352 14.505
-4.484 2.374 -0.176
16.264 -7.297 -2.022
-15.824 -1.670 -1.231
-18.813 -17.055 0.440
3.604 6.593 0.000
-0.020 0.000 33.680
-0.615 -0.264 0.615
5.363 -8.527 -1.143
-5.978 8.264 -0.879
12.484 46.330 2.462
70.505 -15.385 -63.209
-25.055 23.648 -12.396
1.495 13.011 -14.242
-8.264 -2.989 0.352
18.198 -13.802 -4.132
0.000 0.352 14.505
-4.484 2.374 -0.176
16.264 -7.209 -2.022
-15.824 -1.670 -1.231
-18.813 -17.055 0.440
3.604 6.505 0.000
-0.020 0.000 33.680
-0.615 -0.440 0.615
5.363 -8.527 -1.143
-5.978 8.264 -0.879
12.484 46.242 2.462
70.418 -15.473 -63.209
-25.055 23.648 -12.396
1.495 13.011 -14.242
-8.264 -2.989 0.352
18.198 -13.802 -4.132
0.000 0.352 14.418
-4.396 2.374 -0.176
16.264 -7.209 -1.934
-15.824 -1.670 -1.231
-18.813 -16.967 0.440
3.516 6.505 0.000
Title: Re: Plugin for importing bones and animations to Blender from .anim (RE1MV)
Post by: Ivan Enzhaev on September 03, 2020, 08:05:58 pm
This script scales body's parts in Blender:

Code: [Select]
import bpy

scale = 0.1

for i in range(16):
    bpy.data.objects["Object_" + str(i)].scale = (scale, scale, scale)
Title: Re: Plugin for importing bones and animations to Blender from .anim (RE1MV)
Post by: Ivan Enzhaev on September 03, 2020, 08:57:20 pm
I want to understand how positions work. "Object_0" (torso) has a position (0.000 0.000 32.260) but "Object_1" (head) has a position (0.000 -0.380 12.340). How is it possible? Because a head must be higher than a torso.
Title: Re: Plugin for importing bones and animations to Blender from .anim (RE1MV)
Post by: Ivan Enzhaev on September 03, 2020, 10:39:55 pm
I have an idea that head's position is relative to torso position but I should to check it.
Title: Re: Plugin for importing bones and animations to Blender from .anim (RE1MV)
Post by: Ivan Enzhaev on September 04, 2020, 09:29:25 am
Yes, positions are relative to parents. I wrote a script for Blender that set object hierarchy and set object positions:

(https://dl.dropboxusercontent.com/s/kj9nj0v873tv9vu/re_set_object_positions.png)

Code: [Select]
import bpy

scale = 1

file = open("E:\\_Projects\\WebGL\\re\\re1-animaitons-webgl10-ts\\project_files\\CHAR11_01.ANI", "r")
lines = file.readlines() # get all lines

current_file_line = 0;
amount = int(lines[current_file_line]) # get an amount of bones
current_file_line += 1

# Create an array of object, scale and apply rotations
whole_object = []
for i in range(amount):
    whole_object.append(bpy.data.objects["Object_" + str(i) + ".002"])
    whole_object[i].scale = (scale, scale, scale)
    whole_object[i].select = True
    bpy.ops.object.transform_apply(location=False, rotation=True, scale=False)

# Set parents
for i in range(amount):
    line_parts = lines[current_file_line].split()
    current_file_line += 1
    bone_amount = int(line_parts[0])
    for j in range(bone_amount):
        index = int(line_parts[j+1])
        whole_object[index].parent = whole_object[i]

# Set positions
start_index = amount+1
for i in range(amount):
    coords = lines[start_index + i].split()
    x = float(coords[0])
    y = float(coords[1])
    z = float(coords[2])
    print(x, y, z)
    whole_object[i].location = (x, y, z)
Title: Re: Plugin for importing bones and animations to Blender from .anim (RE1MV)
Post by: Ivan Enzhaev on September 05, 2020, 01:42:44 pm
Could someone explain me the animation data format?
Title: Re: Plugin for importing bones and animations to Blender from .anim (RE1MV)
Post by: Ivan Enzhaev on September 06, 2020, 09:23:29 pm
What do these three numbers mean (after "25")?

Quote
25
-0.020 0.000 33.640
Title: Re: Plugin for importing bones and animations to Blender from .anim (RE1MV)
Post by: Ivan Enzhaev on September 07, 2020, 10:49:55 am
Maybe is it a translate position of torso at zero animation keyframe?
Title: Re: Plugin for importing bones and animations to Blender from .anim (RE1MV)
Post by: Ivan Enzhaev on September 08, 2020, 11:03:44 am
I try to understand the "RE1MVAS.ms" file to write my plugin in Python for Blender for creating skeleton animation. But I do not understand what is "animationRange" here:

Code: [Select]
animationRange = interval 0 Frame_Count
Because we do no use it. And I do not understand this line: "with animate on"

RE1MVAS.ms

Code: [Select]
macroScript RE1MVAS category:"RE1MV"
tooltip:"RE1MV Animation Script..." Icon:#("Maxscript", 3)
(
rollout Main_Form "RE1MVAS v0.1b" width:416 height:172
(
button btn1 "Import ANI" pos:[8,8] width:128 height:24
button btn2 "Export ANI" pos:[144,8] width:128 height:24 enabled:false
button btn3 "About" pos:[280,8] width:128 height:24
progressBar pb1 "ProgressBar" pos:[136,40] width:272 height:14
label lbl1 "Part: 0" pos:[8,40] width:56 height:16
label lbl2 "Frame: 0" pos:[72,40] width:56 height:16
---Import ANI---
on btn1 pressed do
(
---Global Variable---
global Part_Count
global Part_Link_Count
global Part_Index
global Frame_Count
global All_Object
global POS_File
---Open File---
POS_File = getOpenFileName types:"RE2MV ANI(*.ANI)|*.ANI|"
if POS_File != undefined then
(
--POS_File = openFile "C:\LEON.POS"
POS_File = openFile POS_File
----Set Part---
All_Object = geometry as array
---Part Count---
Part_Count = readValue POS_File
lbl1.caption = "Part: " + Part_Count as String
---Reset Part Angle---
fn Reset_Part pt =
(
All_Object[pt].rotation.x_rotation = 0
All_Object[pt].rotation.y_rotation = 0
All_Object[pt].rotation.z_rotation = 0
)
---Reset All Part Angle And Position---
for i = 1 to Part_Count do
(
Reset_Part i
All_Object[i].pos = [0, 0, 0]
deleteKeys All_Object[i] #allKeys
)
---Link Part---
for i = 1 to Part_Count do
(
Part_Link_Count = readValue POS_File
for ii = 1 to Part_Link_Count do
(
if Part_Link_Count > 0 then
(
Part_Index = readValue POS_File
All_Object[Part_Index +1].parent = All_Object[i]
)
)
)
---Set Part Pos---
for i = 1 to Part_Count do
(
local pos_x = readValue POS_File
local pos_y = readValue POS_File
local pos_z = readValue POS_File
move All_Object[i] [pos_x, pos_y, pos_z]
)
---Rotate Part Angle---
fn Rotate_Part pt =
(
local ang_x = readValue POS_File
local ang_y = readValue POS_File
local ang_z = readValue POS_File
rotate All_Object[pt] (angleaxis ang_x [1,0,0])
rotate All_Object[pt] (angleaxis ang_z [0,0,1])
rotate All_Object[pt] (angleaxis ang_y [0,1,0])
)
---Animate Part---
Frame_Count = readValue POS_File
lbl2.caption = "Frame: " + Frame_Count as String
Frame_Count -= 1
animationRange = interval 0 Frame_Count
with animate on
(
---Main Body Position---
for i = 0 to Frame_Count do
(
local pos_x = readValue POS_File
local pos_y = readValue POS_File
local pos_z = readValue POS_File
at time i All_Object[1].pos = [pos_x, pos_y, pos_z]
---Reset Angle---
for ii = 1 to Part_Count do at time i Reset_Part ii
---Read Angle---
Temp = Part_Count
while Temp > 0 do
(
at time i Rotate_Part Temp
Temp -= 1
)
---Proggres---
pb1.value = 100.*i/Frame_Count
)
)
sliderTime = 0
----Close File----
close POS_File
)
)
---Export ANI---
on btn2 pressed do
(

)
---About---
on btn3 pressed do
(
MessageBox "RE1MVAS v0.1b By Leo2236!" title: "About" beep: false
)
)
createdialog Main_Form width:416 height:62
)
Title: Re: Plugin for importing bones and animations to Blender from .anim (RE1MV)
Post by: Ivan Enzhaev on September 11, 2020, 11:32:52 pm
25
-0.020 0.000 33.640 - position of torso
-0.791 -0.615 0.703 - rotation of torso
5.187 -8.615 -1.143 - position of head
-5.978 8.352 -0.879 - rotation of head

Yes?
Title: Re: Plugin for importing bones and animations to Blender from .anim (RE1MV)
Post by: Ivan Enzhaev on September 12, 2020, 10:42:30 pm
It is my first skeleton animation that I exported from Blender to Collada (.dae) and imported to the WebGL/TypeScript application. You can run it in browser by one click: Child Bone Animation (https://8observer8.github.io/webgl10-ts/child-bone/index.html)

(https://raw.githubusercontent.com/8Observer8/8observer8.github.io/master/webgl10-ts/child-bone/screenshots/joint-webgl10-ts.gif)

(https://raw.githubusercontent.com/8Observer8/8observer8.github.io/master/webgl10-ts/child-bone/screenshots/child-bone-edit-mode.png)
Title: Re: Plugin for importing bones and animations to Blender from .anim (RE1MV)
Post by: Ivan Enzhaev on September 18, 2020, 09:04:49 am
I am close to write a plugin. It is good that a model do not have a skinning.
Title: Re: Plugin for importing bones and animations to Blender from .anim (RE1MV)
Post by: Ivan Enzhaev on September 18, 2020, 09:18:36 am
Now I understand animation data.

"25" - amount of frames.
Next line is a position of torso.
Next 15 lines are angles of parts (rotations around x, y and z).

Code: [Select]
25
-0.020 0.000 33.640
-0.791 -0.615 0.703
5.187 -8.615 -1.143
-5.978 8.352 -0.879
12.571 47.297 2.813
72.703 -13.363 -63.385
-25.407 23.209 -12.308
1.670 13.011 -14.330
-7.912 -2.989 0.352
18.198 -14.154 -4.220
0.000 0.352 14.681
-4.571 2.374 -0.176
16.527 -7.560 -2.110
-16.088 -1.582 -1.231
-18.989 -17.495 0.527
3.692 6.681 0.000

-0.020 0.000 33.620
-0.879 -0.527 0.703
4.923 -8.791 -1.055
-5.978 8.352 -0.879
12.571 48.088 3.165
74.637 -11.604 -63.473
-25.758 22.769 -12.308
1.846 13.099 -14.418
-7.736 -2.989 0.352
18.198 -14.505 -4.308
0.088 0.440 14.857
-4.659 2.374 -0.176
16.791 -7.824 -2.198
-16.264 -1.495 -1.319
-19.165 -17.846 0.615
3.780 6.857 0.000
Title: Re: Plugin for importing bones and animations to Blender from .anim (RE1MV)
Post by: Ivan Enzhaev on September 25, 2020, 02:13:26 am
I wrote an example where you can rotate/zoom parts of Jill: https://8observer8.github.io/webgl10-ts/jill-parts/index.html

(https://dl.dropboxusercontent.com/s/byva3vmfo6oa2rl/jill-parts.gif)
Title: Re: Plugin for importing bones and animations to Blender from .anim (RE1MV)
Post by: Ivan Enzhaev on October 06, 2020, 05:43:35 pm
I am working with animations now.

(https://dl.dropboxusercontent.com/s/qpc461cjmb0w376/jill-joint-positions-webgl10-ts.png)
Title: Re: Plugin for importing bones and animations to Blender from .anim (RE1MV)
Post by: Ivan Enzhaev on October 06, 2020, 11:55:52 pm
Something is wrong  ;D

(https://dl.dropboxusercontent.com/s/3i3rsemzfs9kxlf/jill-obj-anim-webgl10-ts-wrong-anim.gif)
Title: Re: Plugin for importing bones and animations to Blender from .anim (RE1MV)
Post by: Ivan Enzhaev on November 09, 2020, 09:30:14 am
I want to have two versions of skeleton demo:
Both versions will be run on Desktop and Android. Qt supports WebSockets for coop and multiplayer (Node.js supports WebSockets too).

I you want to start to practice with simple games you can use my examples. They draw a triangle:
Title: Re: Plugin for importing bones and animations to Blender from .anim (RE1MV)
Post by: dukemagus on December 21, 2020, 12:52:50 am
A tool that can reads the animation data and parse to something Blender can understand (i'm not sure RE1 models have skeletal rigs, so it would probably be something moving individual meshes) would be great!

Best of luck with the development of your tool
Title: Re: Plugin for importing bones and animations to Blender from .anim (RE1MV)
Post by: Ivan Enzhaev on December 21, 2020, 03:09:40 am
Thank you. I did not forget about it. Yes, of course, I will solve the problems and the plugin will be ready. Give me one or two month.
Title: Re: Plugin for importing bones and animations to Blender from .anim (RE1MV)
Post by: Ivan Enzhaev on January 13, 2021, 02:35:10 pm
This script adds two numbers. It shows how to add GUI elements to Blender using Python. Useful link: https://stackoverflow.com/a/15610283/4159530

(https://ddgobkiprc33d.cloudfront.net/122d391d-3093-4e9d-badf-b15839aeddc6.png)

Code: [Select]
bl_info = {
    "name": "Calculator to add two numbers",
    "category": "3D View"
}
 
import bpy
 
class MyPanel(bpy.types.Panel):
  bl_label = "Calculator"
  bl_space_type = 'VIEW_3D'
  bl_region_type = 'TOOLS'
 
  def draw(self, context):
    layout = self.layout
   
    col = layout.column(align = True)
    col.prop(context.scene, "a_string_prop")
    col.prop(context.scene, "b_string_prop")
    col.prop(context.scene, "r_string_prop")
 
    row = layout.row()
    row.operator("calculator.add", text="Add two numbers")
   
class MyOperator(bpy.types.Operator):
    bl_idname = "calculator.add"
    bl_label = "Simple operator"
    bl_description = "My Operator"
   
    def execute(self, context):
        a = context.scene.a_string_prop
        b = context.scene.b_string_prop
        r = float(a) + float(b)
        context.scene.r_string_prop = str(r)
        return {'FINISHED'}
 
def register():
  bpy.utils.register_class(MyPanel)
  bpy.utils.register_class(MyOperator)
  bpy.types.Scene.a_string_prop = bpy.props.StringProperty \
    (
        name = "a",
        description = "First operand"
    )
  bpy.types.Scene.b_string_prop = bpy.props.StringProperty \
    (
        name = "b",
        description = "Second operand"
    )
  bpy.types.Scene.r_string_prop = bpy.props.StringProperty \
    (
        name = "result",
        description = "Result operand"
    )
 
def unregister():
  bpy.utils.unregister_class(MyPanel)
  bpy.utils.unregister_class(MyOperator)
  del bpy.types.Scene.a_string_prop
  del bpy.types.Scene.b_string_prop
  del bpy.types.Scene.r_string_prop
 
if __name__ == "__main__":
  register()
Title: Re: Plugin for importing bones and animations to Blender from .anim (RE1MV)
Post by: Leigiboy on January 17, 2021, 08:36:58 am
I dont know how I missed this, really awesome work.

I recently started thinking on recreate the ending videos (https://www.youtube.com/watch?v=0I5sF5E_PsM) from RE1, where the camera zoom on the characters, in blender and althoug Iwas able to get the animations on blender using the fbx format a dedicated tool to impor them would be really awesome.

Keep up the good work!
Title: Re: Plugin for importing bones and animations to Blender from .anim (RE1MV)
Post by: Ivan Enzhaev on February 10, 2021, 08:52:43 pm
I found the nice tutorial about making bones with script: 3. Armatures (https://web.archive.org/web/20120106231440/http://wiki.blender.org/index.php/Dev:2.5/Py/Scripts/Cookbook/Code_snippets/Armatures)
Creating keyframes for bones: Actions and drivers (https://web.archive.org/web/20120110165033/http://wiki.blender.org/index.php/Dev:2.5/Py/Scripts/Cookbook/Code_snippets/Actions_and_drivers)
This part is about making GUI in Blender using Python: 10. Interface (https://web.archive.org/web/20120412012853/http://wiki.blender.org/index.php/Dev:2.5/Py/Scripts/Cookbook/Code_snippets/Interface)
This code works in Blender 2.67 and 2.79. I think it will work in new Blendr 2.9 with little changes but I use 2.67 because it is good for my notebook.