Notifications
Clear all

[Closed] The structure of maxscript is painful

struct testDef
(
	info = "no info",

	fn addInfo txt =
	(
		append this.info txt
	)
)


fn getInfo =
(
	t = testDef()
	t.addInfo "add some info contnet."
	
	t2 = testDef()
	t2.info
)
getInfo()
getInfo()
getInfo()

The right result

#Struct:testDef(
  addInfo:<fn>; Public,
  info:<data>; Public)
getInfo()
"no info"
"no info"
"no info"

max 2022:

#Struct:testDef(
  addInfo:<fn>; Public,
  info:<data>; Public)
getInfo()
"add some info contnet."
"add some info contnet.add some info contnet."
"add some info contnet.add some info contnet.add some info contnet."
3 Replies

Max 2022 is not working correctly … this is a bug and needs to be fixed. My guess is that in MAX 2022 #this now means not an instance of a structure, but its definition. It is wrong and cannot be accepted in this way.

1 Reply
(@denist)
Joined: 10 months ago

Posts: 0

Please post this example on AREA

It has been fixed apparently