CGTalk > Software > Autodesk 3ds max > 3dsMax SDK and MaxScript
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 12-12-2011, 08:47 PM   #1
PEN
R&D/Technical Director
 
PEN's Avatar
portfolio
Paul Neale
PEN Productions
Canada
 
Join Date: Jun 2002
Posts: 7,416
deleteDef not deleting??

Code:
fn removeUnusedDefs = ( sceneDefs=custAttributes.getSceneDefs() for x in sceneDefs where x.name==#joyStickContainer do ( try(custAttributes.deleteDef x)catch(print x.name) ) ),


Simple enough function, check to see if the def exists and try and delete it. getOwner returns undefined when I check it as well. The def has been assigned to a modifier in the scene and then Max has been reset. At that time I try and do a clean up of unused defs and it will not remove it.

Here is a simple test script. Am I getting rusty from all the modeling that I have been doing as of late? Why does this error?

Code:
t=teapot() ah=emptyModifier() addModifier t ah def=attributes test ( ) custAttributes.add ah def resetMaxFile #noPrompt --Now try and get rid of it. defs=custAttributes.getSceneDefs() testDefs=for x in defs where x.name==#test collect x gc() ah=undefined testInstances=for x in testDefs collect custAttributes.getDefInstances x for x in testInstances do print (custAttributes.getOwner x[1]) for x in testDefs do custAttributes.deleteDef x
__________________
Paul Neale
http://paulneale.com
 
Old 12-12-2011, 09:32 PM   #2
Pjanssen
Veteran
portfolio
Pier Janssen
Göteborg, Sweden
 
Join Date: Apr 2003
Posts: 2,400
I've had my share of issues with this function too; maybe this is helpful to you in some way:
http://forums.cgsociety.org/showthr...?f=98&t=1014476
 
Old 12-12-2011, 11:57 PM   #3
PEN
R&D/Technical Director
 
PEN's Avatar
portfolio
Paul Neale
PEN Productions
Canada
 
Join Date: Jun 2002
Posts: 7,416
Thanks, that is the same issue.
__________________
Paul Neale
http://paulneale.com
 
Old 12-12-2011, 11:58 PM   #4
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,480
Thread automatically closed

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.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright ©2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 11:52 PM.


Powered by vBulletin
Copyright ©2000 - 2016, Jelsoft Enterprises Ltd.