Skip to content

Instantly share code, notes, and snippets.

@jamesrobinsonvfx
Last active August 20, 2021 22:52
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 jamesrobinsonvfx/f1a14c93e1046100c1f886b939ffbecb to your computer and use it in GitHub Desktop.
Save jamesrobinsonvfx/f1a14c93e1046100c1f886b939ffbecb to your computer and use it in GitHub Desktop.
Action button script to copy the value of a parameter to the clipboard (linux)
"""Action button script."""
import os
if kwargs["shift"]:
# Copy evaluated parameter string
text = kwargs["parmtuple"][0].evalAsString()
command = "echo -n {0}| xclip -sel clip".format(text)
os.system(command)
else:
# Copy a reference to this parameter
kwargs["parmtuple"][0].copyToParmClipboard()
@jamesrobinsonvfx
Copy link
Author

jamesrobinsonvfx commented Aug 20, 2021

os.system might not be the greatest. I think houdini has a clipboard? Maybe for more than just parms? I'll update if this ever becomes an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment