[python][MaxPlus] Inherit INode Class

[python][MaxPlus] Inherit INode Class

Anonymous
Not applicable
383 Views
0 Replies
Message 1 of 1

[python][MaxPlus] Inherit INode Class

Anonymous
Not applicable

I woul like to inherit INode class in order to act some custom properties and methods to this new class, but for some reason is not working with the usual syntax to do this in python. Any idea why is that?

import MaxPlus

class CustomNode(MaxPlus.INode):
	"""docstring for MaxNode"""
	def __init__(self, nodes):
		MaxPlus.INode.__init__(self)
		self.test = "showme"

MaxPlus.Core.EvalMAXScript("point()")

p = CustomNode.GetINodeByName("Point001")

print isinstance(p, MaxPlus.INode) # this returns True

print p.test #   <type 'exceptions.AttributeError'> 'INode' object has no attribute 'test'
0 Likes
384 Views
0 Replies
Replies (0)