Skip to content

Instantly share code, notes, and snippets.

@NiklasRosenstein
Created September 20, 2013 09:36
Show Gist options
  • Save NiklasRosenstein/6635220 to your computer and use it in GitHub Desktop.
Save NiklasRosenstein/6635220 to your computer and use it in GitHub Desktop.
import c4d
def main():
# Retrieve the document settings.
bc = doc.GetSettingsInstance(c4d.DOCUMENTSETTINGS_DOCUMENT)
# Retrieve the current bitmask for the states of the selection filters.
flags = bc.GetLong(c4d.DOCUMENT_SELECTIONFILTER)
# TOOD: Store the current state of the "flags" value somewhere"
# Create a bitmask which disables all selection filters but the
# "Joints" filter.
flags = (c4d.SELECTIONFILTERBIT_NULL | c4d.SELECTIONFILTERBIT_POLYGON |
c4d.SELECTIONFILTERBIT_SPLINE | c4d.SELECTIONFILTERBIT_GENERATOR |
c4d.SELECTIONFILTERBIT_HYPERNURBS | c4d.SELECTIONFILTERBIT_DEFORMER |
c4d.SELECTIONFILTERBIT_CAMERA | c4d.SELECTIONFILTERBIT_LIGHT |
c4d.SELECTIONFILTERBIT_SCENE | c4d.SELECTIONFILTERBIT_PARTICLE |
c4d.SELECTIONFILTERBIT_OTHER) # | c4d.SELECTIONFILTERBIT_JOINT)
# Set the bitmask to the document settings.
bc.SetLong(c4d.DOCUMENT_SELECTIONFILTER, flags)
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment