gemini Posted July 23, 2020 Share Posted July 23, 2020 Hi, Can it be possible to make difference in event callbacks with copy, alt drag and rename a node. The problem is when Houdini make a node copy ( duplicate, or copy paste ) makes a renaming too. So in scripting I could not figure out how to determine which event occurs. So I want to know when rename or copy paste or alt drag happened. THANKS IN ADVANCE ! G Quote Link to comment Share on other sites More sharing options...
Stalkerx777 Posted July 24, 2020 Share Posted July 24, 2020 Quote Link to comment Share on other sites More sharing options...
gemini Posted July 28, 2020 Author Share Posted July 28, 2020 (edited) Thanks for your answer ! Have a nice day ! I extended the code like this: 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 def checkAltDown(): from hutil.Qt import QtWidgets from hutil.Qt import QtCore m = QtWidgets.QApplication.keyboardModifiers() return m == QtCore.Qt.AltModifier if is_copy_paste_event( kwargs) and checkAltDown(): print 'alt_dup', kwargs['node'] hou.session._node_copy_mode_ = 'alt_duplication' elif is_copy_paste_event( kwargs): print 'copied', kwargs['node'] hou.session._node_copy_mode_ = 'copy_of_node' elif not 'original' in kwargs['node'].name(): if hasattr( hou.session, '_node_copy_mode_'): if hou.session._node_copy_mode_ == 'alt_duplication': print 'alt_renamed', kwargs['node'] elif hou.session._node_copy_mode_ == 'copy_of_node': print 'copy_renamed', kwargs['node'] del( hou.session._node_copy_mode_) else: print 'simple_renamed', kwargs['node'] Edited July 28, 2020 by gemini 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.