PDA

View Full Version : parsing lw object file via commandline?



Kuzey
08-25-2006, 04:23 AM
Hi guys,

Here's a new one I think, is it possible to parse a Lw object file using the commandline/shellscript so it saves a copy of the object as a text file :D

Any hints, because those sdk thingy's are way over my head 8/

Kuzey

Kuzey
08-27-2006, 04:47 AM
So I guess that means no it can't be done or we are too busy fixing/playing with LW9 to try it out :D

:thumbsup:

Kuzey

Chilton
08-27-2006, 07:49 AM
Busy fixing, no time for fun...

Ask me again in a few days, after the dongle problems have died down.

-Chilton

Kuzey
08-28-2006, 07:31 AM
Chilton, you have a deal...tomorrow, I'll be going to the island of Chios for a few days :thumbsup:


Kuzey

Chilton
08-28-2006, 08:42 AM
Hi Kuzey,


Chilton, you have a deal...tomorrow, I'll be going to the island of Chios for a few days :thumbsup:


Wow, Chios--that's really cool. Take pictures :D

-Chilton

jeremyhardin
08-28-2006, 10:41 AM
you could do some basic object parsing using lscript. for example, below is some VERY basic outputting of the binary as text with no real formatting. But what would be better is if Ernie Wright's BinView plugin (http://mywebpages.comcast.net/erniew/getstuff/binview.html) were ported to Mac. Especially since the source code is included in the SDK examples. :thumbsup:

@version 2.2
@warnings
@script modeler



fin = 0;


main
{
currentobj = Mesh();
file = currentobj.filename;
if(file == nil)
{
return;
}
//save all curent layer in file for retrieve pivot = point
save(file);

//open file created for = reading
f = File(file,"rb") || error("Cannot open file",file,"'");
g = File(file + "_output.txt","wa");

totalbite = f.linecount();
formatting = 0;
while(fin < totalbite)
{
zozo = f.readByte();
g.write(zozo);
g.write(" ");
g.writeByte(zozo);
fin++;
if(formatting == 16)
{
g.nl();
formatting = 0;
}
else
{
formatting++;
}
}


}

Kuzey
09-05-2006, 08:28 AM
Hi Chilton,

Is the red dongle issue over....I could ask in another week or two :D

Jeremy,

That's very cool indeed but it would be best to do it without the need to have LW open, but it would be cool if Lw could save an object as text file. I'm also wondering if can you run a shellscript in a Lscript, that could open archiving and what not within lightwave :beerchug:

What I was thinking is to import a lw object change some things, surface names, texture locations etc. and resave as a new lw object file.


Kuzey

byte_fx
09-05-2006, 01:29 PM
Haven't tried it recently but back in Lightwave 4.x days I'd use a text editor capable of opening binary files to change things like surface names, image location references, etc.

Seem to recall that earlier versions of Wordpad worked but later versions didn't.

Anyway - if you try something like this obviously you shoukd do it on a copy.

byte_fx