PDA

View Full Version : Execute lscript though lscript



nickdigital
07-11-2011, 03:53 PM
Is it possible to execute an applied lscript though lscript? We can do the Apply Server part. We want to now execute what we've applied.

sami
07-11-2011, 05:16 PM
I'm not sure what you mean here? Can't you just add your LScript as a plugin and the use cmdseq to run it from another LScript?

(as opposed to using @insert or the library way of doing things...)

nickdigital
07-11-2011, 05:50 PM
Does that work only for Modeler? I'm trying to do this in Layout. I have a lscript to add a Motion Modifier lscript. I then want to invoke the added lscript.

evenflcw
07-11-2011, 06:42 PM
You mention you've used ApplyServer. And now you want to "execute" or "invoke" the applied server. This does not make sense. The persistent type servers (motion mod, custom obj, displ, master) don't need anything else than to be applied. After that they should be running, unless someone explicitly coded them not to, which isnt uncommon, if they require some basic settings to work on.

If you want to edit its internal settings from another script it needs to have a comring interface or some proprietary system using files, store/recall, etc. If you don't know how this interface is defined or it's compiled, there's really not much else you can do except "LWS editing", ie apply the server, save the scene, edit the scenefile (by script), and reload the scene.

nickdigital
07-12-2011, 10:51 AM
Yeah, LWS editing is an option. Good excuse to learn python.

Here's what we have going on. We've made a script to iterate through all the items in our scene to add Jeremy Hardin's Reference Motion lscript. The idea is that we'll have one master scene an animator animates with and then dependent scenes using the Reference Motion lscript for render passes. We've modified the Reference Motion lscript to automatically know where to look for the exported motion files based on our file structure. So, so far so good.

Unfortunately after applying the Reference Motion lscript the lws file crashes when we try to save it. We found that if we go through and open up and close each instance of Reference Motion then the lws file saves properly. My guess is that something in the lscript needs to be "executed" for it to properly "take" to the scene file.

My question is, is there a way to "call" the Reference Motion script...just to open and close it. I'm still learning lscript but my guess is that something in the Reference Motion script needs to be "executed". Would this be because it has a requester panel and we're bypassing that?

Again, thanks for your help.

evenflcw
07-12-2011, 11:09 AM
Open/close gui. Yes you can do that via the EditServer command or somesuch. And from your description I think your suspicions are correct, some functional code is likely placed in options.

nickdigital
07-12-2011, 11:15 AM
Open/close gui. Yes you can do that via the EditServer command or somesuch. And from your description I think your suspicions are correct, some functional code is likely placed in options.

Thx again.

nickdigital
07-12-2011, 12:55 PM
Open/close gui. Yes you can do that via the EditServer command or somesuch.

Well, I can get the window to open. How in the world do I get it to close...lol.

And will closing it actually be the same as hitting "OK"?

evenflcw
07-12-2011, 01:51 PM
Oops. I just figured it would toggle the window. Guess not. Sorry. But I really remember being able to toggle the interface of one of my master plugins. Must check on this.

I think you'll just have to edit the script some more then.

EDIT:
Nope. Found nothing. Likely I just removed and added the server back to toggle the gui. That obviously will defeat the purpose in this case.

nickdigital
07-12-2011, 02:19 PM
*sigh*

Thanks for looking.

xchrisx
07-12-2011, 06:23 PM
I would also second evenflcw's lws hacking. If you can open up a scene before toggling the gui and then open up one after you toggled and saved you could then write something that scans the other scenes and applies the differences by editing the LWS. Not an ideal plugin but no reason why it shouldnt work.

nickdigital
07-12-2011, 06:37 PM
Yeah, I already printed out the two lws files to see the difference. I know people are using Python to parse lws files and I've done notepad stuff before.

Was just hoping for a cleaner route on this.

Thx tho.

evenflcw
07-13-2011, 05:51 AM
In this case I would edit the script, since it's open source, not compiled and closed.

sami
07-13-2011, 08:40 AM
Yeah, I already printed out the two lws files to see the difference. I know people are using Python to parse lws files and I've done notepad stuff before.

Was just hoping for a cleaner route on this.

Thx tho.

I'd recommend getting a copy of BeyondCompare. It's excellent for text compares - plus it does folder compares (for syncing etc) really nicely plus more. I can't live without it, especially when learning a new file format or something.

nickdigital
07-13-2011, 10:44 AM
In this case I would edit the script, since it's open source, not compiled and closed.

Yeah, we're currently trying to do that.

nickdigital
07-13-2011, 11:09 AM
I'd recommend getting a copy of BeyondCompare. It's excellent for text compares - plus it does folder compares (for syncing etc) really nicely plus more. I can't live without it, especially when learning a new file format or something.

Thanks for the info.