Страница 1 из 1

MaxScript

Добавлено: 15 фев 2013, 12:41
Dainius
Hi,

I am trying to re-create original Battlefield 3 skeleton in 3ds max from extracted game data files. Basically I have world space coordinates for each bone in text file


The structure looks like this:

member::LinearTransform
right::Vec3
x 1.0
y 0.0
z 2.220446e-16
up::Vec3
x -0.0
y 1.0
z 0.0
forward::Vec3
x -2.220446e-16
y -0.0
z 1.0
trans::Vec3
x 0.2
y 0.0
z 4.440892e-17
member::LinearTransform
right::Vec3
x 1.0
y 0.0
z 0.0
up::Vec3
x -0.0
y 1.0
z 0.0
forward::Vec3
x 0.0
y -0.0
z 1.0
trans::Vec3
x 4.956174e-16
y 1.7004331
z 0.0771753


where "member::LinearTransform" is subsequent bone

And my guess that "right" "Up" "Forward" is not usefull, only the "trans::Vec3" and its sub-column is used.


Now all I need atm is, maxscript to interpret the txt file and create a "point" helper for each "member::LinearTransform" using world space data from it`s respective "trans::Vec3" subcolumns.

I am attaching a link to the txt file I have extracted.
https://dl.dropbox.com/u/88155050/BF3/Venice1pSke01.txt

Could you possibly help me with this?
Thank you very much.

Re: MaxScript

Добавлено: 17 фев 2013, 16:37
Dainius
So yeah i have it done by a very nice man from cgtalk

If anyone is interested here the scrip for max

(
fn nextFloat stream =
(trimLeft (readLine stream) " xyz") as float

fn getVector stream type =
(
skipToString stream type
skipToNextLine stream
Point3 (nextFloat stream) (nextFloat stream) (nextFloat stream)
)

fn getNextMatrix stream =
if skipToString stream "member::LinearTransform" != undefined do
matrix3 (getVector stream "right::Vec3") \
(getVector stream "up::Vec3") \
(getVector stream "forward::Vec3") \
(getVector stream "trans::Vec3")

local file = openFile "C:\\TEMP\\Venice1pSke01.txt"

while (local matrix = getNextMatrix file) != undefined do
Point transform:matrix size:.5
)

Re: MaxScript

Добавлено: 19 фев 2013, 05:59
Tosyk
can't get into this for several days
can you show an image examples? like screnns from 3ds max

Re: MaxScript

Добавлено: 19 фев 2013, 12:48
Dainius
Tosyk писал(а):can't get into this for several days
can you show an image examples? like screnns from 3ds max
Of course

Having original bone center point positions makes a lot easier to create skeletons for bf3 models(Bones,Biped,CAT, etc..)
+ by modifying a few values in the script we can get vehicle, prop position center points.Изображение
Изображение
Изображение
Изображение

attaching max file for preview (max 2012 x64)
https://dl.dropbox.com/u/88155050/BF3/P ... Points.zip

Note: the script does not work for max 2013.