PDA

View Full Version : Free Script: Run Modeler Plugin v1.0



Matt
03-01-2009, 04:34 PM
Collects and presents all the names of the plugins in the LWEXT*.cfg file alphabetically! Also allows for searching.

Useful if you have just installed a plugin and you want to test it temporarily, but don't want to add a new button for it just yet.

Thanks to Mike Green for his excellent LScript resource (http://www.mikegreen.name/Lscript/Lscript%20Index.html).

Without which I would have been very stuck!

As usual, the code is uncompiled and commented for anyone wishing to learn from it.

Cheers
Matt

zapper1998
03-01-2009, 04:38 PM
thanks will come in handy.... yes it will .. :)

LightFreeze
03-01-2009, 04:58 PM
Very Nice, thanks

Matt
03-01-2009, 07:14 PM
Did a version for Layout. Although not all scripts are listed, only types of 'Generic'.

Matt
03-01-2009, 07:41 PM
Dang! Just noticed something.

The 'Run Modeler Plugin' script at the moment only adds "CommandSequence" classes and not "MeshEditTool" classes.

LScripts and Plugins of the "CommandSequence" variety can be run by using the command 'cmdseq(COMMANDNAME)', not exactly sure how I do the same with plugins of the "MeshEditTool" class.

If I figure that out I'll make it work with those too, does anyone know?

Cheers
Matt

evenflcw
03-01-2009, 08:24 PM
Use the For... um search!

Well actually, I don't believe you can start MeshEditTool plugins (Move Tool etc), but you can execute MeshDataEdit plugins, with meshedit(). Use similarly to cmdseq().

It sounds strange that your script would only list other lscripts. Whether .ls or .p they are treated the same when they are of type CommandSequence. Are you really sure? (Btw, MeshDataEdit and MeshEditTool types are not available to lscript).

Cool script.

Matt
03-01-2009, 08:46 PM
I edited my previous post, the script does load .p and .ls / .lsc command sequence plugins.

But I can only run those types using cmdseq();

I tried all these:

CommandInput(NAME);
meshedit(NAME);
command(NAME);

But none would run any "MeshEditTool" classes of plugins, for example "Rounder".

Matt
03-01-2009, 09:14 PM
Okay, I got it to run "MeshDataEdit" classes, just need to add the code to check which class type the plugin is.

zapper1998
03-02-2009, 12:54 AM
ok

Matt
03-02-2009, 11:10 AM
Okay, I think I have this working now. It will list and run any .p / .ls / .lsc plugins of the CommandSequence or MeshDataEdit variety.

As far as I'm aware these are the only two types you can actually run from LScript, so it should cover most plugins.

Cheers
Matt

art
03-02-2009, 12:04 PM
Thanks. I'll find it very useful.

funk
02-03-2011, 10:56 PM
Matt I just tried this in lw10

First off it looks for LWEXT*.CFG and filters for *.cfg files. The problem is I dont add plugins manually, so mine are autoscanned and listed in "Extension Cache" because it doesnt show up due to the *.cfg filter. I just typed the file name by hand and it works. You need to update this for lw10 so it scans both extension files.

Second problem: If I press "clear", the next time I start the plugin it starts up with a search term already entered except its gibberish. Might be an lscript bug in lw10

funk
02-04-2011, 12:25 AM
I know nothing about lscript but after reading up on it, this looks like a lw10 lscript bug in globalrecall().

If you replace the globalrecall() and globalstore() with recall() and store() it works correctly.

Reported it as fogbugz case 36713

funk
02-04-2011, 12:59 AM
More info:

I noticed store() stores values in the registry as "str::searchstring"
yet globalstore() stores it as "searchstring".

This is causing problems in lw10 globalrecall() if "searchstring" is nil.

if I store searchstring like this:
globalstore("rmp_searchstring", "str::" + searchstring);

then globalrecall() works correctly when it retrieves a nil value

Even though this bug needs to be fixed, I would use store() and recall() instead since this search term doesnt need to be globally shared between plugins

funk
02-04-2011, 01:35 AM
You script isnt picking up classtypes of "MeshEditTool" (eg bandsaw pro)

edit: I tried to code a fix, but I failed :) I should have read the thread to see you guys already talked about this

Matt
02-04-2011, 10:41 PM
I planned on updating this script for 10, just hadn't got around to it, will do it today though!

funk
02-04-2011, 11:51 PM
Hi Matt. I made some fixes to your script and emailed it to you. Feel free to use any of the changes. I don't know any LScript so handle with care

My changes:
* Find correct LWEXT*.CFG automatically
* Use correct 32 or 64bit extension config
* LW10 Compat: Empty search field resulted in gibberish on next use (replaced globalrecall/globalstore with recall/store to avoid LW10.0 bug)
* LW10 Compat: Use new "extension cache" config (autoscanned plugins) in addition to LWEXT10.CFG

This is a great script. I just wish there was a way to handle "MeshEditTool" classes :(

Matt
02-05-2011, 12:41 AM
I'll have a look at what you've done, because I just finished making the changes myself!

:D

But thanks!

funk
02-05-2011, 02:56 AM
No problem! Thanks for leaving the scripts "open" so we can learn from them and make our own modifications :)

Matt
02-05-2011, 08:46 PM
Okay I've updated these scripts for LightWave 10, you can find the updates here:

http://www.pixsim.co.uk/lightwave_lscripts.html

Funk I tried yours but it failed to auto find the Extension Cache file for some reason, so I just used my original method of asking the user to find either their LWEXT*.cfg or now the Extension Cache file.

Also fixed the issue with GlobalStore / Recall (basically just used Store / Recall as you did).

The script now also sorts fully (SortA wasn't doing it for me) and correctly updates the list based on a previous entered search term (was blank before and needed a return to force it to update).

jeric_synergy
02-05-2011, 11:18 PM
--deleted--

funk
02-06-2011, 09:01 AM
Matt I'm not sure why it would not auto find the file... its working here

The current method you use creates a problem if you use both 32 and 64 bit lightwaves because you store the file path in a config file. eg. you run lw 32 and store the LWEXT10.CFG path. Then you run lw 64 and it lists your 32 bit plugins instead of using LWEXT10-64.CFG

Matt
02-06-2011, 04:50 PM
Matt I'm not sure why it would not auto find the file... its working here

The current method you use creates a problem if you use both 32 and 64 bit lightwaves because you store the file path in a config file. eg. you run lw 32 and store the LWEXT10.CFG path. Then you run lw 64 and it lists your 32 bit plugins instead of using LWEXT10-64.CFG

Good point! I've never ran into it because I always redirect my configs so it always goes to the right config path.

I'll sort that.

erikals
05-30-2012, 02:54 PM
hi, plugin bug? \:]

can't find the plugins i installed... (using latest version and 10.1)

 

probiner
05-30-2012, 03:08 PM
This plugin only "sees" LScripts.

Anyway, Matt... I use it all the time and I don't know how can someone not use it :)

Cheers

erikals
05-30-2012, 04:06 PM
i wish NT could take it to the next level though, i remember modeling in AutoCAD back in the days, loved how i could just type a command. ...and done. :]