Last active
August 20, 2021 22:52
-
-
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)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""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() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.