Skip to content

Instantly share code, notes, and snippets.

@donovankeith
Created January 11, 2017 01:22
Show Gist options
  • Save donovankeith/0e49ead226f59de3b615d206d558ccc5 to your computer and use it in GitHub Desktop.
Save donovankeith/0e49ead226f59de3b615d206d558ccc5 to your computer and use it in GitHub Desktop.
CV-Set New Selection Cinema 4D Script
"""Name-US: CV-Set New Selection
Description-US: Deslects all tags and runs the Set Selection command.
Installation:
-------------
1. Save this to a file called "setnewselection.py" in your C4D Scripts Folder
2. Restart Cinema 4D
Usage:
------
1. Select some points/polys/edges
2. Plugins > Scripts > "CV-Set New Selection."
3. Your selection will be saved!
Known Limitations:
------------------
1. It may require multiple undo steps to undo.
2. Does not check object type or mode to verify anything will actually happen.
Author: Donovan Keith <donovanskeith@gmail.com>
Copyright (C) 2017 Maxon Computer Inc.
"""
import c4d
from c4d import gui
def main():
# Deselect all Tags
doc.StartUndo()
doc.SetActiveTag(None, mode=c4d.SELECTION_NEW)
doc.AddUndo(c4d.UNDOTYPE_CHANGE_SMALL, doc)
# Set the Selection
c4d.CallCommand(12552, 12552) # Set Selection
doc.EndUndo()
if __name__=='__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment