MaxScript

Любыe технические вопросы о работе программ задаются и рашаются здесь
Ответить
Сообщение
Автор
Dainius
Прохожий
Прохожий
Сообщения: 30
Зарегистрирован: 26 янв 2013, 02:28
Благодарил (а): 0
Поблагодарили: 0

MaxScript

#1 Сообщение 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.

Dainius
Прохожий
Прохожий
Сообщения: 30
Зарегистрирован: 26 янв 2013, 02:28
Благодарил (а): 0
Поблагодарили: 0

Re: MaxScript

#2 Сообщение 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
)

Аватара пользователя
Tosyk
Администратор
Сообщения: 1880
Зарегистрирован: 24 авг 2011, 03:11
Благодарил (а): 64 раза
Поблагодарили: 61 раз

Re: MaxScript

#3 Сообщение Tosyk »

can't get into this for several days
can you show an image examples? like screnns from 3ds max
При копировании материалов сайта ссылка на этот ресурс обязательна.
When copying materials from this site link to this resource is required.

Dainius
Прохожий
Прохожий
Сообщения: 30
Зарегистрирован: 26 янв 2013, 02:28
Благодарил (а): 0
Поблагодарили: 0

Re: MaxScript

#4 Сообщение 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.

Ответить

Вернуться в «Вопросы, ответы»