General Category > General CG Discussion
CSV to MAX
(1/1)
n.merazzi:
Hi guys,
I need to create 100 variations of 3D texts to render. Example below:
In 3ds Max I have some 3DTexts - "Project:" "File:" "image:"
in my csv file I have columns with these names. and each line has the proper name of each project, file and image.
Anyone know if already exist a plugin/script that can import these variations from a csv file and rename them in 3D Text?
Thanks for your help!
James Vella:
1. You need a parsing method for the csv file (dotnet regex works well for this task). ChatGPT is also good at building regex patterns if you are specific enough.
2. Store the parsed text into an array, example ("first", "second", "third")
3. Pass this array into the 3D text:
--- Code: ---myarray = #("first", "second", "third")
for i in myarray do
(
thetext = text size:100
thetext.text = i
)
--- End code ---
Edit:
Keep in mind the most important part of this process is step (1). You will not find a script anywhere online that can use your csv file and parse the data without a specific regex pattern (unless your csv file is formatted exactly as the script requires). This is because one tiny little change in the formatting can change every single text file, this can be a comma, a tab, a new line, a phrase, a title etc... Once you solve step 1 you can then extract all the data you need for the rest of the script which is fairly simple. Just be aware sometimes you will need multiple regex patterns if your csv is not so easy to read, if you can do it in one step congrats you are on your way. Sometimes you may need to break it down for example, regex:1 would be the column you need, regex:2 would be the data within that column since there may be other data you want to exclude, say for example all rows that contain the words "Item #1", "Item #2" or something etc.
Navigation
[0] Message Index
Go to full version