I have problem with game Dragon's Prophet, because it has 3d file in .ros format.
I have max script but only model + model_skeleton. I need only model without bones,,,
This is script:
Code: Select all
http://pastebin.com/dZqThS1hCode: Select all
http://pastebin.com/dZqThS1h

ok here we go mate.finale00 wrote:It would be helpful if you uploaded sample files as well.


Code: Select all
if (heapSize < 20000000) then
heapSize = 200000000
fname = getOpenFileName \
caption:"Open .ros from Mesh folder" \
types:"Dragon's_Prophet (*.ros)|*.ros" \
historyCategory:"Dragon's_ProphetObjectPresets"
f = fopen fname "rb"
fn ReadFixedString bstream fixedLen =
(
local str = ""
for i = 1 to fixedLen do
(
str += bit.intAsChar (ReadByte bstream #unsigned)
)
str
)
struct weight_data
(
boneids,weights
)
struct Bone_Info_Struct
(
Bone1,Bone2,Bone3,Bone4
)
struct Weight_Info_Struct
(
Weight1,Weight2,Weight3,Weight4
)
clearlistener()
vertArray=#()
faceArray=#()
Normal_array = #()
UVarray=#()
Weight_array=#()
B1_array=#()
W1_array=#()
fseek f 0x34 #seek_set
NSize=ReadLong f
meshname=ReadFixedString f NSize
fseek f 0x50 #seek_cur
check=ReadShort f
Print ("Last Read @ 0x"+((bit.intAsHex(ftell f))as string))
if check==14516 then
for x =1 to 1 do (
fseek f 50 #seek_cur
NSize3=ReadLong f
meshname3=ReadFixedString f NSize3
fseek f 0x50 #seek_cur
fseek f 0x10b #seek_cur--hash
)
if check==13406 then
for x =1 to 1 do (
fseek f 50 #seek_cur
NSize1=ReadLong f
meshname1=ReadFixedString f NSize1
fseek f 0x50 #seek_cur
check2=ReadShort f
if check2==14516 then
for x =1 to 1 do (
fseek f 50 #seek_cur
NSize2=ReadLong f
meshname2=ReadFixedString f NSize2
fseek f 0x50 #seek_cur
fseek f 0x6E #seek_cur--hash
)
if check2==1 then
fseek f 0x68 #seek_cur
)
if check==1 then fseek f 104 #seek_cur
VertCount=readlong f
sectionCount=readlong f
CharCount=readlong f
possition=ReadFixedString f CharCount
null=readlong f
id=readlong f
for x =1 to VertCount do (--vertices
vx = readFloat f
vy = readFloat f
vz = readFloat f
append vertArray [vx,vz,vy]
)
for x =1 to sectionCount-1 do (
CharCount=readlong f
CharCount_fixed=(CharCount-2)
print CharCount_fixed
Print ("Last Read @ 0x"+((bit.intAsHex(ftell f))as string))
SectionName=ReadFixedString f CharCount_fixed
check_w=readshort f
print check_w
null=readlong f
id=readlong f
if id==6 then
for x =1 to VertCount do (--normals 6
nx = readFloat f
ny = readFloat f
nz = readFloat f
append Normal_array [nx,nz,ny]
)
if id==28 then
for x =1 to VertCount do (--colors 28
ffff=readlong f
)
if id==30 then
for x =1 to VertCount do (--blend indices 30
bone1 = readbyte f #unsigned
bone2 = readbyte f #unsigned
bone3 = readbyte f #unsigned
bone4 = readbyte f #unsigned
append B1_array (Bone_Info_Struct Bone1:Bone1 Bone2:Bone2 Bone3:Bone3 Bone4:Bone4)
)
if id==16 then
for x =1 to VertCount do (--uv's 16
tu = readFloat f
tv = readFloat f* -1
append UVarray [tu,tv,0]
)
if id==2 then
if check_w==115 then
for x =1 to VertCount do (--blend weights 2
weight1 = readFloat f
weight2 = readFloat f
weight3 = readFloat f
weight4 = readFloat f
append W1_array (Weight_Info_Struct Weight1:Weight1 Weight2:Weight2 Weight3:Weight3 Weight4:Weight4)
)
for b = 1 to W1_array.count Do (
w = (weight_data boneids:#() weights:#())
maxweight = 0
if(W1_array[b].Weight1 != 0) then
maxweight = maxweight + W1_array[b].Weight1
if(W1_array[b].Weight2 != 0) then
maxweight = maxweight + W1_array[b].Weight2
if(W1_array[b].Weight3 != 0) then
maxweight = maxweight + W1_array[b].Weight3
if(W1_array[b].Weight4 != 0) then
maxweight = maxweight + W1_array[b].Weight4
if(maxweight != 0) then
(
if(W1_array[b].Weight1 != 0) then
(
w1 = W1_array[b].Weight1 as float
append w.boneids (B1_array[b].Bone1 + 1)
append w.weights (w1)
)
if(W1_array[b].Weight2 != 0) then
(
w2 = W1_array[b].Weight2 as float
append w.boneids (B1_array[b].Bone2 + 1)
append w.weights (w2)
)
if(W1_array[b].Weight3 != 0) then
(
w3 = W1_array[b].Weight3 as float
append w.boneids (B1_array[b].Bone3 + 1)
append w.weights (w3)
)
if(W1_array[b].Weight4 != 0) then
(
w4 = W1_array[b].Weight4 as float
append w.boneids (B1_array[b].Bone4 + 1)
append w.weights (w4)
)
)
append Weight_array w
)
if id==2 then
if check_w!=115 then
for x =1 to VertCount do (--tangent/quaternion 2
t1 = readFloat f
t2 = readFloat f
t3 = readFloat f
t4 = readFloat f
)
print id
)
fseek f 0x31 #seek_cur
faceid=ReadLong f
facecount=ReadLong f
totalfaces=ReadLong f
for x = 1 to facecount do (
fa=readshort f + 1
fb=readshort f + 1
fc=readshort f + 1
append faceArray [fc,fb,fa]
)
unk1=readlong f
CharCount=readlong f
flag=ReadFixedString f CharCount
null=readlong f
id=readlong f
if id==42 then
for x =1 to VertCount do (--flag 42
getPos = ftell f + 16
fseek f getPos #seek_set
)
Print ("Last Read @ 0x"+((bit.intAsHex(ftell f))as string))
msh = mesh vertices:vertArray faces:faceArray
msh.name=meshname
msh.numTVerts = UVarray.count
buildTVFaces msh
for j = 1 to UVarray.count do setTVert msh j UVarray[j]
for j = 1 to faceArray.count do setTVFace msh j faceArray[j]
for j = 1 to Normal_array.count do setNormal msh j Normal_array[j]
fclose f