Showing posts with label maya. Show all posts
Showing posts with label maya. Show all posts

Tuesday, July 24, 2012

Panda3D & maya


Maya (+x, +y, +z) <=> Panda3D (+x, +z, -y)
Panda3D (+x, +y, +z) <=> Maya (+x, -z, +y)

Panda3D: camera face +Y by default; Maya: Model face +Z as Front

Sample code to add keyboard input:
        self.accept('arrow_up-up', self.moveForward ) # up cursor key released
def moveForward(self):
        self.pos = self.camera.getPos()
        self.pos.y = self.pos.y + 1
        self.camera.setPos(self.pos)
        print self.pos

Sample for mouse input:
self.accept('mouse1-up', self.click)
    
    def click(self):
        if self.mouseWatcherNode.hasMouse():
             print str(self.mouseWatcherNode.getMouseX()) + ", " + str(self.mouseWatcherNode.getMouseY()) # x and y = [-1,1], top left (-1,1), bottom right (1, -1)

Tuesday, May 22, 2012

Panda3D: Maya exporter

used maya2egg****.exe 
kept having error about "procedure entry point not located in some libmmd.dll", etc.

realised that have to copy the exe from panda/bin folder to maya/bin folder

maya2egg -a model -o "output.egg" "input.mb"


m = loader.loadModel("cube.egg")
m.reparentTo(base.render)
m.setPos(0,20,0)

EGG model loaded with texture.

couldn't get the COLLADA model to display textures.


Supported in Panda3d
Currently known scene file types are:
  Bam                             .bam
  Egg                             .egg
  MultiGen                        .flt
  Lightwave                       .lwo
  DXF                             .dxf
  VRML                            .wrl
  DirectX                         .x
  COLLADA                         .dae
  Also available: .ma .mb