Trying to simulate a keypress from another terminal using telnet to activate a relational constraint.
I've got the telnet and keypress code worked out (using SendKeys module) but the constraint with a keyboard device does not react to the sendkey command.
Is there another way to activate a constraint remotely?
Ok, I've found a method but I'm not sure it's the most efficient.
1. Add a Script Device to the scene.
2. Add 33 Action Properties to the Script Device (using same names from a Keyboard device).
3. Make them Animatable.
4. Replace actual Keyboard Device and connections in Constraint with Script (Keyboard) device.
Then using this script, I can toggle on/off the action state.
I still don't understand why I can't toggle the state within the same script so I call the script twice.
Once to activate and again to deactivate.
# Usage: ToggleActionState.py [propertyname] [ON/OFF] from pyfbsdk import * import sys propertyName = sys.argv[0] for device in FBSystem().Scene.Devices: if device.Name == 'Script Keyboard': pState = device.PropertyList.Find(propertyName) if sys.argv[1] == 'ON': pState.Data = True elif sys.argv[1] == 'OFF': pState.Data = False
Can't find what you're looking for? Ask the community or share your knowledge.