ScriptSpot

Forum topic · General Scripting

Help! Generating spheres; preset diameters, names, and possibly colors.

By fluffmachine · 2015-02-04

Description

Hi All,

I have a question about Maxscript that I just can't seem to figure out on my own so i'm turning to the experts!

I'm currently creating a Solar System animation in Max and AE. I'm starting in Max by creating all the celestial bodies. Initially I created the 9 planets but then I thought it would be even better to have 400+ other bodies like asteroids, comets, dwarf planets, moons and others in there too. Creating one sphere at a time is...well, less than ideal so I'd like to know if there is a script I can create (or maybe something similar exists) that would pull info from a .txt or excel file. I have all the data in Excel right now.

Thanks in advance.

Comments (2)

animation

pixamoon · 2015-02-06

Do you have animation data in the file too ? Orbits, speed, location ? Do you want to create whole animation in one click ? :)

sure

pixamoon · 2015-02-06

Hey,

You can export Excel to CSV or txt with csv structure. Then read it with the simple script. Please see attached.

How CSV should look:
Every planet in single line. Every value separated with "|" character.

for eg: (name|radius|x|y|z|sphere segments)

Sun|20|0|0|0|12
Earth|2|100|100|0|12

And so on.

If you need apply specific colors then add extra 3 numbers controlling rgb (egz |0|10|200)

Hope it helps.

Attachments