PDA

View Full Version : Create a list of all assets to a scene



dblincoe
05-16-2012, 06:31 PM
Anybody know of a way to make/export a list of assets (objects and images) used in a scene and their path. I see you can export a list of images used, but I don't see the same for objects. Would be nice if you could export a list of everything that is an external reference to a scene including used plugins. I'd like to make sure all assets get transferred. I realize you can "package" a scene but I'd rather have a list.

Any ideas?

rcallicotte
05-17-2012, 06:43 AM
I thought the LWS file was like a big list of all of this...did you check it in Notepad?


Anybody know of a way to make/export a list of assets (objects and images) used in a scene and their path. I see you can export a list of images used, but I don't see the same for objects. Would be nice if you could export a list of everything that is an external reference to a scene including used plugins. I'd like to make sure all assets get transferred. I realize you can "package" a scene but I'd rather have a list.

Any ideas?

jeric_synergy
05-17-2012, 07:51 AM
I thought the LWS file was like a big list of all of this...
No. For instance, image map information FOR MESHES is in the LWO file.

Offhand, that's the only thing I can think of that isn't embedded in the LWS.

++++
One could package a scene, and then do a recursive DIR listing of the contents of the new folder (and then immediately delete it), but that's clumsy.


Open Windows Explorer and locate the folder that you want a to save a list of files. Hold down the SHIFT key, right click the folder, and select the Command Prompt item.

In the command prompt, type the following command.

dir > filename.txt

Press ENTER.

(Make sure the command includes the spaces)

This will create and place a text file in that folder called filename.txt with a list of all the files in the folder.

use the /s switch to recursively list all the subdirectories, as in:
dir > filename.txt /s

dblincoe
05-17-2012, 07:53 AM
I thought the LWS file was like a big list of all of this...did you check it in Notepad?

Well, it is, but it contains a lot of extra data to weed thru. I was wondering if there was a way to get a cleaner text file (like the image asset list) but for all objects, plugins, images & sound.

Guess this method will work, but require a lot of weeding and deleting in a text editor.

Thanks.

jeric_synergy
05-17-2012, 08:04 AM
I see you can export a list of images used, .....
Really? Where?

dblincoe
05-17-2012, 08:20 AM
Really? Where?

In Layout: File > Export > Image List

evenflcw
05-17-2012, 08:32 AM
Get a texteditor that has support for regular expressions, learn regular expressions, write some expressions, record macro executing expressions, done - reusable tool created! Learn a bit of lscript ontop of that and you could make a script to run from within LW (lscript has limited but enough regexp support).

PS: Naturally you could python it aswell... but if lscript is sufficient for the task, I'd favour lscript until we are atleast at LW12 or 13, as I figure not even half the userbase has upgraded yet.

jeric_synergy
05-17-2012, 09:04 AM
All in all, using PACKAGE SCENE seems like less work. Doesn't give the plugins though.

Ahhh, how I miss AREXX.

xchrisx
05-17-2012, 09:06 AM
Here is something I whipped up real fast this morning so if there is a bug I apologize :) . It will save out paths to all images and objects (with the exception of nulls) to a text file of your choosing. Its open source so you can customize it however you like.

edit: Forgot to mention: Its a generic layout script

-chris

dblincoe
05-17-2012, 06:24 PM
Here is something I whipped up real fast this morning so if there is a bug I apologize :) . It will save out paths to all images and objects (with the exception of nulls) to a text file of your choosing. Its open source so you can customize it however you like.

edit: Forgot to mention: Its a generic layout script

-chris

Always there with a script to save my bacon! I'll give it a shot.
Thanks.

dblincoe
05-17-2012, 06:29 PM
Here is something I whipped up real fast this morning so if there is a bug I apologize :) . It will save out paths to all images and objects (with the exception of nulls) to a text file of your choosing. Its open source so you can customize it however you like.

edit: Forgot to mention: Its a generic layout script

-chris

Works like a charm! I like how you "whipped it up." You rock!:thumbsup::thumbsup:

dblincoe
05-17-2012, 06:38 PM
Here is something I whipped up real fast this morning so if there is a bug I apologize :) . It will save out paths to all images and objects (with the exception of nulls) to a text file of your choosing. Its open source so you can customize it however you like.

edit: Forgot to mention: Its a generic layout script

-chris

Hey Chris...check your email. :beerchug: Thanks again!
Dan

xchrisx
05-17-2012, 06:51 PM
Thanks Dan, much appreciated.

daforum
05-19-2012, 04:10 AM
Here is something I whipped up real fast this morning so if there is a bug I apologize :) . It will save out paths to all images and objects (with the exception of nulls) to a text file of your choosing. Its open source so you can customize it however you like.

edit: Forgot to mention: Its a generic layout script

-chris

Great script xchrisx :thumbsup:

Does it do Dynamics too? I'm not a scripter but I was wondering if it's possible to copy and paste in a section of the script where it says about writing images but replace the word "images" with "Dynamics" as an addition to the script.
If there aren't any Dynamics in the scene would it say "Dynamics None"?
Would this work or am I being too simple?

jeric_synergy
05-19-2012, 04:53 PM
When you say "dynamics", do you mean references to external PFX files and such?

daforum
05-20-2012, 06:52 AM
Yes, PFX, mdd, bdd etc.
In the same way that images and objects are listed in the text file.
Could be useful as scenes often use them.

xchrisx
05-20-2012, 10:26 AM
Unfortunately its not as easy to retrieve the pfx mdd etc. For that you would need to have it parse the scene file and look for those extensions.

jeric_synergy
05-20-2012, 12:32 PM
(allergies killing me, apologies if this makes no sense...)

Are pfx references even maintained by Layout? That is, once they are loaded/applied, aren't they part of the scene file?

dblincoe
05-20-2012, 01:06 PM
Unfortunately its not as easy to retrieve the pfx mdd etc. For that you would need to have it parse the scene file and look for those extensions.

Hey Xchrisx. Is there a way to also add a list of the master plugins used in a scene? What I see this plugin being used as a comment or read me file that accompanies the scene file and assets. This would be sent with the assets to another studio, etc. and they could check their resources to make sure they have these plugins. Also gives me a file to make sure I package everything.

I checked around and didn't see anything in the script docs that references the master plugins, but I could be mistaken and have missed it.

As always, thanks!
-Dan

xchrisx
05-20-2012, 02:13 PM
Pfx files are referenced, they dont get embedded. However If you look into a scene file you will notice that a plugin references it so it can be a bit harder to extract the path.

As for the master plugins, there is a way to get the plugin name but the path to the plugin located in a different file. Lwext if im not mistaken .

xchrisx
05-20-2012, 02:50 PM
So here is an updated version, once again I didnt spend much time on it doing error checking so let me know if you run into errors. I updated it to support master plugins as well as PFX files (if an emitter doesnt have a pfx file attached to it, it will not report an error it will just skip over it). I also commented the code so feel free to pick it apart and customize to your liking.

-chris

jeric_synergy
05-20-2012, 04:05 PM
Pfx files are referenced, they dont get embedded. However If you look into a scene file you will notice that a plugin references it so it can be a bit harder to extract the path.
??? So, the filename is stored, but not the path???
:stumped:

+++
{crossposted}
Thanks Chris, and thanks for posting uncompiled scripts so we can learn from them! UDM! (you da man)

xchrisx
05-20-2012, 04:12 PM
Maybe i misunderstood what you meant. It does contain the the path but not the data from the file.

daforum
05-21-2012, 02:28 PM
Thanks xchrisx. It works very well here (Mac user)

It was about writing the path of the Dynamic and not the Dynamic file itself (pfx in this case) that i was interested in; and if I could simply add to the script.

dblincoe
05-21-2012, 02:32 PM
Thanks xchrisx. It works very well here (Mac user)

It was about writing the path of the Dynamic and not the Dynamic file itself (pfx in this case) that i was interested in; and if I could simply add to the script.

Thanks for the update! Works perfectly here too! Exactly what I was needing to send a list with a packaged scene and double check the assets!

You rock man!
Dan

xchrisx
05-21-2012, 03:15 PM
daforum: did you mean you just want the Dynamics folder and not the path of each pfx? That is a pretty easy fix to the script if that's what you want.


Glad to see it works on mac. I know that Dan uses a mac so I tried to make it mac friendly. But I never know with scripts though because I dont have a mac to test it on.

jeric_synergy
05-21-2012, 04:42 PM
It was about writing the path of the Dynamic and not the Dynamic file itself (pfx in this case) that i was interested in; and if I could simply add to the script.
"path of the Dynamic" -- wtheck does that mean? :stumped:

daforum
05-22-2012, 04:04 AM
daforum: did you mean you just want the Dynamics folder and not the path of each pfx? That is a pretty easy fix to the script if that's what you want.

The path of the Dynamics, just like the Images and Objects like this:

eg:
Images
/Applications/LightWave3D 9.6/projects/ball/Images/ball.jpg

Objects
/Applications/LightWave3D 9.6/projects/ball/Objects/ball.lwo

Dynamics
/Applications/LightWave3D 9.6/projects/ball/Dynamics/ball.pfx
/Applications/LightWave3D 9.6/projects/ball/Dynamics/ball.mdd
/Applications/LightWave3D 9.6/projects/ball/Dynamics/ball.bdd

but this may not be possible for the Dynamics example as you have said in a previous post. If it is possible that would be great.
If it's not possible then just the Dynamics folder will be cool.

Sorry if it's causing confusion, I must have written previous posts when I was half asleep!!
Thank you xchrisx for doing this, and being patient with me :)

daforum
05-22-2012, 04:23 AM
daforum:Glad to see it works on mac. I know that Dan uses a mac so I tried to make it mac friendly. But I never know with scripts though because I dont have a mac to test it on.

I use a number of your scripts on my Mac, and they all work without any problems.

I know that the only time I can't use them is when they contain any lines of code that are Windows specific, like "C:\\temp"
as a Mac doesn't have one of those!

jeric_synergy
05-22-2012, 09:06 AM
The path of the Dynamics, just like the Images and Objects like this:
....

Dynamics
/Applications/LightWave3D 9.6/projects/ball/Dynamics/ball.pfx
/Applications/LightWave3D 9.6/projects/ball/Dynamics/ball.mdd
/Applications/LightWave3D 9.6/projects/ball/Dynamics/ball.bdd

::sigh:: So, you want path+filename.

That was the long way around the house. Were you concerned you'd ONLY get the filename?

xchrisx
05-22-2012, 09:10 AM
I use a number of your scripts on my Mac, and they all work without any problems.

I know that the only time I can't use them is when they contain any lines of code that are Windows specific, like "C:\\temp"
as a Mac doesn't have one of those!

If you run across one of those let me know and I will update it, it is a pretty quick fix. I have made so many scripts I tend to lose track of which ones I put that in. Also a lot of the time I am in a hurry producing the scripts so I tend to hard code paths rather than make it relative to the OS's temp folders.

daforum
05-23-2012, 10:52 AM
Thanks xchrisx.

I did try your "Points_to_Nulls" script the other day and that had a problem. When I opened the script there was a "C:\\temp" in there so I assumed that's why it wouldn't work.

These are the ones I use on Mac:

cp_addrandomrotation.ls
cp_centerpoint.ls
cp_ClearLyrNames.ls
cp_clonerename.ls
cp_clonetolayers.ls
cp_janitor.ls
cp_mirrorpoints.ls
cp_polytosurfaces.ls
cp_randomcolor.ls
cp_rename.ls
cp_replacewithlights.ls
cp_sameposition.ls
cp_sceneAssets.ls
cp_sendtonext.ls

xchrisx
05-23-2012, 10:05 PM
I will fix that script the next chance I get. Thx for the heads up.