mm24
mm24

Reputation: 9596

Importing Maya 3D animation files into an existing Cocos2D project: time and resources needed

I've seen this post about importing Maya animation files in a Cocos2D project. I noticed that some game developers have already used this or a similar technique to use Maya files in their games, see for example Mortal Skies.

I am freaking out because my games requires a lot of animations and by far I invested all my money in getting a 2D designer to draw them.

Considering I would like to deliver my product in the next 4 months, I guess, if I wanted to use Maya files, I should hire a Maya animator and change all my character's code. How time expensive is that? Do you guys usually work in team to achieve this?

Also (this is a Maya related question), once I have 2D graphics (sprite frames) is it possible to apply them to Maya objects as textures or should those be specifically crafted for 3D use? (I guess that the texture map is totally different, as far as I remember for a small 3D project I did time ago..)

Thanks a lot for reading..

Upvotes: 0

Views: 1378

Answers (2)

theodox
theodox

Reputation: 12208

part 2 of OP's question was

once I have 2D graphics (sprite frames) is it possible to apply them to Maya objects as textures or should those be specifically crafted for 3D use?

The answer is yes - you can apply your sprite bitmaps in Maya as textures ( animated or static). If you create geometry in your maya scene with the right aspect ratios, you can animate them around on with your sprite textures applied and get a hierarchical 2.5 d animation.

If you already have full sprite sets - eg, characters broken down into pieces like arms and legs -- you could attach them hierarchically in maya and animate them (as in the example linked to in OP's post). From there you could render them out to create new bitmap sprite frames - say, tweening out a walk cycle -- or you could export the animations on the maya objects and use those to drive an in-game 2d animation. You'd need, however, to create your own exporter pathway to take a maya hierarchical animation and export it into a form that cocos understands. That seems to be what OP's link was doing, but I could not find the follow up post which was supposed to illustrate how that worked on the Cocos end .

Upvotes: 0

CodeSmile
CodeSmile

Reputation: 64477

Maya is a 3D design tool. I don't know much about Mortal Skies but I'm guessing it uses the same approach as many 2D games. The models are designed in 3D and animated in 3D in Maya.

Maya then exports a series of numbered 2D bitmap images (TGA, PNG, JPG). Those image files are then used in the 2D engine, normally putting them into a texture atlas (ie using TexturePacker).

Usually the Maya export is not automatic but scripted using Maya's own scripting language to setup the model in a certain way for rendering, for example changing the camera rotation, lighting, etc. before each 2D frame is rendered. That gives you the animation, for example the sideways rotation of an airplane, as a series of rendered 2D images in the image format you desire. From then on the 2D animation work continues as usual and has nothing to do with Maya from this point forward.

Using Maya source files directly in a 2D engine like cocos2d is not meaningful, since those files store the 3D model data.

For a 2D animation tool with direct support for cocos2d you might want to look into Spriter.

Upvotes: 1

Related Questions