Maya Plugin Animation not importing

Started by SebMorales, January 18, 2016, 05:12:08 PM

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

SebMorales

Hi,
When I send my scene to KeyShot it opens properly but it doesn't include the animation frames (only current frame is exported). In Maya the animation works correctly but in KeyShot the animation timeline is empty. Do you know what I may be doing wrong? I was trying to replicate these instructions: https://www.youtube.com/watch?v=MacwcGNJQrM

Here a quick video demonstrating my problem:
https://www.youtube.com/watch?v=t4zgpTxswVs&feature=youtu.be



Additional details:
Platform / OS: OS X Yosemite
KeyShot version: 6.0.264
Plugin version: keyshot6_maya2016_mac_1.0.pkg
Modeling system, including version: Maya 2016
Steps to take to reproduce the problem: Created simple animation, send scene to KeyShot through plugin
Include original CAD, bip, or KSP file (use keyshot.wetransfer.com and send it to support@luxion.com if needed)
File is attached.

jt_pedersen

The plugin/import  supports keyframed transformations(scale/translation), this is made with a rigid solver.

You may have some success by combining scripting and import specific frame, or export to fbx/alembic before importing.




jt_pedersen

The general outline of a script:

I tried it very quickly and it appears the it is not necessary to bake the animation, but interacting with a physics solver in Maya is ...


# AUTHOR jacob toft pedersen
# VERSION 0.0.0
# Based on a bip render frames from a Maya animation

import os

# a bip file with all the materials set up,
# use import specefic frame to select single unanimated frame to work with
baseFile="/Users/jtp/Desktop/bbase.bip"
# The Maya file - the animations needs to be baked
animationFile="/Users/jtp/Desktop/bounce.mb"

#frames to render
startFrame = 0
endFrame = 60
#name of the resulting video
animationName = "animation.mp4"

#Set the renderoptions
#in a hurry, so maxtime is 1 second and it is a very small image
renderOptions = lux.getRenderOptions()
renderOptions.setMaxTimeRendering(1)
#dimensions
w = 128
h = 128

#There should be no need to edit anything after this line


lux.newScene()
lux.openFile(baseFile)
importOptions = lux.getImportOptions()
importOptions['update_mode'] = True

animationPath=os.path.dirname(os.path.realpath(baseFile))
lastFrame = startFrame
for frame in range(startFrame, endFrame, 1):
    importOptions['frame'] = frame
    lux.importFile(path=animationFile, opts=importOptions)
    lux.setCamera("renderCam")
    outputPath = os.path.join(animationPath, "frame{0:05d}.png".format(lastFrame))
    lastFrame += 1
    lux.renderImage(opts=renderOptions, width=w, height=h, path=outputPath)


folder = animationPath
videoName = os.path.join(animationPath, animationName)
lux.encodeVideo(frameFiles="frame%d.png", folder=folder, videoName=videoName, firstFrame=startFrame, lastFrame=lastFrame-1, fps=24)