Beer glass scene creation
This course contains a little bit of everything with modeling, UVing, texturing and dynamics in Maya, as well as compositing multilayered EXR's in Photoshop.
# 1 24-11-2006 , 07:00 AM
Registered User
Join Date: Nov 2006
Posts: 2

Make an animation from a file

Hi, I have to achieve this task:

- Modeling some 3D objects
- Make them moving in a scene, following dati from a file
- Make an animation

Optional task (quite important)

- To create an external thing (program, command line) to generate animation from the data-file. Something like

makeanimation 1.dat

to have

1.avi

Questions:

1- Is it possible? SDK related?
2- Related Tutorials available?

PS: ofc no problems about the modeling.

# 2 24-11-2006 , 11:39 PM
Registered User
Join Date: Nov 2006
Posts: 2
Since there are some view but no answer, I'll try to explain better (I don't want even to think there isn't any answer user added image )

Let's say I have this file:

Frame1:
Object1 xxx, yyy, zzz
Object2 xxx, yyy, zzz

Frame10:
Object1 xxx, yyy, zzz
Object2 xxx, yyy, zzz

and so on.
I want a script that moves every object (present in the project, not file related) in the right positioning, making a keyframe from every designed frame.
And that's all user added image

I use Maya 7.0, dunno if it changes something...

# 3 25-11-2006 , 02:31 AM
enhzflep's Avatar
Subscriber
Join Date: Oct 2006
Location: Melbourne
Posts: 313
Read your post before. Just had no idea at that stage - but your clarification is good-value.

Haven't gone that far myself yet, but after reading your pos i've just done some reading in the maya help files. Mainly because I didn't know anything about maya's fle i/o capabilities were.

So anyway, In answer to your three q's.

Yup.
Nope. (For both software developer's kit and setting driven keys)
Don't know.

Have noticed, you'll often get the function name echoed in the script editor after executing any function. If not, open the script editor and toggle the Script->Echo All Commands menu option to on. This can often be a quick way of finding out how to do something, rather than looking it up.

The info's probly all there in the maya help files. But I guess the first step's to read the input file.
Reading from Help -> Using Maya -> MEL and Expressions ->I/O and interaction -> Reading and writing files, there's an ex given to read and print the lines of a file. You can try it by entering the following into the script editor

// Read a file one line at a time
string $exampleFileName = "C:/Demo.txt";
$fileId=fopen($exampleFileName,"r");
string $nextLine = `fgetline $fileId`;
while ( size( $nextLine ) > 0 ) {
print ( $nextLine );
$nextLine = `fgetline $fileId`;
};

Just remember to create a text file and save it to
C:\Demo.txt

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

Similar Threads