(VBS) Remove biped from Panda X files

Post those lines of code you feel like sharing or find what you require for your project here; or simply use them as tutorials.
Post Reply
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

(VBS) Remove biped from Panda X files

Post by bitplane »

A small, very hacky VB Script to remove the mesh that comes attached to bipeds when you exported directly from 3D Studio Max with the Panda X Exporter.

Windows only, sloppy, and it's only been tested with one file, but still worth a try if you don't own max and you've got a mesh with a biped stuck in it :)

Code: Select all

strIn = InputBox("Enter x file name")
strOut = strIn & ".new.x"

set fso  = createobject("scripting.filesystemobject")
set fIn  = fso.openTextFile(strIn)
set fOut = fso.createtextfile(strOut)

while (not fIn.AtEndOfStream)

  s = fin.readline()
  fout.writeline(s)

  if ( instr(s, "Frame Bip") > 0 ) then

    s = fin.readline()
    while ( instr(s, "Mesh") = 0 )
      fout.writeline(s)
      s = fin.readline()
    wend

    ' this line is the start of the mesh and contained 1 bracket {
    c = 1
    while (c > 0)
      s = fin.readline()
      if ( instr(s, "{") > 0 ) then
        c = c + 1
      end if
      if ( instr(s, "}") > 0 ) then
        c = c - 1
      end if
    wend
  end if

wend
fout.close()
fin.close()

wscript.echo "all done :-)"
just paste into a text file and rename to "something.vbs". obviously your biped parts have to be named like "bip*"
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
Post Reply