Notifications
Clear all

[Closed] dotNet: how to quickly fill 2D array with values?

DenisT, your method shows a really an nice boost compared to anything on the maxscript side

here are some benchmarks

ArrayDim: m=500 n=2000

Set(): 19.793s Mem: 118571040L
Cached Set(): 9.067s Mem: 118571040L
IndexFix: 8.518s Mem: 118570760L
DenisT’s: 0.209s Mem: 118570680L

Cached Set() simply caches Set() before entering the loop,
IndexFix eliminates index-1 substraction inside the loop

denisT strikes again!
Thank you very much, this is really helpful and instructive, too!
So you are copying from a jagged array (which can be created with MAXScript alone) to a 2D array.

Someone should preserve this snippet as a great example showing how you can leverage small pieces of C# within 3ds Max. Where would be a good place for this?

I’ll test it in my code asap.

BTW, this solution could be helpful for other purposes than mine, e.g. for quickly creating bitmaps?

– MartinB

Page 2 / 2