PDA

View Full Version : Delete Class Instances In 3dsMax


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

denisT
05-16-2010, 02:19 PM
does freeSceneBitmaps() not help?

Kel Solaar
05-16-2010, 02:35 PM
Hello o/

yeah that's what I did in the end :)

KS

CGTalk Moderation
05-16-2010, 02:35 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.