PDA

View Full Version : Is there a script that can export an object list?



daforum
07-14-2010, 04:42 AM
Is there a script anyone knows of that can export an object list from Layout, as a text file for example?

Would be a great help as the current scenes i'm working on have a lot of objects in it.

Thanks :)

Matt
07-14-2010, 06:57 AM
Have you checked the obvious sites:

http://www.lwplugindb.com/

http://www.flay.com/

Failing that, it should be easy to knock up, might take a look at it for you.

Myagi
07-14-2010, 06:59 AM
I modified one of my export tool scripts to save a list :) However the question is what exactly you want it to list. A list of lwo files in the scene? If so, how should it handle lwo layer items?

daforum
07-15-2010, 06:21 AM
Have you checked the obvious sites:

http://www.lwplugindb.com/

http://www.flay.com/

Failing that, it should be easy to knock up, might take a look at it for you.

Thanks Matt for offering to do this :) I have checked around and couldn't find anything.


I modified one of my export tool scripts to save a list :) However the question is what exactly you want it to list. A list of lwo files in the scene? If so, how should it handle lwo layer items?

Yes, a really simple script that just lists objects as they are listed in Layout, all names the same even if layered objects are un-named in the scene from modeler.

Myagi
07-15-2010, 08:42 AM
Not sure I understood exactly what you want.

Do you want the lwo file names (with full path), like:

C:\blah\object.lwo


or the object names as displayed in Layout's object list:

SomeObject
AnotherObject:Layer2


The former also also poses some issues that it doesn't specify a layer and a single lwo might appear multiple times (for clones or two different layers of the same object). Issues that could be worked around, but unecessary if all you want is the Layout name.

I'm attaching a first draft that just lists lwo files (duplicates possible) without additional handling, alternatively you can comment/uncomment the lines that save the names to convert it to saving object names. In case you you needed something more elaborate I'll see if it's easy to add.


edit: updated attachement

daforum
07-15-2010, 12:27 PM
Myagi, thank you so much for the script. I have tried it out and it works very well.

I would like to use a version of the script as you suggest that just has the object names as displayed in Layout's object list:

SomeObject
AnotherObject:Layer2

as this seems a simpler way to see the objects as a list. It gets a bit confusing when a single lwo appears multiple times; and Nulls are also not necessary to appear in the list.

It is very kind of you to do this, and at this point I wish I knew more about how to compile scripts so I could do the same for you.
Many thanks. :bowdown:

Myagi
07-15-2010, 01:07 PM
If you open the script in a text editor you'll see this on line 65 and 66


//listFile.writeln(mesh.name);
listFile.writeln(mesh.filename);

if you change that to


listFile.writeln(mesh.name);
//listFile.writeln(mesh.filename);

(ie. uncommenting line 65 and commenting out line 66)

it willl list names instead of lwo filenames.


I don't think nulls are listed right now, or? The intent was to only list mesh(/lwo) objects. no cameras, lights etc.

edit: I guess nulls are also Mesh objects. I'll add a check for that.

Myagi
07-15-2010, 01:16 PM
Updated the script in the post above, also changed it to save object names instead, while I was at it.

daforum
07-15-2010, 05:07 PM
I tried the updated version and it's just what I needed. It works so well and just lists the objects and layer number. :thumbsup:

I may still use the other version though from time-to-time as I have objects in sub-folders within my object directory, and the 1st version of the script will help me to locate any I can't find straight away.

I hope other LW users find this script, as you have helped the community and not just me.

Thank you so much :)

Matt
07-15-2010, 06:54 PM
Thanks Myagi, saved me a job! :)

I did make a little tweak though, hope you don't mind.

To make it a little more helpful with typing the file name, I made the script put the 'scene name' + "-Object_List.txt" in the file save dialog.

Myagi
07-15-2010, 10:28 PM
I did make a little tweak though, hope you don't mind.

Not at all, that's the idea otherwise I would have made it an .lsc :)

daforum
07-16-2010, 02:34 AM
Thank you both for a great script. Now that it can automatically add scene name + -Object_List.txt in the file save dialog is a great addition to an already very useful script.

Thanks again :)