[Closed] Scripted material with images
I’m currently doing scripted material plugin for our in-house use and i need to show images of textures in the material editor. So when user selects different texture I need to change the image for it too.
I think i’m going to use dotnet picturebox for this but my concern is how should I handle things memorywise. Texture sizes will be around 32mb to 64mb at least and there will be few of those in one material.
Anyone got ideas is there something i must do or something i really should not do?
If you have to show them – then you have to show them
But maybe make it a optional feature? – so that if your user does not need the preview they can simply uncheck the ‘preview’ checkbox.
Also – is there a specific reason for why you need to show it in a picturebox and not the ‘standard’ way a material is shown in 3dsmax (material slot + viewport)?
I actually ended up using ImgTags and also script creates temporary thumbnail images for used textures so I don’t have to worry about big files. Haven’t noticed any problems so far with memory consumption or anything.
We are using custom shader with multiple textures so materialslot image is not enough. Also it’s easier for artists to see what textures they actually use because texture names are not always very descriptive.
good news:
you will be probably safe using .net picturebox meaning the memory usage. the max will allocate a memory but it probably will be a system memory (not max script memory)
bad news:
it might dramatically slow down the scene loading process.
it’s very tricky to handle .net control event in scripted plugin (including materials)
it’s pretty hard for not experienced developer to handle the change of texture file on fly
ps. the using of image tag needs the opening a bitmap. it creates a new bitmap in max script memory. this one takes a memory and might cause the memory leaking