Skip to content

Instantly share code, notes, and snippets.

@tcrowson
Last active April 14, 2021 18:29
Show Gist options
  • Save tcrowson/8275360 to your computer and use it in GitHub Desktop.
Save tcrowson/8275360 to your computer and use it in GitHub Desktop.
For Softimage. A quick snippet for running the text in an Annotation property as Python code. This allows you to store Python code in an Annotation property, as part of a scene or model, and run in later. Running this will drop you into a pick session, asking you to choose an Annotation property. No special error handling for now, it's brute-for…
# Puts the user into a pick-session, asking you to select an Annotation property
# whose text it will then run as Python code.
from win32com.client import constants
annotation = Application.PickElement(constants.siPropertyFilter,'Choose an Annotation Property','Choose an Annotation Property')[2]
exec annotation.Text.Value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment