Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

copy by reference or copy by vale

copy by reference or copy by vale

Anonymous
Not applicable
578 Views
1 Reply
Message 1 of 2

copy by reference or copy by vale

Anonymous
Not applicable

I was curious if it is known if maxscript will copy by reference or by value in default mode? For arrays I meant in assigning via the = operator.

 

Thx!

0 Likes
Accepted solutions (1)
579 Views
1 Reply
Reply (1)
Message 2 of 2

Swordslayer
Advisor
Advisor
Accepted solution

Yes, it's documented and it's nothing out of ordinary. If you mean assigning to the variable, you have to explicitly pass it by reference, if you mean assigning the members, ie arr[i] = x, you'd have to explicitly copy (copy contents by reference)/deepCopy (copy contents by value) the array to avoid overwriting original contents.

0 Likes