PDA

View Full Version : Can LScript Do This? (part 2)



cayd
02-14-2010, 05:02 PM
Is this possible with LScript? If not this is my bid for the wish list.
First of all, Iíve gone through most of the docs, but I havenít necessarily scoured them. So, if itís in there, I apologize. But I have made a pretty honest attempt to go through it.

Also, this functionality is more indicative of object oriented code. Which, of course, LScript is not. Right? Nevertheless, I figured it would be good to ask anyway.

Can you make a script call another script and / or another plug-in?

What about an LScript global variable thatís global not just to the script but to other scripts within the scene as well?

- cayd -

evenflcw
02-14-2010, 05:51 PM
You can execute/start another script/plugin via CommanInput(), ApplyServer(), cmdseq(), meshedit() depending on what type/class of script it is. You might have to add something to the name of the plugin, for example, Layout generics have a prefix "generic_[actual name of plugin]" when executed via CommandInput. You generally can't send arguments to other plugins.

For layout-global variables use store/recall, read/write to file, the so called IPC mechanism, comring, or if you absolutely must globalstore/globalrecall.

EDIT: store/recall might not be global. Not sure.

Dodgy
02-14-2010, 09:45 PM
You can also use the com-ring to send commands to other plugins, as long as they have been written with this in mind (so usually plugins you have written yourself).

You can use the com-ring with the item shape custom plugin for example.

http://www.mikegreen.name/Lscript/Lscript%20Index.html

Look at the com ring section.

cayd
02-15-2010, 10:35 AM
First off, thank you guys. Seeking help from this group has been looooong over due!!

I'm not familiar with the com ring, is that the command ring? I did a search for both in both the user guide and reference and found nothing. I entered a search for ďCommandImputĒ and ďApplyServerĒ with the same results.

It has been a while, but I have read through the entire user guide. With the exception to info on modeler scripts, which I currently donít have use for. I know if I had run across info on a com-ring I would have noted it.

Any documentation on these subjects I will eagerly absorb!

Thanks, Cayd

evenflcw
02-15-2010, 10:58 AM
It's "com"ring for communication ring.

What you didn't find is explained in release notes predating and postdating the reference/user manuals. They are included in the lwsdk (for c plugins). So maybe download that from lightwaves homepage or use the resource Mike provided (which has combined docs and release notes.

Matt
02-15-2010, 01:28 PM
Take a look at these scripts I wrote that run other commands / lscripts

(Scroll the whole way down the thread for the latest versions)

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

cayd
02-15-2010, 08:44 PM
right on! i will look at that soon.
- cayd -