View Full Version : How do I locate a object with missing OSM?


Lander
10 October 2006, 10:05 AM
I have got a old scene from the Max 5 days that contains "solidify" modifier that I can't find a recompile for (max8). Can anyone tell me if there is a script or way to list any objects in the scene that contains a Missing OSM in the modifier stack?

It's a really bis scenen so it would really help alot if it's possible.

thank's

-lander

j-man
10 October 2006, 11:07 AM
Hello Lander,

Yes, I can tell you.

Yes.

and here it is:


-- written by joshuanewman
-- www.joshuanewman.net

obj=#()
format "Find Missing OSM's\n"
format "Processing % objects\n" objects.count
for s in objects do if isgrouphead s==true then setgroupopen s true -- open all group heads
for s in objects do
(
msg=#()
format "% - " s.name
for m=1 to s.modifiers.count do if classof s.modifiers[m]==Missing_OSM then append obj s -- make array of all missing modifiers
if msg.count !=0 then
(
format "modifiers %\n" msg
for m=msg.count to 1 by -1 do deletemodifier s msg[m] -- deletes missing modifier
) else format "none\n"
)
select obj
format "% objects with Missing OSM's\n" obj.count
--for s in obj do for m=1 to s.modifiers.count do if classof s.modifiers[m]==Missing_OSM do deletemodifier s m


J.

Lander
10 October 2006, 11:15 AM
Thank's ALOT. I'll give it a shot and as it will probably work I'll spend the rest of the day crying in relief.

j-man
10 October 2006, 11:18 AM
actually,

that code is a bit redundant, but reliable (old reliable!)

let it not be said that my maxscript hasn't advanced over the years! remember to open your groups first:


i=getClassInstances Missing_OSM
o=for m in i collect (refs.dependents m)[3]
select o


J.

Lander
10 October 2006, 08:44 PM
I never was able to wrap my head around the scripting part of programs. I tend to give it a half hearted shot every six months or so with the usual lerning curve of: I get it, I get it, got it..... No, now I don't get it at all. I'm truly greatful for those lines. I have looked for a solution for this for a loong time. Stupid of me not to post here earlier. Anyway. I have now shed a few tears of happiness and will sleep like a baby.

Thank's bigtime

j-man
10 October 2006, 08:19 AM
no problem, I'm glad to help. And I hope that these little snippets will inspire and help you to making that curve a little more shallow.

J.

CGTalk Moderation
10 October 2006, 08:19 AM
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.


1