Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® Maya® / Python / Special Maya/Python Project - Need Help
  RSS 2.0 ATOM  

Special Maya/Python Project - Need Help
Rate this thread
 
55007
 
Permlink of this thread  
avatar
  • masmidow
  • Posted: 26 April 2011 09:33 AM
  • Total Posts: 4
  • Joined: 26 April 2011 04:25 PM

Hey All,

I am not a particularly gifted programmer, and I am unfamiliar with Python (the embedded programming language in Maya). My project requires me to take input (in the form of images) from my website and put them into my Maya template. The animation that the images will be put into is an album art animation. I also would like it to render the whole animation once the user submits the images. Thanks in advance for any advice you can give me on how to go about getting this done.

Brock



Replies: 0
avatar
  • THNKR
  • Posted: 26 April 2011 10:30 AM

That sounds like you’d want someone to do it for you. And even then, it’s not clear what you want exactly. How are you going do do this in Python if you don’t know Python? Do you need help writing the requirements so you can give the specs to a Python programmer?



Replies: 0
avatar
  • masmidow
  • Posted: 26 April 2011 11:35 AM

Hey! Thanks for the quick response.

I don’t expect anyone to do the project. Let me be a little clearer.

I would like to know if anyone has come across something similar or if they have done something like this. Looking for advice from someone who is familiar with Maya’s API. The program would need the following functionality: to take input (image files) and place it into a Maya template. The animation can be seen here:

http://www.youtube.com/watch?v=d_Xm69tbRn4

Each page in this animation would correspond to an image file. Maybe all I need to know is how complex the project is. Thanks!



Replies: 0
avatar

I don’t know what would need programmed… it looks like a modeling/animation task using the pictures as textures.



Replies: 0
avatar
  • THNKR
  • Posted: 26 April 2011 01:52 PM

I’ve worked on stuff like that. You have a set of standard models, say aluminium cans or plastic bottles, and a set of images. You tell Maya to load a model, assign images from a repository somewhere as textures and render it out. Very straightforward. Basically, all you need is a setAttr statement that tells Maya which files to use for textures. Then you’ll need some way of figuring out how to map which image where. Simples cases can be solved by proper naming conventions, more complicated scenarios might involve (you mentioned website) access to a database.



Replies: 0
avatar
  • masmidow
  • Posted: 26 April 2011 02:14 PM

Yeah… that’s kind of what I figured. Thanks!

I know Python is a server-side language, so I think that the database functionality would be easy to set up. Just getting the images assigned correctly is my challenge.



Replies: 0
avatar
  • THNKR
  • Posted: 26 April 2011 03:03 PM

masmidow 26 April 2011 09:14 PM

Just getting the images assigned correctly is my challenge.

That’s the easy part. Build a dictionary that maps a paths to a file node. Better names than file1, file2 etc… are obviously going to help, but this should illustrate the principle:

texturefiles {"file1":"sourceimages/image1.tif",
    
"file2""sourceimages/texture2.iff",
    
"file3":"sourceimages/im_001.png"}
    
for kv in texturefiles.iteritems():
    print 
kv
    cmds
.setAttr("%s.fileTextureName" kvtype="string")


Replies: 0