Notifications
Clear all

[Closed] Maxscript struct events

Hi there,

I have the following code:

struct myStruct
(
	Firstnumber = 150,
	Secondnumber = 249,
	Thirdnumber,
	
	fn CalculateThirdnumber =
	(
		Thirdnumber = Secondnumber-Firstnumber
	),
	
	on Firstnumber changed do
	(
		CalculateThirdnumber()
		print ("Thirdnumber: "+Thirdnumber)
	)
)
TestInstance = myStruct()
TestInstance.Firstnumber = 130

What i am trying to achieve is the third number getting calculated as soon as the first or second number getting changed. I couldn’t find sufficient help on the helpfiles and searching doesn’t give me any answers. The on…changed event does not fire. Is there any way to make this happen?
Any Ideas?

2 Replies
 lo1

This is not supported. A struct is not a paramblock, and maxscript is not c#…

you’ll have to build this sort of mechanism yourself.

Hm Yeah, i kinda expected that.

Thanks for letting me know