Last active
July 17, 2019 10:05
-
-
Save fwilleke80/5d6be03d2f368061f54027889b0414df to your computer and use it in GitHub Desktop.
[C4D] A really tiny script that restarts Cinema 4D
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Name-US:Restart Cinema 4D | |
Description-US:Restart Cinema 4D (hold SHIFT to skip the question) | |
Name-DE:Cinema 4D neustarten | |
Description-DE:Cinema 4D neustarten (SHIFT halten, um die Abfrage zu überspringen) | |
""" | |
import c4d | |
def main(): | |
# Detect SHIFT key | |
force = False | |
res = c4d.BaseContainer() | |
if c4d.gui.GetInputState(c4d.BFM_INPUT_KEYBOARD, c4d.BFM_INPUT_QUALIFIER, res): | |
force = res[c4d.BFM_INPUT_QUALIFIER] & c4d.QSHIFT | |
if force or c4d.gui.QuestionDialog('Do you really want to restart Cinema 4D?'): | |
c4d.RestartMe() | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment