Using Macros in 3ds Max

Hi TA,

I’m currently in the process of optimising a falcon model and I was wondering if there was any way that I could automate the optimisation of the feathers as they appear to be instances.



I’ve tried to record a macro but nothing happens when I try to run it.

Could it be to do with the fact that the names of the feathers are different and the macro references the original feather model?

Any help on this would be greatly appreciated as I have minimal experience with MAXScript :\

Thanks,
Mike

  • Problem solved

As with your last post asking for help your screenshot of the recorded macro is too low resolution to be readable. Since I cannot give specific replies to that macro I’ll give some general information that may help.

You are correct in your assumption that since the recorded macro deals with a specific object in the scene it will not work holistically on all similar objects in the scene. How could it? To 3ds Max the scene graph is a collection of point and face data. It has no understanding that some of those points and triangles are what you perceive as feathers and others are not. If you want to perform an action on all objects that represent feathers you will need to write a for loop to iterate over all of the objects in the scene, test them to see if they are a feather object, and then perform the operation you want on the object if it passes that test. In pseudo code that would be something like:

for obj in geometry do (
   if ( matchPattern obj.name "feather" ) == True then ( -- Assumes all feather objects are named with a "feather" prefix
      -- do something
   )
)