PDA

View Full Version : Macro Builder - Python Script ???



tcoursey
01-28-2015, 01:28 PM
Is there a Macro builder in Lightwave 11.6.3? I do a very repetitive task when setting up certain scenes and want to automate the process. I'm sure it could be done with a python script of some sort but know nothing of it. If someone wants a "project" task and wants to help, or can point me to a Macro builder plugin would be great!

ie...
I setup panorama cameras for scenes. I setup an advanced camera with FOV 90 degrees square pixel dimensions (1600x1600).
Then go in and rotate the camera 90 degrees each direction then up and down 90 and -90

Would be great to point in initial direction, start plugin and have it add 90 deg. to the camera make new key on next frame add 90 more, make key 3rd frame etc..etc...

magiclight
01-28-2015, 01:38 PM
I am still new to this so maybe I am totally wrong here, but would it not be possible to do something with the Utilities / Command menus ?

ernpchan
01-28-2015, 01:52 PM
There's LSCommander. It'll get you started in the right direction. You'll probably need to dive into actual scripting to get to the finer details that you want.

tcoursey
01-28-2015, 02:25 PM
I am still new to this so maybe I am totally wrong here, but would it not be possible to do something with the Utilities / Command menus ?
I don't think so...but may be wrong.


There's LSCommander. It'll get you started in the right direction. You'll probably need to dive into actual scripting to get to the finer details that you want.
Yea I've seen it but honestly don't want to dive into scripting right now!

Just wish the actual MACRO RECORDER under Master Plugins worked. Maybe I'm doing something wrong but I can only get it to save one command in my series of commands. Saves as .ls file which would be great, then could edit and fine tune as you mention...

Anyone else with any thoughts?

ernpchan
01-28-2015, 02:38 PM
From your initial post, it sounds like a repetitive camera motion. What about having a generic scene that you use as your default scene.

Or is your scripting request more complicated than that?

tcoursey
01-28-2015, 02:41 PM
From your initial post, it sounds like a repetitive camera motion. What about having a generic scene that you use as your default scene.

Or is your scripting request more complicated than that?

True I think I might could get a default camera and import from scene. Not sure if that will completly work or not because it will be in different locations in each scene. Maybe parented to a null that I could move around in new scene...hmmm.

tonyrizo2003
01-28-2015, 03:52 PM
see this link
https://www.youtube.com/watch?v=96lyQR89UC8

MonroePoteet
01-28-2015, 04:01 PM
As ernpchan says, LS Commander may be what you need. It's a little cumbersome to use, but it will record what you do and allow you to save it as a "session" or convert it to LScripts.

It's basic operation is to record events as you issue commands (including mouse-directed motions, etc.) to Layout. These are recorded in sequence in the lower window. You can paste events from the lower window into the upper "Session" window by right-clicking on them (sadly, there appears to be no way to select and copy a whole sequence that I've found). Once they're in the upper window, you can use the Session => Convert to LS to convert the events to equivalent LScript commands. This can then be saved as an LS plug-in by pressing the Install button.

The installed LS plug-ins are accessible from the bottom of the Utilities => Additional Plug-ins menu item. They could also be assigned to menus or keyboard shortcuts. For LW 11.6, they are saved in


<user-folder>\.NewTek\Lightwave\11.6\scripts\macros

so you could also copy them elsewhere. In LS Commander, you can save the "Session" of events out and load it up later for future modifications. IMO, it's nice to convert them to LScript, since it's a great way to learn basic scripting associated with user actions in Layout.

The basic operation is:


1) Get into Layout
2) Bring up Utilities => LS Commander
3) Minimize LS Commander (it'll continue recording events in the background)
4) Do the work required (e.g. Select Camera (C), position (t), numeric (n), enter 0,5,-10, rotate (y), manually rotate the camera using the mouse, etc.)
5) When you're done, bring up LS Commander again
6) In the lower window, scroll to find the sequence of events you want. The names are usually pretty obvious.

NOTE: the events are recorded until you stop LS Commander. If you want to clear the event list, you need to stop LS Commander by removing it from the Master Plugins list, and restart it
7) For each event you want, right-click on it to copy it into the upper Session window. You can leave out mistakes you made in step (4)
8) When all events are copied, use Session => Convert to LS, the equivalent LScript will appear in the upper window
9) Use Install to add the LScript "plug-in"
10) Use Edit Menu Layout or Edit Keyboard Shortcut if you want the macros more easily accessible

mTp