Sorry, I haven't been around lately.
spent alot of time trying to edit marth's Cape.. but sadly no good
even with the Collada trick, the cape still gets badly deformed.. can't figure it out.
wasted the entire day, just trying to get the cape sort of decent for my shinobu mod...
anyways, I've heard about a few bugs, and even experienced alot problems myself.
all I can say, is this method isn't "Full Proof" and likely won't be. unless brawlbox is better devloped to suit our 3d modding needs.
though it's an effective trick to help edit certain static meshes, such as face, and the chest... probably the arms but some objects just don't seem to work.. and I've spent all day trying to come to a resolve... no luck.
also there seems to be a HUGE issue with Collada Importers.. AiS was made off of the Free ColladaMax plugins.. some people have different plugins which do some funny stuff
if so try this updated script, it'll fix your AIS scene and rescale it properly.
fn readBEshort fstream = (
short = readshort fstream #unsigned
short = bit.swapBytes short 1 2
return short
)
fn readBElong fstream = (
long = readlong fstream
long = bit.swapBytes long 1 4
long = bit.swapBytes long 2 3
return long
)
fn ReadBEfloat fstream = (
return floatSwap2(readfloat fstream)
)
fn floatSwap2 f = (
i = bit.floatAsInt f
h = bit.intashex i
while h.count < 8 do h = "0" + h
s = (substring h 7 2) + (substring h 5 2) + (substring h 3 2) + (substring h 1 2)
bit.intAsFloat (bit.hexasint s)
)
rollout DDV "Vertex Modding Patcher" width:320 height:270
(
button btn1 "Import Verts" pos:[8,16] width:144 height:40
button btn2 "Create Patch" pos:[8,112] width:144 height:40
button btn3 "Patch Model" pos:[8,160] width:144 height:40
groupBox grp1 "Description" pos:[160,8] width:143 height:48
label lbl1 "Imports a RAW VertexSet from BrawlBox." pos:[169,21] width:128 height:30
groupBox grp2 "Description" pos:[160,152] width:143 height:48
label lbl2 "Patches finished model, for use with DDV" pos:[169,165] width:128 height:30
groupBox grp3 "Description" pos:[160,104] width:143 height:48
label lbl3 "Creates a Patch File from the RAW and Imported File" pos:[169,117] width:131 height:30
label lbl4 "-Mario_Kart64n, (June3, 2010)" pos:[164,253] width:156 height:18
button btn4 "Fix AiS Import" pos:[8,208] width:144 height:40
groupBox grp5 "Description" pos:[160,200] width:143 height:48
label lbl5 "Removes Collada Lib From Imported mesh" pos:[169,213] width:128 height:30
checkbox chk1 "Checkbox" pos:[10,250] width:14 height:13
label lbl7 "Max2010" pos:[27,249] width:45 height:15
button btn5 "Export Verts" pos:[8,64] width:144 height:40
checkbox chk2 "Checkbox" pos:[159,68] width:14 height:13 enabled:false checked:false
label lbl8 "Save As Seperate File" pos:[176,67] width:119 height:15
checkbox chk3 "Checkbox" pos:[159,84] width:14 height:13 enabled:false checked:false
label lbl9 "Save Changes to MDL0" pos:[176,83] width:119 height:15
on btn1 pressed do(
fsource = GetOpenFileName \
caption:"Brawl Vert Import" types: \
"All files (*.*)|*.*|"
f= fopen fsource "rb"
fpath= getFilenamePath fsource
fname = getFilenameFile fsource
vertArray=#()
uvwArray=#()
faceArray=#()
fSize=readBElong f
mdlOffset=readBElong f
dataOffset=readBElong f
strOffset=readBElong f
vertID=readBElong f
vUkn1=readBElong f --flag? is XYZ?
dataType=readBElong f
entryStride=readBEshort f
numVertices=readBEshort f
eMinX=readBEfloat f
eMinY=readBEfloat f
eMinZ=readBEfloat f
eMaxX=readBEfloat f
eMaxY=readBEfloat f
eMaxZ=readBEfloat f
pad=readBElong f
pad=readBElong f
for x = 1 to numVertices do(
vX=readBEfloat f
vY=readBEfloat f
vZ=readBEfloat f
append vertArray[vX,vY,vZ]
append uvwArray[0,0,0]
)
-- fclose f
-- fsource = GetOpenFileName \
-- caption:"Brawl Polygon Import" types: \
-- "All files (*.*)|*.*|"
-- f= fopen fsource "rb"
--
-- fSize=readBElong f
-- mdlOffset=readBElong f
-- nodeID=readBElong f
-- pfUkn1=readBElong f
-- elementFlag=readBElong f
-- pfUkn2=readBElong f --count for weird data
-- defSize=readBElong f
-- defFlags=readBElong f
-- defOffset=readBElong f
-- datalen1=readBElong f
-- datalen2=readBElong f
-- dataOffset=readBElong f
-- pfUkn3=readBElong f
-- pfUkn4=readBElong f
-- strOffset=readBElong f
-- itmOffset=readBElong f
-- pfUkn5=readBElong f
-- numFaces=readBElong f
-- vertSet=readBEshort f
-- normSet=readBEshort f
-- partXOffset=readBEshort f --???
-- if vertID!=vertSet then(
-- MessageBox(
-- "WARRNING!!!" +"\n"+
-- "Incorrect Index Buffer" +"\n"+
-- "-Sorry (mariokart64n)")
-- )else(
-- fseek pf 0x111 #seek_cur
-- for x = 1 to pfUkn2 do (
-- ukn=readbyte f #unsigned
-- ukn=readbyte f #unsigned
-- ukn=readbyte f #unsigned
-- ukn=readbyte f #unsigned
-- ukn=readbyte f #unsigned
-- )
-- )
--
-- ukn=readbyte f #unsigned
-- ukn=readbyte f #unsigned
-- ukn=readbyte f #unsigned
-- ukn=readbyte f #unsigned
-- ukn=readBEshort f
-- ukn=readbyte f #unsigned
-- ukn=readBEshort f
-- ukn=readBEshort f
-- ukn=readbyte f #unsigned
-- ukn=readbyte f #unsigned
-- ukn=readBEshort f
-- end of file is a loop of data
-- 27bytes long per loop
--
msh = mesh vertices:vertArray faces:faceArray --build mesh
msh.numTVerts = vertArray.count
msh.name=fname
--msh.rotation = quat -0.5 0.5 -0.5 0.5
--msh.rotation = quat 0.5 0.5 0.5 0.5
--msh.scale = [0.3937008,0.3937008,0.3937008]
buildTVfaces msh
-- modPanel.setCurrentObject $Object01.baseObject
-- subobjectLevel = 1
-- rotate $Object01.verts[#{1..580}] (quat 0.707107 0 0 0.707107)
-- subobjectLevel = 0
-- for j = 1 to UV_array.count do setTVert msh j UV_array[j]
-- for j = 1 to faceArray.count do setTface msh j faceArray[j]
-- for j = 1 to Normal_array.count do setNormal msh j Normal_array[j]
messageBox "Done !"
gc()
fclose f
)
on btn2 pressed do(
fsource = GetOpenFileName \
caption:"Brawl Vert Import" types: \
"All files (*.*)|*.*|"
f= fopen fsource "rb"
fpath= getFilenamePath fsource
fname = getFilenameFile fsource
vertArray=#()
uvwArray=#()
faceArray=#()
fSize=readBElong f
mdlOffset=readBElong f
dataOffset=readBElong f
strOffset=readBElong f
vertID=readBElong f
vUkn1=readBElong f --flag? is XYZ?
dataType=readBElong f
entryStride=readBEshort f
numVertices=readBEshort f
eMinX=readBEfloat f
eMinY=readBEfloat f
eMinZ=readBEfloat f
eMaxX=readBEfloat f
eMaxY=readBEfloat f
eMaxZ=readBEfloat f
pad=readBElong f
pad=readBElong f
for x = 1 to numVertices do(
vX=readBEfloat f
vY=readBEfloat f
vZ=readBEfloat f
append vertArray[vX,vY,vZ]
append uvwArray[0,0,0]
)
obj=getCurrentSelection()
obj.pos = [0,0,0]
obj.rotation = quat 0 0 0 0
max modify mode
addModifier obj (edit_poly())
subobjectLevel = 1
-- modPanel.setCurrentObject obj.modifiers[#Edit_Poly]
diffArray=#()
directionArray=#()
for x = 1 to numVertices do(
$.modifiers[#Edit_Poly].SetSelection #Vertex #{}
$.modifiers[#Edit_Poly].Select #Vertex #{x}
vert=$.modifiers[#Edit_Poly].GetVertex x
-- $.modifiers[#Edit_Poly].SetOperation #Transform
mX=(vertArray[x][1])-(vert[1])
mY=(vertArray[x][2])-(vert[2])
mZ=(vertArray[x][3])-(vert[3])
append diffArray[mX,mY,mZ]
-- $.modifiers[#Edit_Poly].Commit ()
-- $.modifiers[#Edit_Poly].SetSelection #Vertex #{}
)
-- subobjectLevel = 0
-- modPanel.setCurrentObject obj.modifiers[#Edit_Poly]
deleteModifier obj 1
createFile (fpath+fname+"_patch.pta")
s = fopen (fpath+fname+"_patch.pta") "ab"
vcount=writelong s numVertices
for x = 1 to numVertices do(
write=writefloat s (diffArray[x][1])
write=writefloat s (diffArray[x][2])
write=writefloat s (diffArray[x][3])
write=writelong s 0x0
)
messageBox ("Patch Created !" +"\n"+
"\n"+
"File Saved To:" +"\n"+
(fpath+fname+"_patch.pta")
)
gc()
fclose s
fclose f
)
on btn3 pressed do(
fsource = GetOpenFileName \
caption:"Brawl Vert Patcher" types: \
"Patch(*pta)|*.pta|All files (*.*)|*.*|"
f= fopen fsource "rb"
fpath= getFilenamePath fsource
vertArray=#()
vcount=readlong f #unsigned
for x = 1 to vcount do(
vX=readfloat f
vY=readfloat f
vZ=readfloat f
dmy=readshort f #unsigned
side=readshort f #unsigned
append vertArray[vX,vY,vZ,side]
)
obj=getCurrentSelection()
obj.pos = [0,0,0]
obj.rotation = quat 0 0 0 0
max modify mode
addModifier obj (edit_poly())
subobjectLevel = 1
--modPanel.setCurrentObject obj.modifiers[#Edit_Poly]
for x = 1 to vcount do(
$.modifiers[#Edit_Poly].SetSelection #Vertex #{}
$.modifiers[#Edit_Poly].Select #Vertex #{x}
vert=$.modifiers[#Edit_Poly].GetVertex x
$.modifiers[#Edit_Poly].SetOperation #Transform
mX=(vertArray[x][1])
mY=(vertArray[x][2])
mZ=(vertArray[x][3])
$.modifiers[#Edit_Poly].MoveSelection [mX,mY,mZ]
$.modifiers[#Edit_Poly].Commit ()
$.modifiers[#Edit_Poly].SetSelection #Vertex #{}
)
subobjectLevel = 0
--modPanel.setCurrentObject obj.modifiers[#Edit_Poly]
messageBox "Patched !"
gc()
fclose f
)
on btn4 pressed do(
-- obj = getnodebyname "Box01"
-- if obj != undefined then select obj
-- select $Polygon*
-- select $helpers
disableSceneRedraw()
st = timestamp() --get start time in milliseconds
undo off(
geo=$polygon*
-- print geo
for x = 1 to geo.count do(
addModifier geo[x] (Normalmodifier ())
geo[x].modifiers[#Normal].flip = on
addModifier geo[x] (smooth ())
geo[x].modifiers[#Smooth].smoothingBits = 1
collapseStack geo[x]
m2010=chk1.checked
if m2010==true do(
--rotate geo[x] (quat -1 0 0 0)
geo[x].scale = [2.54,2.54,2.54]
)
)
delete $helpers
for x = 1 to geo.count do(
-- aBox = Box length:0.2 width:0.2 height:0.2 name:"dummy"
aBox = Box()
aBox.rotation = quat 0.707107 0 0 0.707107
convertTo aBox TriMeshGeometry
)
dmy=$Box*
myBoxes=#()
myMeshes=#()
for x = 1 to geo.count do(
objA= dmy[x]
objB= geo[x]
append myBoxes objA
append myMeshes objB
)
for x = 1 to geo.count do(
myBoxes[x].name = myMeshes[x].name
attach myBoxes[x] myMeshes[x]
)
for x = 1 to geo.count do(
for i = 1 to 8 do(
delete geo[x].verts[#{1}]
)
addModifier geo[x] (Morpher ())
)
addModifier $Polygon* (Edit_Mesh ())
)
et = timestamp() --get end time in milliseconds
enableSceneRedraw()
gc()
print ("Operation Completed In: "+(((et-st)/60)as string)+" Seconds") --print time to finish
)
)
createDialog DDV