Forum: Poser Python Scripting


Subject: Alt-click on a Poser parameter dial - can it be scripted?

HartyBart opened this issue on Mar 11, 2021 · 5 posts


HartyBart posted Thu, 11 March 2021 at 3:31 PM

An adjusted Poser parameter dial can be reset to its default value, by alt-clicking on it.

Is there a way for a Python script to do this? To know 'the dial I adjusted a second ago', and to do the equivalent of alt-click?

Or perhaps even to know 'the last-adjusted figure dial', even if the user has since gone off and adjusted a light or something in the meanwhile?

If so, then such a script could be buttonized into a one-click icon on XA Toolbar. This would save multiple hand-eye-keyboard movements when working with a figure and needing a complete reset for the currently-used dial.



Learn the Secrets of Poser 11 and Line-art Filters.


adp001 posted Thu, 11 March 2021 at 4:24 PM

No chance.

But – if you write a script (a "PoserAddon") your script will be informed if the user changed to active actor. Then you can set callbacks for all parameters of this actor to get notified if a parameter has changed (just after you released the callbacks in the previous active actor).

Sounds complicated? Not really. Just one or two hundred lines of Code :)

I made something like that for my MQTT script to be able to "sync" several Poser installations on different machines (or with an object in a modeller). And to be able to play with the puppets from outside of Poser over the net.




HartyBart posted Fri, 12 March 2021 at 7:36 AM

Thanks. So it sounds like it's not possible to reset the currently selected parameter-dial to its default MinValue, via a script. I assume it's made impossible because Poser does not casually 'know' what the currently selected parameter-dial is, and requires a script to explicitly name the dial or else hook it via a ParameterByCode command?

Which means the alternative fallback for the user would be the "two-click, no-keyboard" way, rather than Alt + click. While at or near the dial, use the dial's tiny "Reset" arrow-button (which sits at the end of each dial panel). I assume this "Reset" command can't be hooked up to a script either, which would at least have enabled one-click button-ization of it. Tests show that the user cannot multi shift-selected dials, then reset them all by using just one "Reset" arrow-button.

Incidentally, I discovered that Crtl + E will reset all dials within the currently-selected body part. These are reset to the defaults for each dial, not 0.0. Sadly it also resets morph and scale dials, and does not restrict itself to body-part rotation dials. But perhaps a script might memorise all dials on the currently selected body-part, Ctrl + E it, and then restore everything except the rotations?

For partial resets of duff poses the Dial Manager 2015 addon is another option. It can select and zero/reset multiple dials at once. Which provides a way to partially back out of a failed attempt at a pose, without having to Alt+Ctrl+F (memorize figure) & Ctrl+Shift+F (restore figure) or Crtl + E (reset all in body-part) or the nuclear option of a full figure reset. But it appears that Dial Manager is no longer sold, even though it still works in Poser 11.2. Possibly the new Lockmaster addon for Poser 12 (only) will come in time to do much the same thing for Poser 12 owners?



Learn the Secrets of Poser 11 and Line-art Filters.


adp001 posted Fri, 12 March 2021 at 9:18 AM

There is no "currently selected parameter", except you press a mousebutton within a parameters window or while you typing into an input field.

This all is a UI Thing. Means: WxPython for Poser. The "Poser Engine" itself gets informed from the UI and is happy to share this information with a running Python script ("Parameter Callback").

In every WxPython UI lives a central "Event Processor". For Poser it is reachable via poser.WxApp(). This main Event Processor manages the whole UI.

All WxWindows from the UI are reachable via poser.WxAuiManager(). Each window is mainly managed via Events.

This also means: A script is able to mimic a keypress or mouseclick. Just put a prepared event object into the Event Queue and it will get processed (See WxPythons event handling online).

My opinion: Capturing Posers UI seams more complicated, time consuming and errorprone as writing a "PoserAddon".




an0malaus posted Fri, 12 March 2021 at 6:19 PM

I have recently requested the feature for Python to determine the currently selected parameter, since it gets highlighted in the Animation Palette, and determines which parameter is shown in Graph palettes set to follow selection.

No indication of when, or if that request will be accepted, but there is hope.

Unless Poser provides that level of UI and Python API integration, the most straightforward (not easiest) method would be to create a GUI tool that presents a checkbox list of the current actor's parameters for the user to select to have their values reset to initValue (default). To speed up that operation, scripts can have shortcut keys assigned to them in the General Preferences. So a key-combination to open the tool, multiple clicks or drag selection to identify parameters for reset, then press Return or click OK to apply.



My ShareCG Stuff

Verbosity: Profusely promulgating Graham's number epics of complete and utter verbiage by the metric monkey barrel.