alrawli Posted July 29, 2008 Share Posted July 29, 2008 We have a file with positions of bollards and these positions are marked in Max as Point Helpers and we would like to replace these en masse with a bollard model. Ive got a couple of replace scripts which work with replaceing objects for objects but they dont seem to work with replacing a helper for an object. Does anyone know of any work arounds or scripts out-there? Cheers Al. Link to comment Share on other sites More sharing options...
Dave Buchhofer Posted July 29, 2008 Share Posted July 29, 2008 Hmm, couldn't find it online, so i dont remember what the original authors name was (i *think* it was swami), but this works. ( fn objsToProcessAsArray objsToProcess = ( if classOf objsToProcess==array then ( if objsToProcess.count!=0 then return objsToProcess else return undefined ) if objsToProcess==undefined then return undefined if classOf objsToProcess==ObjectSet or classOf objsToProcess==PathName then ( objsToProcess=objsToProcess as array if objsToProcess.count!=0 then return objsToProcess -- At least one object in array. else return undefined -- NO objects in array! ) -- Check for single object passed (and convert to array if true). local validSuperClasses=#("camera","GeometryClass","helper","light","shape","SpacewarpObject") local sClassObjsToProcess=(superClassOf objsToProcess) as string for sClass in validSuperClasses where ( local execStr="superClassOf objsToProcess==" execStr += (sClass as string) execute execStr ) do ( return #(objsToProcess) ) if classOf objsToProcess==SelectionSet then ( return (for obj in objsToProcess collect obj) ) undefined -- If none of the above checks are true, then 'objsToProcess' was invalid -- (e.g. an integer, float, etc.). ) fn instanceEm objsToProcess:(getCurrentSelection()) = ( objsToProcess=objsToProcessAsArray objsToProcess if objsToProcess!=undefined AND objsToProcess.count>1 then ( local objMaster, obj objMaster=objsToProcess[1] for i=2 to objsToProcess.count do ( obj=objsToProcess[i] instanceReplace obj objMaster ) select objMaster ) ) format "test" instanceEm() ) Link to comment Share on other sites More sharing options...
quizzy Posted July 29, 2008 Share Posted July 29, 2008 you can always try my random replacer.. its not only for multiple objects, you can select one obejct and then run the script. Link to comment Share on other sites More sharing options...
Crazy Homeless Guy Posted July 30, 2008 Share Posted July 30, 2008 you can always try my random replacer.. its not only for multiple objects, you can select one obejct and then run the script. I use your random rotate at least a couple of times a week. Right now I am using the make cameras an animated camera. Thanks. Link to comment Share on other sites More sharing options...
alrawli Posted July 30, 2008 Author Share Posted July 30, 2008 Thanks for the replys guys! Quizzy that script is great did the job perfectly! Thanks very much! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now