Notifications
Clear all
[Closed] CacheOps Weird Behavior
Dec 05, 2012 9:40 pm
Hi Everyone,
I’m currently working with PointCache file with maxscript and i’m having troubles trying to make it work properly. Here is my code (i just kept the lines that throw exception) :
for obj in selection do
(
PCMod = obj.modifiers[#PointCache]
cacheOps.Unload PCMod
)
If i have one object selected it work nicely, the PC is Unloaded, but if i have more than one object selected it throws an exception :
Runtime error: Cache Not Selected In Modifier StackPoint_Cache:Point Cache
I can’t figure out why the code don’t work for more thant one object selected.
Thanks.
Tony.
2 Replies
Dec 05, 2012 9:40 pm
Do you have to be in the modifer stack for the object in question, im working with point cache atm and tend to do:
max modify mode
--Call your loop
modpanel.setCurrentObject obj.modifiers[#PointCache]
Dec 05, 2012 9:40 pm
I found the way, using your advice :
myselection = selection as array
for i=1 to myselection.count do
(
max modify mode
PCMod = myselection[i].modifiers[#PointCache]
--Call your loop
modpanel.setCurrentObject PCMod
cacheOps.Unload PCMod
)
I need to store the selection first because setCurrentObject change this selection.
Thanks.