Skip to content

Instantly share code, notes, and snippets.

@fwilleke80
Last active July 17, 2019 10:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fwilleke80/5d6be03d2f368061f54027889b0414df to your computer and use it in GitHub Desktop.
Save fwilleke80/5d6be03d2f368061f54027889b0414df to your computer and use it in GitHub Desktop.
[C4D] A really tiny script that restarts Cinema 4D
"""
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