PDA

View Full Version : Is LW9 Applescriptable?



Kuzey
08-04-2006, 07:15 AM
I'm thinking not but it would be cool if it were :thumbsup:

It just came up because I happened to read Chris Pitts post here and thought this needs to be done in one click:

http://www.newtek.com/forums/showthread.php?t=54998

:D

kuzey

Chilton
08-04-2006, 07:19 AM
Not yet, but it's definitely on my list. The issue is how far I can make AppleScript reach into LightWave without doing anything horrible to the source.

-Chilton

Kuzey
08-04-2006, 07:40 AM
Oooooo...it's on the list!!!

Wonderful :D

kuzey

Chilton
08-04-2006, 07:53 AM
For the record, I think AppleScript is an abominable language. I firmly believe it's the brainchild of people trying to put a nice face on C++, without learning anything from the years of feedback Apple had as a result of HyperTalk. HyperTalk could have easily been implemented system-wide, and the Mac landscape would have been considerably improved. That's all I'm going to say about that.

But yes, some degree of AppleScript support is being considered for a future version of LightWave.

Chilton
08-05-2006, 04:44 PM
Hi,

Aside from 'everything', what features would you like access to via AppleScript?

Thanks,
-Chilton

Captain Obvious
08-05-2006, 07:55 PM
I would like to be able to do ANYTHING via AppleScript. Just make it possible to issue lscript commands via AppleScript, and then return the result to the AppleScript. That should be the easiest way to achieve the highest amount of functionality. Sure, it means that you'll have to script in both AppleScript and lscript, but if it means less coding in AppleScript, I'm all for it.

Honestly, if you can sit and program and wonder about which tense a word should have for the code to work, there is something wrong with the programming language. And if "/Applications/Lightwave/some/****/folder/file" is "file of folder "folder" of folder "****" of folder "some" and so on and so forth (yes, I know that's not the ONLY way to write file paths in AppleScript)... you get my point. Bleh.

Chilton
08-05-2006, 08:11 PM
I would like to be able to do ANYTHING via AppleScript. Just make it possible to issue lscript commands via AppleScript, and then return the result to the AppleScript.

That sounds like a reasonable place to start. I'll look into it.


Honestly, if you can sit and program and wonder about which tense a word should have for the code to work, there is something wrong with the programming language.

Those who have not been forced to write an AppleScript have no idea just how hellish it is, and how accurate your statement is.

AppleScript is a mean joke on the programming universe. An attempt to shovel all the power that HyperTalk gave the user, back into Pandora's box.

I'm a (HUGE) fan of SuperCard myself. If it weren't for that environment, I wouldn't be the Mac junkie I am today.

-Chilton

Captain Obvious
08-06-2006, 06:06 AM
I never used HyperCard, or SuperCard. My relationship with AppleScript is kind of like an abusive husband and wife. I love what AppleScript can do, and how easy it is when it's easy. But when you try to write something more complex than a dozen lines of code, you're bound to run into syntax ****. :(

I think there is a replacement syntax out there somewhere. It works the same way, basically, it's just that you write something that looks more like a real programming language. But I cannot recall what it was called...

Kuzey
08-06-2006, 06:15 AM
I usually find an example from somewhere and change to suit my needs, writing a complex applescript is way over my head :D

The great thing with Applescript is the record button but that doesn't work with everything or everytime.

Now....if we had a record button for Lscript :thumbsup:

Kuzey

Captain Obvious
08-06-2006, 08:17 AM
I usually find an example from somewhere and change to suit my needs, writing a complex applescript is way over my head :D

The great thing with Applescript is the record button but that doesn't work with everything or everytime.

Now....if we had a record button for Lscript :thumbsup:

Kuzey
I've NEVER seen the record button work. Well, not since Mac OS 9, anyway.

As for a record button in lscript, try this: ftp://ftp.newtek.com/multimedia/eyeon/LScript1_Commander.mov

Chilton
08-06-2006, 10:09 AM
I agree about the record button. I believe they fixed it in 10.4.6 or .7 though!

I was absolutely astounded when I tried it (on a Finder script) recently, and found that it actually worked!

-Chilton

Captain Obvious
08-06-2006, 10:12 AM
Haha, that's cool! I'll have to try it once I get my main machine up and running again. (Typing this on an original iMac from 1998.)

habaņero
08-06-2006, 10:33 AM
What I would put at a higher priority than Applescript support is better mac support in Lscript. Like file system code that would "just work" on both platform, something that should be about as complicated as implementing code that has been posted on the Lscript list ...

What also would be sweet although I am at a slight loss at the connection to applescript is better web support/integration in LScript. Like, open it for simple automatic web update routines.

On a sidenote I really think Newtek should set up a server to make plugin urls work after a year, or in the case of unpredicted traffic ... And also to make the act of giving something for free to the LW community, not cost people money (for bandwidth). Obviously people would want to have the plugin on their own site, but the file could very well be on a Newtek server to great benefit and at a tiny cost to Newtek really.

I will have to think a little but the main idea I got for an LW applescript would be automagic update of plugins. Maybe harvesting help/instructions/notes/manuals as well, that you would have an applescript that was called "download as plugin" that would download the archive to the plugin folder, expand to a new folder, and then harvest the current page and downward links to either that folder or a central location with proper naming etc.
Maybe also as an append to a giant .txt or .pdf for fast search.

Other obvious uses could be to email or backup/sync to web the current open object or scene. Or to render to previews or icons, or quicktime 3d all the objects in a folder say.

Interesting thread!

And don't forget automator!

Chilton
08-06-2006, 11:56 AM
What I would put at a higher priority than Applescript support is better mac support in Lscript. Like file system code that would "just work" on both platform, something that should be about as complicated as implementing code that has been posted on the Lscript list ...


Noted!



And don't forget automator!

Automator rocks. I have not forgotten Automator.

-Chilton

Kuzey
08-07-2006, 01:01 PM
As for a record button in lscript, try this: ftp://ftp.newtek.com/multimedia/eyeon/LScript1_Commander.mov

I think I saw that...it's within Layout right?

I was talking about Modeler, imagine you click a record button and then after hours of modelling you save the Lscript as it's own file, send it to whoever and have them load it an press play :thumbsup:

It would be great for live tutorials and not to mention you'll have a complete history of the model...if you needed to go back to any stage.

As for Applescript, it would be great to control batch rendering, setting the output files, "save as" to a new file, take this object layer from this file and that layer from that other file and add them to a new blank project...in their own layers or combined into one layer etc. etc.

My mind is racing again :D


Kuzey

Chilton
08-07-2006, 11:26 PM
I think I saw that...it's within Layout right?

I was talking about Modeler, imagine you click a record button and then after hours of modelling you save the Lscript as it's own file, send it to whoever and have them load it an press play :thumbsup:

It would be great for live tutorials and not to mention you'll have a complete history of the model...if you needed to go back to any stage.

As for Applescript, it would be great to control batch rendering, setting the output files, "save as" to a new file, take this object layer from this file and that layer from that other file and add them to a new blank project...in their own layers or combined into one layer etc. etc.

My mind is racing again :D

Kuzey

Hi,

The first Apple guy I had a chance to meet today is one of the head AppleScript guys. I don't want to get his name (or job title) wrong, so I won't say who he is. But this is one of the topics we're definitely looking into. I plan on going over this thread in detail at the AppleScript lab, so post your requests now!

-Chilton

habaņero
08-08-2006, 01:50 AM
I have given this a little more thought and what now seems to me to be the single most logical use for this would be configuration synchronisation with .mac (and preferrably another more dual platform/cheaper ftp solution as well, although this would not need to aim for the same simplicity as you could easily attain with .mac).

I imagine the coding would be trivial, and it would be a feature that for once would make the PC crowd envious of the mac people ... It also would save literally hours of wasted and boring time spent carrying a setup around today ... A bonus would be if the configuration could be dual platform eg translated although I realise this might be too complicated to consider in a while.

To be specific I would like to have absolutely everything synced and backed up:

* The LW preference files
* All shortcuts
* All menus, maybe also backed up as single and properly named branches so they could be brought into someone elses LW setup non destructively.
* Hub config, particularly UI configuration including custom graphics.
* All plugins (!). Maybe with an optional filter to not include archives, since I guess it is common to have these lying around in the plugin folder.
* Option for more folders/specific files under the LW folder or elsewhere, like homemade Lscript documentation etc.
* Option for backing up assets automatically through the day, I guess keeping it to .lwo and .lws would be most people's chosen mode but it should be simple to keep a whole project folder safe. I think it could be useful to have a "safekeeping" and a "current work" setting, that a sync would only download files related to current work.
* Licence key

I probably forgot something but anyway, the general idea would be that you could install LW and the dongle driver on a new machine, login to your .mac, isync and ka-damm you are working from where you left.

To top it off it would be sweet if you could perform the sync in prioritized order piecemeal, in the case you would be working over a modem connection. So that you would not need to wait until the 200 mb texture from the current work folder downloads before getting your shortcuts installed ...

Given LW's config are plain text, it really can't be much of an effort to arrange something like this and as an example I would happily pay Newtek what I paid for the entire 9 upgrade to get just this single, simple feature!

Seems reasonable that you could easily add to such a feature later as well, .mac can share photos so why not configurations?

Further, I wonder if you could quite easily make scripts to enable collaboration over a network. As I understand the (currently challenged ...) hub supports this already but it would be interesting if you could say, have two or more modelers work on a single model and one rigger working on this model in Layout. It'd probably need some system for locking areas on the model and some conflict resolution but aside from that it should not be such a complicated matter .. I guess it doesn't have a lot to do with applescript besides that I have a model for this feature in my head and the programming is simple enough that it could be done in applescript given a system with locking parts of a model, with ownership and color coding ... What would be sweet would be if you could egt updates both from a server version (the "official" common file that people would update when they had an area finished, and that you would download before locking or unlocking something), and from the different owners, so that you would see the current content of the server version in one colour, then at the click of a button update to the current content version of another persons "work file" that would perhaps be in another shade of same colour. A collab with four people, your model would have parts in five colours, "unowned", and the four persons colours.

I have obviously travelled far from the original idea of the post, but to try and get back on topic I would also like to be able to store several LW configurations on my .mac account and preferrably modeler and Layout separately, so that I could have one modeler for ArchViz, one for organic one with UI for daylight and one for night, etc etc. It is most certainly possible to make this happen today, but it is a bit challenging to successfully manage different configurations if you are using more than one computer (and platform... !).

I will have to think some more, but anyways, it is highly appreciated that us mac users get such great treatment as this! Thanksalot!

Kuzey
08-08-2006, 05:33 AM
It would be great if you can get access to surface names and settings, be able to change them, if this surface exists then change it to this new name, combine this surface with that surface and give it this new name with this new surface shader. Be able to change all the surface names to have a prefix or extension, so this surface name "eyelids" can become "Topcat_eyelids_final" etc.

Applescripts can also run shellcripts, and that would be a great way to archive projects. IF Lscripts can talk to Applescripts or even Shellscripts themselves, then you can create a button in modeler or Layout that can archive the current front most project to a destination set by the user and have a choice to save all related files/folders with it or not, maybe just some but not others etc.


I must be going crazy, because I can see these things happening in my mind already :stumped:

:D

Kuzey

Whit
08-08-2006, 11:10 AM
It would be nice if it was possible to have LightWave use AppleScript the same way that you can use the command line in AppleScript using "do shell script." I'm hoping that would not be too hard to implement and would give some of the benefits of using AppleScript.

Currently using do shell script in AppleScript I can write AppleScript code similar to:


set copyFilesScript_orig1 to "cp -R " & orig1 & space & buPath & "/" & orig1Folder & "/"
set copyFilesScript_orig2 to "cp -R " & orig2 & space & buPath & "/" & orig2Folder & "/"

-- start running the scripts to copy files
ignoring application responses -- so that we don't wait for each one to finish
do shell script copyFilesScript_orig1 password pword with administrator privileges
do shell script copyFilesScript_orig2 password pword with administrator privileges
end ignoring



If something similar was available in LightWave that would be nice.

--Whit

Chilton
08-10-2006, 08:38 AM
It would be nice if it was possible to have LightWave use AppleScript the same way that you can use the command line in AppleScript using "do shell script." I'm hoping that would not be too hard to implement and would give some of the benefits of using AppleScript.

Currently using do shell script in AppleScript I can write AppleScript code similar to:


set copyFilesScript_orig1 to "cp -R " & orig1 & space & buPath & "/" & orig1Folder & "/"
set copyFilesScript_orig2 to "cp -R " & orig2 & space & buPath & "/" & orig2Folder & "/"

-- start running the scripts to copy files
ignoring application responses -- so that we don't wait for each one to finish
do shell script copyFilesScript_orig1 password pword with administrator privileges
do shell script copyFilesScript_orig2 password pword with administrator privileges
end ignoring



If something similar was available in LightWave that would be nice.

--Whit

So you (both o' ye) are talking about executing AppleScript from inside LightWave?

-Chilton

Whit
08-10-2006, 11:49 AM
No, both of me (wait, there is only one of me :^> ) was thinking that it would be nice to be able to start an AppleScript that would start Modeler or Layout, and then execute LScript commands.

I have, however, thought more about this and I withdraw my "thinking." I would rather that development efforts were spent on other more important things than implementing AppleScript.

Another problem with AppleScript in LightWave is that I agree with Newtek's efforts to maintain Mac/Win parity of features.

--Whit

Kuzey
08-11-2006, 04:59 AM
I say lets forget about the Win side and make the Mac version the best version :D

It would be cool if Applescript can work inside and outside of LW, but things like changing a bunch of names, settings etc. on the fly would be great if you can do it with and without Applescript, depending if you have LW open or not.

Is it possbile to make an Applescript plugin so it can be used inside LW?

A Shellscript/commandline plugin would also be nice :thumbsup:

Kuzey

Phil
08-11-2006, 05:33 AM
Windows does have the WSH system, supporting javascript amongst others, so it would be possible. You just need a bridge to the external scripting system so that you can talk to LS. LW back in the day had Arexx (http://en.wikipedia.org/wiki/AREXX) support on the Amiga for this kind of thing.

Chilton
08-11-2006, 08:40 AM
The absolute hilite of WWDC this year was something regarding this thread. I edited this post to remove something that I should probably keep under wraps right now. But I had some *stellar* help at WWDC. Totally worth the trip.

-Chilton

Phil
08-11-2006, 10:06 AM
Too late to stop the email notifications :foreheads How much is it worth to keep quiet, hmmm? :devil: ;D

Chilton
08-11-2006, 11:23 AM
Too late to stop the email notifications :foreheads How much is it worth to keep quiet, hmmm? :devil: ;D

Well, I don't want to get people's hopes up. It's not fully functional yet, and until I see it working, I'm hesitant to believe it's as easy as the Apple guys said it would be. I'm cautiously optimistic.*

Also, this will hopefully prompt people to read the forums more closely, or at least subscribe to the email notifications ;-)

-Chilton

eblu
08-11-2006, 01:12 PM
chitlon...

app management stuff, such as the cleaning of pref files, the changing of content dirs, the setting up of configs for render nodes, crash reporting features,
the ability to tell LW to render a particular frame of a particular scene file, with the ability to modify the details In the applescript.



Hi,

Aside from 'everything', what features would you like access to via AppleScript?

Thanks,
-Chilton

Kuzey
08-12-2006, 06:05 AM
Sorry Chilton,

My hopes are sky high but luckily my feet are still planted on the ground :thumbsup:

I just call me stretchy :)

Kuzey