Kel Solaar
05-16-2010, 10:49 AM
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\templates\3dsMax\3dsMax_VRay_Standard\; position: 98; line: 4
-- Frame:
-- instance_: Bitmaptexture:Bitmap
-- called in anonymous codeblock; filename: \\LILITH\KelSolaar\Documents\Developement\sIBL_GUI\src\templates\3dsMax\3dsMax_VRay_Standard\; position: 98; line: 4
-- Frame:
-- instances: #(Bitmaptexture:Bitmap, Bitmaptexture:Bitmap)
-- No "delete" function for Bitmaptexture:Bitmap
I had memory issues if I don't delete allocated resources so I'm 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's not deleting them, memory wise it's ok because the texture is not allocated anymore, but there are still instances left ...
KS
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\templates\3dsMax\3dsMax_VRay_Standard\; position: 98; line: 4
-- Frame:
-- instance_: Bitmaptexture:Bitmap
-- called in anonymous codeblock; filename: \\LILITH\KelSolaar\Documents\Developement\sIBL_GUI\src\templates\3dsMax\3dsMax_VRay_Standard\; position: 98; line: 4
-- Frame:
-- instances: #(Bitmaptexture:Bitmap, Bitmaptexture:Bitmap)
-- No "delete" function for Bitmaptexture:Bitmap
I had memory issues if I don't delete allocated resources so I'm 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's not deleting them, memory wise it's ok because the texture is not allocated anymore, but there are still instances left ...
KS
