Jump to content

scripting help = rename object by applied material?


BrianKitts
 Share

Recommended Posts

could anyone help me in making a simple script that would rename all the objects in the scene based on the material that is applied to that object?

 

I'm testing a new workflow from Archicad11 into 3dsmax, such that you export from Archicad11 as a 3ds file seperating all objects by their assigned material. Then after import into max I am using the ml_plugins material replacer to update the newly imported model using the material library from the previous version of the model. It's great works well and is quick for updating the model, while keeping all your previously applied materials.

 

The only thing that I don't like is that all the objects in the scene have bogus names based on the archicad export. I know there will be no duplicate names if I reassign all of the geometry named by its associated material assigned in max, so I'm trying to find a way to do it, with my zero maxscript skills.

 

any help would be greatly appreciated. Till then.... looks like i'll be reading through maxscripting lessons!

 

thanks- bk

Link to comment
Share on other sites

perfect! thanks a mil.

 

you know the funny thing is I know enough C++ and Director Lingo for scripting that just reading your code I knew exactly how you were doing it, I just really need to start learning the syntax for maxscript so I can start making my own tools.

 

So I made a "new script" copied in the code. Saved it out. So I can hit run script, select my saved file. and we're golden. Is there a way to assign that script to either a button on the interface or make it an option in the tools drop down? I found how to put a "run script" into the UI, but I can't figure out how to assign my specific script.

Edited by BrianKitts
Link to comment
Share on other sites

HAA HAAA I'm still singing!

 

I now have a streamlined workflow for updating archicad models. I now can update my max models using revisions made in archicad. Once the material reassignment plugin is setup, I can import models, update the materials, and rename all the objects in about 20 seconds. STELLAR!

 

again - a big THANKS for the help!

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...