THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 13/06/2012 at 11:33, xxxxxxxx wrote:
Is there a way to have Python pause for user input and then act on that input?
For example I would like to start a script, press a number, then a comma, then another number and then 'shift' to set the render frame range. Maybe not the most useful example, but you get the idea.
Here is a bit of code to look for the shift part, but I still don't know how to capture the number input first:
# Check for modifier keys
bc = c4d.BaseContainer()
if c4d.gui.GetInputState(c4d.BFM_INPUT_KEYBOARD,c4d.BFM_INPUT_CHANNEL,bc) :
if bc[c4d.BFM_INPUT_QUALIFIER] & c4d.QSHIFT:
I would also like to start a script, get the current snap settings, let the user create a two point spline, then use that splines point data to print out a distance measure, and finally delete the spline. This would make a quicker measure tool.
I'm starting to be fairly proficient at manipulating the data with Python, but am falling short at interactivity with the user. Anyone?