Notifications
Clear all

[Closed] Using Base64 encoded strings – New Article on LoneRobot.com

Hi all,

Just a note to say I’ve posted a new article about Base64 encoding in 3dsMax on my site. It’s part of my research to find ways of deploying scripts without the need for image files or dependancies. Included is a small utility that can convert your images into strings to use, and a function for converting them back. Click the image to read it!

[]( http://lonerobot.net/?p=314 )

15 Replies

Handy. And with your usual knack for presentation!

Awesome I used to convert bitmap pixels to rgb string arrays and them converting it back, but using base64 it´s really nice and fast.

Congratulations and thanks a lot for sharing

Thanks Fabio, Dr, you are welcome!

 PEN

This is great, and just what I needed…umm, what can I use this for:S

a… fully portable script file that doesn’t leave data on the host machine (to limited extent)? Maybe… most of what you might use this for is something that you’d typically do with a .MZP . It’s fun to play with, regardless

Great idea!

p.s. When I’ll tried download file it is not found, can it be fixed?

Hi Mike,

My apologies, It is fixed now.

Hello Pete,

I was trying yous base64 script but ran into an error:
>> MAXScript Rollout Handler Exception: – Runtime error: dotNet runtime exception: Cannot widen from source type to target type either because the source type is a not a primitive type or the conversion cannot be accomplished. <<
It’s in the line

memstream = dotnetobject "System.IO.MemoryStream" bytearr

of the function which converts string to image.

Also when I try just the function to convert an image into a string it doesn’t work. Maybe i’m missing some loadassembly at the top, but I wouldn’t know which. Could you help me get it to work?
I’m on a 64 bit machine btw.

Klaas

hi klaas, i’ve tried the script on a 64bit computer and it seems to work okay. Have you downloaded the utility from the article and tried it? – the code example is just a portion and doesn’t contain the imageclass declaration. if the rollout runs, it is working as the lonerobot logo on the corner is loaded from a base64 string!

Page 1 / 2