Tue, Oct 22, 3:28 AM CDT

Renderosity Forums / Poser Python Scripting



Welcome to the Poser Python Scripting Forum

Forum Moderators: Staff

Poser Python Scripting F.A.Q (Last Updated: 2024 Sep 18 2:50 am)

We now have a ProPack Section in the Poser FreeStuff.
Check out the new Poser Python Wish List thread. If you have an idea for a script, jot it down and maybe someone can write it. If you're looking to write a script, check out this thread for useful suggestions.

Also, check out the official Python site for interpreters, sample code, applications, cool links and debuggers. This is THE central site for Python.

You can now attach text files to your posts to pass around scripts. Just attach the script as a txt file like you would a jpg or gif. Since the forum will use a random name for the file in the link, you should give instructions on what the file name should be and where to install it. Its a good idea to usually put that info right in the script file as well.

Checkout the Renderosity MarketPlace - Your source for digital art content!



Subject: this is what I'd like to do...ShaderSpider2....


dlfurman ( ) posted Wed, 28 September 2011 at 12:47 PM · edited Tue, 22 October 2024 at 3:24 AM

ShaderSpider still works in PP2K10, but I'd like to use those scripts in PoserPro 2012.

I have access to ShaderSpider2 source code. I'd like to have it run for PoserPro 2012

What do I need to do?

The reason I ask is...the current version (compiled as it has files with .pyc extensions) generates a "Bad Magic Number" which I found out means there needs to be a recompiling of some scripts.

So I ask again, what do I need to do?

 

Your help will be greatly appreciated.

"Few are agreeable in conversation, because each thinks more of what he intends to say than that of what others are saying, and listens no more when he himself has a chance to speak." - Francois de la Rochefoucauld

Intel Core i7 920, 24GB RAM, GeForce GTX 1050 4GB video, 6TB HDD space
Poser 12: Inches (Poser(PC) user since 1 and the floppies/manual to prove it!)


semidieu ( ) posted Wed, 28 September 2011 at 2:45 PM

I would say... just compile ShaderSpider2 source code again... Do you know how to do it ?

But sometimes, it won't work, as there are some differences in the python version.


nruddock ( ) posted Wed, 28 September 2011 at 4:01 PM

As you have the PY files there should be no need to manually compile them.

Any scripts imported as modules will be compiled automatically.


Gareee ( ) posted Wed, 28 September 2011 at 4:46 PM

I'd love to have shader spider working in PP2012!

 

Way too many people take way too many things way too seriously.


dlfurman ( ) posted Wed, 28 September 2011 at 5:21 PM

I'll do some Google-Fu on how to compile Python scripts. (But I'll be back if I need help!)

If it fails, then it will enable me to wake up me old programming skills (hah! <-dont let the lowercase fool you. REALLY big laugh right there!)

Thank you for your responses folks.

 

"Few are agreeable in conversation, because each thinks more of what he intends to say than that of what others are saying, and listens no more when he himself has a chance to speak." - Francois de la Rochefoucauld

Intel Core i7 920, 24GB RAM, GeForce GTX 1050 4GB video, 6TB HDD space
Poser 12: Inches (Poser(PC) user since 1 and the floppies/manual to prove it!)


Gareee ( ) posted Wed, 28 September 2011 at 5:25 PM

If it works, you could rtencode it for people who already have purchased it, and make it available that way, unless you find some issues with it.

Way too many people take way too many things way too seriously.


nruddock ( ) posted Wed, 28 September 2011 at 7:55 PM

Quote - If it works ...

I'd be more concerned about anything needing fixing up rather than compilation.  

Quote - ... you could rtencode it ...

Wouldn't be necessary, as the source (and only the source, not the presets) is licensed under the MPL (see -> http://code.google.com/p/pw-shaderspider-2-source/), so any modifications/fixes can be distributed without any messing about with encoding (or even compiling).


nruddock ( ) posted Wed, 28 September 2011 at 8:08 PM

Attached Link: http://docs.python.org/library/compileall.html

> Quote - I'll do some Google-Fu on how to compile Python scripts.

This linked doc page should be all that's needed.


dlfurman ( ) posted Wed, 28 September 2011 at 9:07 PM

Ah, nruddock, thank you most kindly.

"Few are agreeable in conversation, because each thinks more of what he intends to say than that of what others are saying, and listens no more when he himself has a chance to speak." - Francois de la Rochefoucauld

Intel Core i7 920, 24GB RAM, GeForce GTX 1050 4GB video, 6TB HDD space
Poser 12: Inches (Poser(PC) user since 1 and the floppies/manual to prove it!)


dlfurman ( ) posted Thu, 29 September 2011 at 11:09 PM

UPDATE:

ShaderSpider partially works. 6 of the 10 options work.

Copy to All, Copy to Matching, Smart Copy to Skin, Rename Node and the Main Menu buttons work.

The sixth option, Copy to Material Group does the same as in Poser 7SR3, at least the same message is generated "No material groups defined for this object. You can use the EDIT GROUPS wacro to create new material groups".

