Jump to content

onCopy event in hda


sanostol

Recommended Posts

There is no copy/paste event, which is lame, I RFE that a while ago, but you can workaround this with OnNameChanged event. Print the kwargs args and see the difference between duplicating a node and just renaming, it's a little bit tricky though. I don't have a code with me now.

Link to comment
Share on other sites

  • 2 years later...
def is_copy_paste_event(kwargs):
    if not kwargs['node'].name().startswith('original') and not kwargs['old_name'].startswith('original'):
        original_node = kwargs['node'].parent().node('original0_of_%s' % kwargs['old_name'])
        return True if original_node else False

 

Use this in an OnNameChanged event handler

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...