Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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