I was testing on the V4 Bodysuit.

What is interesting in both Poser 7 and PoserPro 2012 is while that above message is generated, there are material groups in that object, at lease UVMapper can see them. But I digress.

The Edit Materials, Save Partial Shader (FX6), Load Partial Shader (FX6), and Save Mat Pose buttons generate the following error messages in PoserPro2012:

EDIT_GROUPS ERROR GENERATED:

Traceback (most recent call last):
  File "O:Program FilesSmith MicroPoser Pro 2012RuntimePythonPoseWorksShaderSpiderwacrosEdit_Groups.py", line 9, in
    ss6Gui.askEditGroups()
  File "RuntimePythonPoseWorksShaderSpiderDatass6Gui.py", line 25, in askEditGroups
    editor = GroupEditor(actor)
  File "RuntimePythonPoseWorksShaderSpiderDatass6Xml.py", line 626, in init
    self.actionPane.SetText(self.dlg)
  File "RuntimePythonPoseWorksShaderSpiderDatass6Xml.py", line 285, in SetText
    button.SetText(dialog, button.widgetName)
  File "RuntimePythonPoseWorksShaderSpiderDatass6Xml.py", line 255, in SetText
    self.msg.SetText(dialog, message)
  File "RuntimePythonPoseWorksShaderSpiderDatass6Xml.py", line 120, in SetText
    dialog.SetText(name=self.widgetName, text=message)
TypeError: no such text field

SAVE_FX6 ERROR GENERATED:

Traceback (most recent call last):
  File "O:Program FilesSmith MicroPoser Pro 2012RuntimePythonPoseWorksShaderSpiderwacrosSave_Fx6.py", line 12, in
    inputs = ss6Gui.askSelectInputs()
  File "RuntimePythonPoseWorksShaderSpiderDatass6Gui.py", line 14, in askSelectInputs
    selector = SelectInput(inputs)
  File "RuntimePythonPoseWorksShaderSpiderDatass6Xml.py", line 420, in init
    self.checkPane.SetText(self.dlg)
  File "RuntimePythonPoseWorksShaderSpiderDatass6Xml.py", line 332, in SetText
    button.SetText(dialog, button.widgetName)
  File "RuntimePythonPoseWorksShaderSpiderDatass6Xml.py", line 269, in SetText
    self.msg.SetText(dialog, message)
  File "RuntimePythonPoseWorksShaderSpiderDatass6Xml.py", line 120, in SetText
    dialog.SetText(name=self.widgetName, text=message)
TypeError: no such text field

LOAD_FX6 ERROR GENERATED:

Traceback (most recent call last):
  File "O:Program FilesSmith MicroPoser Pro 2012RuntimePythonPoseWorksShaderSpiderwacrosLoad_Fx6.py", line 14, in
    names = ss6Gui.askMaterials(actor)
  File "RuntimePythonPoseWorksShaderSpiderDatass6Gui.py", line 50, in askMaterials
    selector = AskSelectMethod("Include...", methods=methods)
  File "RuntimePythonPoseWorksShaderSpiderDatass6Xml.py", line 857, in init
    self.radioPane.SetText(self.dlg)
  File "RuntimePythonPoseWorksShaderSpiderDatass6Xml.py", line 285, in SetText
    button.SetText(dialog, button.widgetName)
  File "RuntimePythonPoseWorksShaderSpiderDatass6Xml.py", line 255, in SetText
    self.msg.SetText(dialog, message)
  File "RuntimePythonPoseWorksShaderSpiderDatass6Xml.py", line 120, in SetText
    dialog.SetText(name=self.widgetName, text=message)
TypeError: no such text field

SAVE_MAT ERROR GENERATED:

Traceback (most recent call last):
  File "O:Program FilesSmith MicroPoser Pro 2012RuntimePythonPoseWorksShaderSpiderwacrosSave_Mat.py", line 11, in
    names = ss6Gui.askMaterials(actor)
  File "RuntimePythonPoseWorksShaderSpiderDatass6Gui.py", line 50, in askMaterials
    selector = AskSelectMethod("Include...", methods=methods)
  File "RuntimePythonPoseWorksShaderSpiderDatass6Xml.py", line 857, in init
    self.radioPane.SetText(self.dlg)
  File "RuntimePythonPoseWorksShaderSpiderDatass6Xml.py", line 285, in SetText
    button.SetText(dialog, button.widgetName)
  File "RuntimePythonPoseWorksShaderSpiderDatass6Xml.py", line 255, in SetText
    self.msg.SetText(dialog, message)
  File "RuntimePythonPoseWorksShaderSpiderDatass6Xml.py", line 120, in SetText
    dialog.SetText(name=self.widgetName, text=message)
TypeError: no such text field

 

I notice that ss6Gui.py and ss6Xml.py are common to all 4 errors. These would generate additional dialog boxes for inputs and selections for those 4 selections.

How can I fix this?

Thanks again!

 

"Few are agreeable in conversation, because each thinks more of what he intends to say than that of what others are saying, and listens no more when he himself has a chance to speak." - Francois de la Rochefoucauld

