Page 1 of 1

Layer scripts to be referenced only by name

Posted: Sat Oct 25, 2008 1:19 pm
by Dodgy
I would like to see the layers script references in the anme file just be the script file name, rather than the whole path, as this stops scenes being easily portable from one artist to another. If the script exists somewhere in the Scripts folder in the AS directory, AS should find them and load them. This means all scripts should have a different name, but I think it's very rare that two names will be the same (don't they have to be all different names anyway?)

As it is, if user A keeps AS in B:\Art\Anime Studio, and use B keeps AS in P:\anime Studio pro, then all layer_script references in scenes swapped between them will be wrong.

Posted: Sat Oct 25, 2008 9:08 pm
by heyvern
If you keep scripts in a folder below the file name it won't lose the reference. It will then use a relative path to the script:

Project folder
----> Anime Studio File
----> Script folder
-----------> Layer script file
-----------> Another Layer script file
----> Audio folder
-----------> Sound file
-----------> Another sound file
----> Images folder
-----------> image file
-----------> Another image file

Now if you drag this whole structure to a new computer all the links will be maintained.

-vern

Posted: Sun Oct 26, 2008 5:58 am
by Dodgy
Thanks, that will be most useful. It would be more useful if it worked the way i asked, I think, but this works for me :)

Posted: Sun Oct 26, 2008 6:24 am
by synthsin75
You could write a menu script that would have the user select their AS installation folder. Then as long as they have the layer script in, say, ...ASP/scripts/layer/*, it'll be found. You'd need to write that path to the file, but that can also be done by the same menu script.

If passing this file back and forth, this menu script would need to be run each time. Also, it'd do no good if the other person didn't have the same layer script in the same location within the AS installation folders.

Posted: Sun Oct 26, 2008 9:32 pm
by heyvern
Synth, sadly the embedded script property isn't accessible like an image or audio path. Almost all the properties of a layer can be scripted EXCEPT the darn embedded script... ARRRHHHHGGG. This would be a pretty cool trick if it could be done.

I had to check first because I got all excited. :(

-vern

Posted: Sun Oct 26, 2008 10:50 pm
by synthsin75
Vern, I was just talking about pulling it from the file format, since you can find it easy enough searching for 'layer_script'.

Not really something I have a need for, so I'm just putting the idea out there if someone else really needs something like this. Not a script I'd be interested in writing, though it should be easy enough, I think.

:wink:

Posted: Sun Oct 26, 2008 10:54 pm
by heyvern
If you write new info to the open AS file I don't think it "updates" in AS unless you reopen it... I've never tried it though. If it works it could be a god send for production environments.

I may try it out.

-vern

Posted: Mon Oct 27, 2008 12:11 am
by synthsin75
Well, I wouldn't expect it to update, but since this only needs to run once for each transfer of the file, I think just reopenning the same file (without closing AS) should work.

:wink:

Posted: Mon Oct 27, 2008 6:55 am
by heyvern
synthsin75 wrote:Well, I wouldn't expect it to update, but since this only needs to run once for each transfer of the file, I think just reopenning the same file (without closing AS) should work.

:wink:
Actually maybe this could be even easier using some kind of "external" batch editor application using that windows basic.. programming... thingy. Suppose you need to transfer a whole bunch of AS files, you could just run them through a batch text editor to modify the path to the scripts.

An absolute path works ANYWHERE. The exact same path string would work in any file no matter where it is on the computer. You could even put the scripts in any folder instead of in the application folder as long as it was "above" the AS file.

-vern

Posted: Mon Oct 27, 2008 7:46 am
by Dodgy
The way it works in LightWave is the program has a list of installed plugins/scripts, and when the scene is written it only saves the name of the script in the scene, not the absolute path, so you just have to have the script in the LW plugins directory, not anywhere else.

I'm kind of torn between that, because you only need one place to keep scripts, or the AS way of doing it, because the scripts get backed up/copied wherever the .anme files are, so you'll never be in the position of digging up the scene only not have it work because you don't have the script anymore.
On the other hand, if you find a bug in the script, you have to update alllll the copies of the script wherever it's been copied to, whereas in LW you just update the one script.