Maya 2020 fundamentals - modelling the real world
Get halfway through a model and find it's an unworkable mess? Can't add edge loops where you need them? Can't subdivide a mesh properly? If any of this sounds familiar check this course out.
# 1 28-10-2020 , 04:53 PM
Registered User
Join Date: Jan 2020
Posts: 7

Maya Script reading txt-file and interpret data

Hello world!
I am currently experimenting with txt files inside maya. F.e.
"
1 sphere
2 cube
3 cylinder
4 cone
5 plane

"

The left column reflects a frame number and the right an objectname.
I want to read the file and interact with an object only for a specific frame. For example switching the visibility of an object on and off.

this is what i got so far:

fileHandle = open('c:\\text.txt', 'r' )
str1 = fileHandle.read()
fileHandle.close()
print str1

(This doesn't have to be written in Python. MEL is perfect aswell)
I know how to read the file and save it to an string but not how to navigate inside.
Perhaps someone is experienced enough to help user added image
Thank you very user added image

# 2 30-10-2020 , 10:30 AM
Registered User
Join Date: Jan 2020
Posts: 7

Posting Rules Forum Rules
You may not post new threads | You may not post replies | You may not post attachments | You may not edit your posts | BB code is On | Smilies are On | [IMG] code is On | HTML code is Off