• Welcome to Dizzi's Support Forum.
 

News:

Welcome to my support forum for Advanced Library and PoseMagic2Pose.

Main Menu

Script: Scriptsmenu

Started by Dizzi, November 29, 2009, 10:51:23 PM

Previous topic - Next topic

Dizzi

Poser's Scripts menu as a panel (for Poser 8 and later).

It allows running Python scripts via double click, refreshing of the whole menu or only folders and to copy the path of the script to the clipboard (right click for context menu!)

doppelganger

#1
??
I tried this but I get the attached.

Which is wierd since I haven't a folder with such scripts......


Dizzi

Sorry, the script took the content's root location not that of the application. I updated the script :-)

Thanks for letting me know.

doppelganger

Ah, I see, I had not realized (or perhaps I forgot:-)) that I had placed Python scripts in the external runtime; now it works.

Still, maybe it would be good if it would pick up from both locations?


Dizzi

Quote from: doppelganger on January 11, 2010, 06:19:28 PM
Ah, I see, I had not realized (or perhaps I forgot:-)) that I had placed Python scripts in the external runtime; now it works.

Still, maybe it would be good if it would pick up from both locations?



Well, it'd have to check all libraries then ;-)
You'd probably want just one tree for all scripts?
So "somewhere\Runtime\Python\poserScripts\ScriptsMenu\test\x.py"
and "elsewhere\Runtime\Python\poserScripts\ScriptsMenu\test\y.py" are both displayed in folder "test" in the palette?

doppelganger

Often you will get some package that includes some Python script(s) as part of its runtime and the read me will point out (if you read it) that the python bits need to be moved to the main folder even if you have extracted to an external runtime (most people I would have thought and probably two or more).

Which is sort of a nuisance, you have to remember and to back it up etc.

I agree the tree should be the same (and will be packaged that way usually), I guess you just want a sinple way to specify/add external runtimes to the panel.


Dizzi

Maybe this does it for you. It can check all added Poser libraries for Script menus and add those, too, if the option "Show Lib's Menus" is checked.

doppelganger

I tried it and got this:

Traceback (most recent call last):
  File "C:\Program Files\Smith Micro\Poser 8\Runtime\Python\poserScripts\ScriptsMenu\ScriptsMenu\ScriptsMenu.py", line 197, in ?
    win = ScriptsWindow(root, name, pane)
  File "C:\Program Files\Smith Micro\Poser 8\Runtime\Python\poserScripts\ScriptsMenu\ScriptsMenu\ScriptsMenu.py", line 39, in __init__
    self.BuildTree()
  File "C:\Program Files\Smith Micro\Poser 8\Runtime\Python\poserScripts\ScriptsMenu\ScriptsMenu\ScriptsMenu.py", line 63, in BuildTree
    if self.settings["CheckContentDirs"]:
KeyError: 'CheckContentDirs'

Dizzi

Sorry, there were too tabs too many. Please try the attached version.

doppelganger

That loads up OK and is picking up "P8" external runtime and Poser7/PoserPro runtime ie

F:\Runtimes\P8\Runtime\Python\poserScripts\

or

C:\Program Files\Smith Micro\Poser 7\Runtime\Python\poserScripts\

or

C:\Program Files\Smith Micro\Poser Pro\Runtime\Python\poserScripts



But not eg "F:\Runtimes\Jessi\Runtime\Python\poserScripts" (which contains just 3 scripts that came with a product).


However this doesn't matter as I will now just centralize all my scripts in the P8 external (ie as long as they don't have to be on the C drive).

Dizzi

Quote from: doppelganger on January 14, 2010, 07:11:28 PM
But not eg "F:\Runtimes\Jessi\Runtime\Python\poserScripts" (which contains just 3 scripts that came with a product).

That's because it starts at the Scriptsmenu folder. But you can edit the script to start at poserScripts, if you want.

Just search for "'poserScripts', 'ScriptsMenu'" (without ") and remove the ", 'ScriptsMenu'".

doppelganger

Yes that suits me very well, much cleaner than fiddling with the existing palette or ploughing through the dialog and I can put the scripts where I like now (subject to the tree structure).

Think there are a couple of oddballs like the WardrobeWizard (where you execute a script which then autoloads the existing Python palette) so have to use existing procedure for those.

Nice job, thanks very much.

Netherworks

Love the script but I think I've run into a problem.  From reading through the script, it appears that it's supposed to save layout information but no layout is being saved here.  I'm on XP-64.

Netherworks

I solved the issue.

On initial run, the directory "acb" doesn't exist in Poser's preferences folder (found via poser.PrefsLocation()) and I get an exception error during the pickle dump.  For testing, I set up the script to tell me when there's an exception.

It looks like my OS isn't allowing the script to create the acb folder, so I fixed it by doing this at line 14:


savePath=os.path.join(poser.PrefsLocation(), "acb")
if not os.path.exists(savePath):
os.makedirs(savePath)

Netherworks

Heya, I made some minor modifications to the ScriptsMenu, mostly visual changes.  The script does say "Feel free to redistribute" but can I redistribute a modified version?  Completely free, of course :)

Visual Modifications:

- Background colour to match that of the standard poser panels
- Folders have light gold text and slightly darker background colour
- Listed scripts have white text and lighter background colour
- Extension of scripts is hidden (.py and .pyc)
- Border is hidden when docked.

I'm toying with some other options but I'm VERY MUCH a learner when it comes to the wxPython system at this moment