2 Lists all of the notification codes broadcast by 3ds Max,
3 and registers a callback function for each and every one.
13 if not name.startswith(
'_'):
17 if ((type(val) == int)
and (val <= 0xFFFF)):
18 print "Notification code ", name,
" = ", val
19 codelookup[val] = name
21 print "Number Notifications registered: ", count
23 def somethingHappened(code):
24 print "Something happened: " , codelookup[code]
29 for code
in codelookup.iterkeys():
33 print "Creating sphere"
35 print "Setting radius for sphere 1"
36 sphere1.ParameterBlock.Radius.Value = 2.0
37 print "Creating node for the sphere"
39 print "Creating sphere 2"
41 print "Setting radius on sphere 2"
42 sphere2.ParameterBlock.Radius.Value = 2.0
43 print "Creating node for sphere 2"
45 print "Setting parent of node 2 to node 1"
46 sphere2node.Parent = sphere1node
51 print "Deleting node 1"
53 print "Deleting node 2"
58 except Exception, err:
59 print 'ERROR: %s\n' % str(err)
61 except MaxBaseException
as e:
62 print 'MaxBaseException occured'
65 print "Unexpected error:", sys.exc_info()[0]
68 print 'unregistering notification handlers'
69 for h
in list(MaxPlus.NotificationManager.Handlers):