Mon, Nov 11, 12:11 PM CST

Renderosity Forums / Poser - OFFICIAL



Welcome to the Poser - OFFICIAL Forum

Forum Coordinators: RedPhantom

Poser - OFFICIAL F.A.Q (Last Updated: 2024 Nov 11 9:00 am)



Subject: adding a python script


bigdave1960 ( ) posted Sat, 28 March 2009 at 9:15 AM · edited Sun, 15 September 2024 at 9:22 PM

I have a python script i use a fair bit in poser pro but have to run it from- file- run python script , and then i have to find it it because it looks in the last folder i looked in for somthing else. is there a way to add it to the drop down list headed scripts ? so that i can run it from there?


PhilC ( ) posted Sat, 28 March 2009 at 9:26 AM · edited Sat, 28 March 2009 at 9:27 AM

Poser 7 and later:-

If you place the script in or below the directory
Poser 7RuntimePythonposerScriptsscriptsMenu

It will appear when you click on the Poser top menu item "Scripts"

The other method is to edit one of the button lines in
Poser 7RuntimePythonposerScriptsmainButtons.py

Your script will then be available as one of the ten defaults in the Python Script pallet.
Window > Python Scripts.

Hope this helps.


adp001 ( ) posted Sat, 28 March 2009 at 9:28 AM

Have a look into your "Poser-Python Methods Manual".
A description is in the first chapter:

"Poser includes a simple graphical user interface that allows you to execute Python scripts from either of two locations within the program, by clicking a button. You can customize the Python Scripts palette and, in addition, can run Python scripts directly."




Victoria_Lee ( ) posted Sat, 28 March 2009 at 9:33 AM

PhilC is the man!!! and he's absolutely right.  I just got through editing both my mainButtons.py and my mainWacros.py so that I have quick access to a couple of new scripts that I'm using a lot.

Hugz from Phoenix, USA

Victoria

Remember, sometimes the dragon wins. Correction: MOST times.


Acadia ( ) posted Sat, 28 March 2009 at 10:46 AM

file_427335.txt

Dimension3D showed me that you can have access to an unlimited number of scripts in your python window:

http://www.renderosity.com/mod/forumpro/showthread.php?message_id=2525895&ebot_calc_page#message_2525895

It took me a while to catch on, and it's a bit confusing until you actually get it set up.  So I'll take the confusion out of it :)

Save the attachment and change the extension from .txt to .py

Save it in the following path:

C:Program FilesCurious LabsPoser 6RuntimePythonposerScripts

"It is good to see ourselves as others see us. Try as we may, we are never
able to know ourselves fully as we are, especially the evil side of us.
This we can do only if we are not angry with our critics but will take in good
heart whatever they might have to say." - Ghandi



Acadia ( ) posted Sat, 28 March 2009 at 10:46 AM · edited Sat, 28 March 2009 at 10:49 AM

file_427337.txt

Save this one to the same path. Again change the extension to .py from txt.

"It is good to see ourselves as others see us. Try as we may, we are never
able to know ourselves fully as we are, especially the evil side of us.
This we can do only if we are not angry with our critics but will take in good
heart whatever they might have to say." - Ghandi



Acadia ( ) posted Sat, 28 March 2009 at 10:47 AM · edited Sat, 28 March 2009 at 10:49 AM

file_427338.txt

Save this one to the same path. Don't forget to change the extension.

"It is good to see ourselves as others see us. Try as we may, we are never
able to know ourselves fully as we are, especially the evil side of us.
This we can do only if we are not angry with our critics but will take in good
heart whatever they might have to say." - Ghandi



Acadia ( ) posted Sat, 28 March 2009 at 10:49 AM

Having done that you will now see that when you open the python window you will now have the following 2 options:

SubMenu
SubMenu 1

Those SubMenus will allow you to add more python scripts.  So when you want to add a script, you edit the SubMenu.py or the SubMenu1.py  file  instead of the MainButtons.py file.

"It is good to see ourselves as others see us. Try as we may, we are never
able to know ourselves fully as we are, especially the evil side of us.
This we can do only if we are not angry with our critics but will take in good
heart whatever they might have to say." - Ghandi



Acadia ( ) posted Sat, 28 March 2009 at 10:57 AM · edited Sat, 28 March 2009 at 11:10 AM

file_427340.txt

You can also make more SubMenus using those SubMenu files.

For example, I have a gazillion scripts by Ockham. 

Here is what my SubMenu.py script looks like.

If you save the file to your desktop and open it in Notepad, you will see that I have both versions of Wardrobe Wizard, plus I have 3 lines for Ockham, and an entry for Dimension3D.

When I open my SubMenu from the python window, I see:

Wardrobe Wizard
Wardrobe Wizard 2
Ockham Scripts
Ockham Scripts
Ockham Scripts
Dimension3D

When I click on any one of those, I am taken to yet another python window showing further scripts.  So for example if I want to access a specific script by Ockham, I will find it under one of the 3 entries I have showing for him.  When I'm done, I c an just click on "back to main button".

I have my Ockham scripts saved in the following path:

C:Program FilesCurious LabsPoser 6RuntimePythonposerScriptsOckhamOckham Scripts

I also had to create 3 .py files in this path so that I could add the scripts. I created:

OckhamMenu.py
OckhamMenu2.py
OckhamMenu3.py

I have my Dimension3D scripts saved in the following path:

C:Program FilesCurious LabsPoser 6RuntimePythonposerScriptsDimension3D

In order to add his scripts, I have the following file inside this path:

Dimension3D.py

Basically for each person who has multiple scripts, I create a folder for that person and add a .py script (essentially a renamed mainbuttons.py edited to hold the scripts I want)  in order to save the scripts in one place.

 

"It is good to see ourselves as others see us. Try as we may, we are never
able to know ourselves fully as we are, especially the evil side of us.
This we can do only if we are not angry with our critics but will take in good
heart whatever they might have to say." - Ghandi



Victoria_Lee ( ) posted Sat, 28 March 2009 at 11:04 AM

This is too cool, Acadia.  Thanks for the info but I can't find the script originally posted by Dimension3D that started this thread.

Hugz from Phoenix, USA

Victoria

Remember, sometimes the dragon wins. Correction: MOST times.


Acadia ( ) posted Sat, 28 March 2009 at 11:07 AM · edited Sat, 28 March 2009 at 11:08 AM

He must have removed it.  

"It is good to see ourselves as others see us. Try as we may, we are never
able to know ourselves fully as we are, especially the evil side of us.
This we can do only if we are not angry with our critics but will take in good
heart whatever they might have to say." - Ghandi



Victoria_Lee ( ) posted Sat, 28 March 2009 at 11:13 AM

I found it over on his website so all is well.

Hugz from Phoenix, USA

Victoria

Remember, sometimes the dragon wins. Correction: MOST times.


Privacy Notice

This site uses cookies to deliver the best experience. Our own cookies make user accounts and other features possible. Third-party cookies are used to display relevant ads and to analyze how Renderosity is used. By using our site, you acknowledge that you have read and understood our Terms of Service, including our Cookie Policy and our Privacy Policy.