Uncanny_Film opened this issue on Jan 18, 2020 ยท 8 posts
an0malaus posted Sun, 19 January 2020 at 8:18 AM
While that might be a useful concept, how would it be any easier than a single mouse/trackpad click on a Parameter palette dial's increment/decrement arrows? With those you can be exactly specific about which parameter of the currently selected actor you want to modify, be it morph, translation, scale or rotation. How would a keypress be able to distinguish which axis you wanted to translate, scale or rotate, unless you had one key combination for each to be incremented, and another to decrement?
I have a dim memory of someone writing a script to place actors or figures at the scene origin, if they had been moved away by applying a pose. That kind of thing could be useful as a key macro.
# -*- coding: utf-8 -*-
# IncrementParameter.py
# (c) 2020 an0malaus (Geoff Hicks/GeoffIX)
#
# This script will increment a particular parameter of the currently selected actor in the scene.
# It is intended to be run by a key shortcut set up in Poser UI preferences.
# Duplicate the file with different names to increment or decrement various parameters.
#
# INSTALLATION:
# The script should be installed somewhere within the Runtime/Python/poserScripts/ScriptsMenu hierarchy.
# Poser must be restarted for the script to be found and made available in the Preferences:Interface:Shortcuts list.
# Try to avoid using key combinations that Poser already uses.
# Good luck :-)
#
# v1.0 20200120 Initial version per request on Renderosity by spartan00j.
# https://www.renderosity.com/mod/forumpro/?thread_id=2942016
########################################################################################################################
from __future__ import print_function
version = '1.0'
increment = True # Change this to False to decrement theParm value by the sensitivity setting
import poser
scene = poser.Scene()
actor = scene.CurrentActor()
assert actor, 'No actor currently selected!'
# Modify the following line to select which parameter the keypress is supposed to modify.
# Remove the # character from one of the following commented examplesw:
#theParm = actor.ParameterByCode(poser.kParmCodeXTRAN)
theParm = actor.ParameterByCode(poser.kParmCodeYTRAN)
#theParm = actor.ParameterByCode(poser.kParmCodeZTRAN)
#theParm = actor.ParameterByCode(poser.kParmCodeXROT)
#theParm = actor.ParameterByCode(poser.kParmCodeYROT)
#theParm = actor.ParameterByCode(poser.kParmCodeZROT)
#theParm = actor.Parameter('Some Parameter Name Here!!!')
assert theParm, 'No parameter on {} specified!'.format(actor.Name())
delta = theParm.Sensitivity() * (-1,1)[increment] # How much to adjust by each time the key is pressed.
theParm.SetValue(theParm.UnaffectedValue() + delta,1) # Set the new value and update the scene
### END ###
Verbosity: Profusely promulgating Graham's number epics of complete and utter verbiage by the metric monkey barrel.