GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Searcher/python3.10libs/searcher/nodegraphhooks.py at master · instance-id/Searcher

Expand file tree

/

nodegraphhooks.py

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
62 lines (48 loc) · 2.44 KB
/

nodegraphhooks.py

Copy path

File metadata and controls

62 lines (48 loc) · 2.44 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import os
import sys
sys.dont_write_bytecode = True
import hou
from PySide2 import QtWidgets
from houdini_markingmenu import markingmenu as mm
from canvaseventtypes import *
import nodegraphbase as base
sys.path.insert(0, os.path.join(hou.getenv('HOUDINI_USER_PREF_DIR'),
'python2.7libs',
'houdini_markingmenu'))
import buttonfunctions as cmds
def buildHandler(uievent, pending_actions):
import nodegraph # to avoid circular imports
class MarkingMenuMouseHandler(nodegraph.NodeMouseHandler):
def handleEvent(self, uievent, pending_actions):
if isinstance(uievent, MouseEvent) and uievent.eventtype == 'mousedrag':
reload(mm)
for entry in QtWidgets.QApplication.instance().allWidgets():
if type(entry).__name__ == 'NEMarkingMenu':
entry.setParent(None)
entry.close()
markingMenu = mm.NEMarkingMenu(uievent.editor)
# return None if we handled event and launched a marking menu
return None
# Return traditional nodegraph rmb handling if we didn't launch a marking menu
# If an input, output, or dependancy arrow was right clicked, for example.
return nodegraph.NodeMouseHandler.handleEvent(
self, uievent, pending_actions)
return MarkingMenuMouseHandler(uievent)
# We catch the mousedown event and then further handling is done by our custom class
# createEventHandler catches mouse events and either does stuff
# and/or returns an eventHandler class with a handleEvent() method that
# handles the events until completion of the event or hands it off to a different handler
# createEventHandler catches events (see "Extending the Network Editor docs page")
# every time an event is registered, we check to see if it's a right mouse button being held down
# if it is, we check to see if our menu variable is set to 1
# if our menu is on, then we call our custom function that wil ultimately open our menu window
def createEventHandler(uievent, pending_actions):
if isinstance(uievent, MouseEvent) and uievent.eventtype == 'mousedown' and uievent.mousestate.rmb:
reload(cmds)
if uievent.selected.item is None:
if cmds.MENU_ACTIVATE:
a = buildHandler(uievent, pending_actions)
return a, True
else:
return None, False
return None, False
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.