Forum Moderators: Staff
Poser Python Scripting F.A.Q (Last Updated: 2024 Sep 18 2:50 am)
I followed your link to svdl's freestuff, downloaded the script, and ran it, no problem, in PP2012.
Did you do the same or are you trying to run some old copy you already had?
Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)
The error seems to be a generic error when the dialog code fails.
The script seems to assume the runtime is in the Poser program folder e.g
program files/e frontier/poser 7/runtime/libraries/pose which may be wrong for PP2012.
It is writing an xml file which is then used for the dialog. that is being put in runtime/ui/spawncharactertext.xml
You could check if that file has been written.
The message you got is from an exception being detected and the script is trying to help you understand the problem. By hiding the actual error, it is preventing us from understanding the problem. I hate it when people try to put a nice error message on every possible problem. It means we have no idea what is actually happening.
Certainly the problem is not that you are running something older than Poser 6 SR2, so that is a f***ing stupid thing to say.
Do you want to try to remove the "smart" error message so we can see what is really going wrong?
At the bottom it says:
try:
dg=SpawnCharacterDialog(poser.Scene().CurrentFigure())
dg.Show()
except FigureError:
pass
except:
print "This script requires Poser 6 SR2 or later"
Change it to this: dg=SpawnCharacterDialog(poser.Scene().CurrentFigure()) dg.Show()
(No indentation on that)
We just want the raw code to go ahead and succeed or fail without intervention. So I stripped all the silly "helpful" stuff and just leave the two lines that need to run. If they fail, you'll get a real Python error message - tell me what it says.
Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)
Mark may be on to something. I didn't actually run the script with a figure, so I reported too early that it ran fine. What I meant was it didn't give me the same error - it said specifically that I needed a millenium figure which I assumed meant it was running OK.
Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)
It does not assume a specific full path - it asks Poser for the app location and then assumes the main runtime is under there. Which it is not.
Instead of os.path.dirname(poser.AppLocation()), poser.Libraries()[0] would be the new way to find the main runtime.
Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)
It is writing but not reading the XML file.
When I updated my scripts to Poser 9/Poser Pro 2012 I also had trouble with these native Poser dialogs. Where ever possible I rewrote them to use wxPython.
All paths appear correct. It is possible that there is an incompatibility somewhere within the 35 lines of XML code. Good luck with finding that :)
Since it is a relatively straight forward GUI it may be quicker to rewrite it in wxPython than to find where the anomaly is.
@bagginsbill,
Quote - I followed your link to svdl's freestuff, downloaded the script, and ran it, no problem, in PP2012.
Did you do the same or are you trying to run some old copy you already had?
Yes, I downloaded a fresh copy, and installed in the ScriptsMenu folder under the primary (executive) Runtime.
No matter if I try to run it via File > Run Python Script, or via the Python Scripts menu, all I get is the message "This script requires Poser 6 SR2 or later". Then nothing else happens.
I had heard a lot of talk in the forums about old scripts not working in PP2012, so I assumed that was the issue. If it works for you in PP2012, then it looks like I have a different issue. I should probably add that I have not installed any updates to PP2012 yet, and that I am running 32 bit under Win XP SR3.
@markschum,
Quote - You could check if that file has been written.
Yes, the file has been written to the path:
C:Poser Pro 2012RuntimeuiSpawnCharacterText.xml
PP2012 is installed to the path:
C:Poser Pro 2012PoserPro.exe
The script is installed under that same path in ScriptsMenu.
The main content runtime for the installation is:
C:Documents and SettingsCustomerMy DocumentsPoser Pro 2012 ContentRuntime
@bagginsbill
I tried the edit you sugested
dg=SpawnCharacterDialog(poser.Scene().CurrentFigure())
dg.Show()
On running the script I got:
File "C:Poser Pro 2012RuntimePythonposerScriptsScriptsMenuSC-Test-01.py", line 375
dg=SpawnCharacterDialog(poser.Scene().CurrentFigure())
^
IndentationError: expected an indented block
LB:
Do not add tabs - remove them. Remember I wrote this:
"(No indentation on that)"
Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)
Sorry BB, did not realize i was suposed ti remove the "try" line. Now I get:
Traceback (most recent call last):
File "C:Poser Pro 2012RuntimePythonposerScriptsScriptsMenuSC-Test-05.py", line 374, in
dg=SpawnCharacterDialog(poser.Scene().CurrentFigure())
File "C:Poser Pro 2012RuntimePythonposerScriptsScriptsMenuSC-Test-05.py", line 73, in init
self.SetStatusText("Enter morph name")
File "C:Poser Pro 2012RuntimePythonposerScriptsScriptsMenuSC-Test-05.py", line 135, in SetStatusText
self.dlg.SetText("status",StatusText)
TypeError: no such text field
The above image shows the code I am now using. Is this correct?
The message it generates is:
Traceback (most recent call last):
File "C:Poser Pro 2012RuntimePythonposerScriptsScriptsMenuSC-Test-05.py", line 374, in
dg=SpawnCharacterDialog(poser.Scene().CurrentFigure())
File "C:Poser Pro 2012RuntimePythonposerScriptsScriptsMenuSC-Test-05.py", line 73, in init
self.SetStatusText("Enter morph name")
File "C:Poser Pro 2012RuntimePythonposerScriptsScriptsMenuSC-Test-05.py", line 135, in SetStatusText
self.dlg.SetText("status",StatusText)
TypeError: no such text field
@PhilC,
Quote - It is writing but not reading the XML file.
When I updated my scripts to Poser 9/Poser Pro 2012 I also had trouble with these native Poser dialogs. Where ever possible I rewrote them to use wxPython.
All paths appear correct. It is possible that there is an incompatibility somewhere within the 35 lines of XML code. Good luck with finding that :)
Since it is a relatively straight forward GUI it may be quicker to rewrite it in wxPython than to find where the anomaly is.
I'm sure you know what you are talking about (I don't :-)). I would not have a clue how to rewrite it in wxPython. So unless svdl, or someone else, updates the script for PP2012, it looks like I'm sunk.
It's not that there are no alternatives, but the alternatives are either more work, or cost money :scared:(I'm tight as a fishes ...).
The error is interesting, but I don't know the API that is being relied upon here. I think this is reverse-engineered stuff going on as Poser never officially supported user-defined XML dialogs. The entire old UI was written this way, but now has all been replaced. I suspect that this kind of complex UI has to be re-implemented in wx.
Leaving the subject of Python script problems aside, what is the problem that is solved by this script? Is it so you can make a full body morph from the currently modified figure?
If so, is it not easier to just use the new PP2012 menu item Figure/Create Full Body Morph?
(There are many new things in Poser that make a lot of scripts completely pointless. Always learn the new features before you set about updating a script that no longer fills a gap.)
Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)
Quote - [...] what is the problem that is solved by this script?
The script makes an INJ-REM pair of pz2 files from the current morphed state of the selected figure. All morphs that are expressed in the figure are consolidated into one morph per actor. A delta injection pose is written that will inject the morph into a PBMCC channel, you can choose which one. You can also choose precision filtering for the morph.
It only does one job, makes an INJ-REM, but it does it extremely well, giving me all the options I need with the minimum fuss and user intervention.
I have not tried this, but I strongly suspect that you will be able to load the WM figures in Pro 2010, for the purposes of running the script and making the INJ file. It should not matter that the weight map does not work. Just make sure you zero the rotations in the Joint Editor before running the script.
Still, it would be very nice to be able to do it all in PP2012.
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.
I don't use a lot of Python scripts, but the ones I do use I rely on quite heavily. Chief amongst those is svdl's "SpawnCharacterP6 update".
I just upgraded to PP2012 (from P6), and as you will know, many (all?) py scripts made for earlier poser versions do not work in PP2012.
I know nothing about Python scripting personally, though I have managed to make some very simple hacks to one of svdl's scripts for saving poses (P6 version).
So the question is this: Is there anything I can do (as a Python illiterate) to convert "SpawnCharacterP6 update" so that it will work in PP2012? I would need clear instructions that assume no prior knowledge of Python.
A supplementary question: Is there a general method that would convert any py script to work in PP2012?