Notifications
Clear all

[Closed] Delete Class Instances In 3dsMax

Hello,

Is there a way to delete properly Class Instances from a 3dsMax Scene : For example I would like to delete all the instances of BitmapTexture or VRayHDRI, how would you do that ?

I tried :

(
instances = getClassInstances BitmapTexture
for instance_ in instances do
	delete instance_
)

with not much success :

鈥?Error occurred in instance_ loop; filename: \LILITH\KelSolaar\Documents\Developement\sIBL_GUI\src emplates\3dsMax\3dsMax_VRay_Standard; position: 98; line: 4
鈥? Frame:
鈥? instance_: Bitmaptexture:Bitmap
鈥? called in anonymous codeblock; filename: \LILITH\KelSolaar\Documents\Developement\sIBL_GUI\src emplates\3dsMax\3dsMax_VRay_Standard; position: 98; line: 4
鈥? Frame:
鈥? instances: #(Bitmaptexture:Bitmap, Bitmaptexture:Bitmap)
鈥?No 鈥渄elete鈥?function for Bitmaptexture:Bitmap

I had memory issues if I don鈥檛 delete allocated resources so I鈥檓 using this trick : replacing the instances by a null one :

(
instances = getClassInstances BitmapTexture
nullObject = BitmapTexture()

for instance_ in instances do
	replaceInstances instance_ nullObject
)

The issue is that it鈥檚 not deleting them, memory wise it鈥檚 ok because the texture is not allocated anymore, but there are still instances left 鈥?/p>

KS

2 Replies

does freeSceneBitmaps() not help?

Hello o/

yeah that鈥檚 what I did in the end

KS