Intel Core i7 920, 24GB RAM, GeForce GTX 1050 4GB video, 6TB HDD space
Poser 12: Inches (Poser(PC) user since 1 and the floppies/manual to prove it!)


nruddock ( ) posted Fri, 30 September 2011 at 9:40 AM

Dialog.SetText method still exists and has the same signature, so it is some internal implementation aspect that's changed, so try using the following instead :-

dialog.SetText(self.widgetName, message)


Gareee ( ) posted Fri, 30 September 2011 at 10:34 AM

I love you guys are fixing this up!

 

Way too many people take way too many things way too seriously.


dlfurman ( ) posted Sat, 01 October 2011 at 8:59 PM · edited Sat, 01 October 2011 at 9:02 PM

Thought I had a breakthrough....

I captured what I thought was the actual Python source code was actually the HTML of the pages containing the Python code.

So making sure I combed through the files and got the actual Python code.

Ok, time to test and....nada.

So I looked and checked the files

DOH! Some .XML files were also the HTML capture of the that code.

"Surely you've got it now!", I thought to myself.

I checked that all the .py code was Python and .xml code was .xml code.

 

 

Still no joy.

ShaderSpider does work with PoserPro 2010*.

I am going to test the version2 with PP2K10.

That is where I am at.

 

*(edit: I just broke something, found a module that does not exist. Still going to try version2 though)

 

"Few are agreeable in conversation, because each thinks more of what he intends to say than that of what others are saying, and listens no more when he himself has a chance to speak." - Francois de la Rochefoucauld

Intel Core i7 920, 24GB RAM, GeForce GTX 1050 4GB video, 6TB HDD space
Poser 12: Inches (Poser(PC) user since 1 and the floppies/manual to prove it!)


nruddock ( ) posted Sun, 02 October 2011 at 9:48 AM

Quote - I captured what I thought was the actual Python source code was actually the HTML of the pages containing the Python code.

You'll make life a lot easier if you use an SVN client to get the code/data.


dlfurman ( ) posted Sun, 02 October 2011 at 1:45 PM

Quote - > Quote - I captured what I thought was the actual Python source code was actually the HTML of the pages containing the Python code.

You'll make life a lot easier if you use an SVN client to get the code/data.

 

It's all good.

Alas, what I perceive the problem to be is the generating of the dialog boxes and contents there of for the Python used in PoserPro 2012.

Not an expert, just wanted to see what I can do, which is not much :(

Sorry to get hopes up high from my end folks!

 

 

"Few are agreeable in conversation, because each thinks more of what he intends to say than that of what others are saying, and listens no more when he himself has a chance to speak." - Francois de la Rochefoucauld

Intel Core i7 920, 24GB RAM, GeForce GTX 1050 4GB video, 6TB HDD space
Poser 12: Inches (Poser(PC) user since 1 and the floppies/manual to prove it!)


WandW ( ) posted Sun, 02 October 2011 at 9:18 PM

I had grabbed the source a while back and posted it on the RDNA forum...

http://www.runtimedna.com/forum/showthread.php?63173-Poser-9-amp-Poser-Pro-2012-New-Features&p=614424#post614424

I've stripped out the svn data.  Remove the .txt from the attachment to get the zip file.

----------------------------------------------------------------------------------------

The Wisdom of bagginsbill:

"Oh - the manual says that? I have never read the manual - this must be why."
“I could buy better software, but then I'd have to be an artist and what's the point of that?"
"The [R'osity Forum Search] 'Default' label should actually say 'Don't Find What I'm Looking For'".
bagginsbill's Free Stuff... https://web.archive.org/web/20201010171535/https://sites.google.com/site/bagginsbill/Home


dlfurman ( ) posted Sun, 23 October 2011 at 8:24 PM

OK...patience is a viritue.

I managed to get a dialog box to show up and take inputs (checkmarks) thanks to a tidbit from another thread.

Copy (Just in case. This way you will have a backup.) the .XML files in the RuntimePythonPoseworksShaderSpiderTemp folder and paste them into Runtimeui folder.

Now running SS and selecting the SaveFX button will show you the options to check so save out a .fx6 wedge. It now chokes when clicking OK, but now we get something we didnt have before.

The LoadFX button apparently works (I have to manually point to the FX folder, but hey....) some of the options do not work and generate errors. I'll do a more orderly test, but some sub options work, some do not.

Just thought you all should know.

 

"Few are agreeable in conversation, because each thinks more of what he intends to say than that of what others are saying, and listens no more when he himself has a chance to speak." - Francois de la Rochefoucauld

Intel Core i7 920, 24GB RAM, GeForce GTX 1050 4GB video, 6TB HDD space
Poser 12: Inches (Poser(PC) user since 1 and the floppies/manual to prove it!)


Gareee ( ) posted Sun, 23 October 2011 at 10:01 PM

At least its a little progress.

Too bad the developer isn't interested in fixing it.

Way too many people take way too many things way too seriously.


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.