3ds Max: Reference an Excel Spreadsheet to assign multiple Material ID values to multiple Objects

Hello, Looking for some input on how to reference an Excel spreadsheet into 3ds Max.  I have not found an example of this...  I want to assign materials ID values and create keyframes to multiple objects. I have a few scripts that are working for me, but I KNOW there is a smarter pipeline. Will pay for a script if anyone wants to take a shot.

The Project:

Create an animation to show population density change over time in a city model. So, each building will change color illustrating how populated it is. This is the animation to date.

http://vimeo.com/38049564

The Current Solution:

Each building object has a multi-sub object material applied. There are 100 ID channels that gradually change in color from white (ID 0) to purple (ID 100). To assign the keyframes; I select a building > run a script > the script prompts me to select a text file that contains my material ID values.  I have to do this for EVERY building and create a txt file for EVERY building because the values are different. The script that I am running is attached.

What I want to Create:

Select multiple objects > Run a script that prompts me for and excel spreadsheet. The object(s) will be assigned the Material ID values that correspond to the object name and column of values.  (see attached jpg of excel sheet)

I hope this is clear. Its actually a simple sequence of actions, I just to automate it and do less clicking.  Any input would be greatly appreciate.  Thanks in advance!

AttachmentSize
excel_redline.jpg183.55 KB
02_utilization_material_id_animator.ms489 bytes
017.txt25 bytes

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
jos's picture

just a thought: maybe you can

just a thought: maybe you can use xml?

ghall1314's picture

I am just learning Max script

I am just learning Max script now.... Computer coding is all new to me. Why would xml be a better choice?

jos's picture

hy sorry for the delay. bit

hy sorry for the delay. bit busy over here.
If you do your stuff in xml you will have to save it as a .CSV file. (comma seperated values). maxscript can read this file as a standard ASCII (text).
You will have to know the meaning of the values while reading.
Just check the help file for MaxScript for syntax regaurding open/reading a file.

More advanced is xml but better overview and structure. you can save your file in excel as an xml file. open both files(CSV and XML) in notepad and check the difference.
maxscript doesnt have a parser for xml code, but you can handle this with dotnet.
here a tutorial for reading xml with maxscript and dotnet.
http://www.eksod.com/2011/04/xml-with-dotnet-on-maxscript/
hope this helps. goodluck!
post your progress

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.