[Closed] Garbage Collection Bug?
I’ve noticed a rather annoying bug when running garbage collection after wiring parameters… It seems to be removing animation sub-controllers!
Try this… Create 2 boxes and set up a 2 way wire on the z rotations… Set some keys then run gc(). After the garbage collection the sub-controller on the master object is gone, along with the key data and the ability to set new key frames.
Is there anyway around this aside from not running gc() (which may automatically get called anyway)?
you’re lucky… when I try, once in a while, it just right-out crashes (Max 9 and Max 2009, 32bit). whoops?
hrm… That whole two-way wiring seems horribly crashy in general.
Anyway… here’s a workaround to your specific problem, but you’re not going to like it.
After you set up the two-way, get the subcontroller through <wirecontroller>.slaveAnimation and assign that to a variable, and do a gc() . The subcontroller now remains. Hooray.
Now set that variable to ‘undefined’ and call gc() again. byebye-subcontroller.
So apparently that controller doesn’t actually ‘exist’ anywhere except in memory and is subject to garbage collection? Total guesswork there, but the above would indicate such.
So to fix this more long-term, create a custom attribute on your scene with a maxobjecttab parameter, and stick the subcontrollers for your two-way wirings in that array parameter. The subcontrollers should then continue to be referenced in the scene (via that custom attribute) and not get removed upon gc().
Still seems odd, though
This makes sense that after merging on some occasions the wires brake, and why they broke constantly in older version of max, don’t know exactly when that started, but we lost a lot of wires after it first got out and stopped using it until recently where things are going a bit better now, except for this problem then. I would log it! At least sent in the CER after the crash.
-Johan
haven’t the foggiest if / to what extent it would be related, really. This seems like a rather odd thing to have gone unnoticed for this long so either…
A. we’re just seeing things / doing something wrong
B. nobody’s been using 2-way wirings (which, granted, are weird)
C. they have been, noticed crashes/odd behavior, and simply discarded it and moved on without a peep %)
Where -did- that bug report form go…
(then again, maybe it’s fixed in 2010)
Isnt there a patch for max 9 on the area or autodesk site, im sure i saw something up there.
Not sure about that, but a hotfix for 2010 – http://usa.autodesk.com/adsk/servlet/ps/dl/item?siteID=123112&id=13326570&linkID=9241178 – seems to include something that might be related.
Parameter Wiring
When Resetting a Scene Parameter, Wire Sub-Controllers would be removed due to the Maxscript Garbage Collection clean-up process. This only occurred when the scene was Reset or an XRef tree was deleted. It did not occur when exiting with a scene Open. This clean-up procedure was fixed for all instances of scene change states.
Hopefully that fixes some of these problems; although you’ll need 2010 for it, of course.