owl-project / NVISII

Apache License 2.0
327 stars 28 forks source link

how to keep action in file(.fbx) #98

Closed Acnext closed 3 years ago

Acnext commented 3 years ago

l try to import a file .fbx but it seems only a object is kept and how to import corresponding transform?

natevm commented 3 years ago

hm, are you using the mesh.create_from_file function? Or the nvisii.import_scene function? The latter should respect FBX transforms, although I'm not sure I've tested that as thoroughly as I should.

Acnext commented 3 years ago

emmm, I am a beginner and use the nvisii.import_scene function as,

  sdb = nvisii.import_scene(
      file_path = 'resources/Golf.fbx',
      position = (1,0,0),
      scale = (1.0, 1.0, 1.0),
  )

  # # # # # # # # # # # # # # # # # # # # # # # # #
  for i in range(10):   
      nvisii.render_to_file(
          width=opt.width, 
          height=opt.height, 
          samples_per_pixel=opt.spp,
          file_path=str(i) + opt.out
      )
  # let's clean up the GPU
  nvisii.deinitialize()

the Golf.fbx is , image and describe the action to play golf but l get this by using above code, image What related code l need to add to keep the action and Material?

natevm commented 3 years ago

Ah, sorry, we do not currently support importing rigged and animated characters in fbx files. That’s probably what’s the cause of the issue. For the moment, a workaround is to save each animation timestep as a different fbx file.

In the future I’d like to add support for animated / rigged fbx files, but that would require some additional API changes (maybe a nvisii.set_time function?).

As for the issue with materials, this should be fixed now on development, and will soon be merged into master and pushed to pip.

Acnext commented 3 years ago

Thanks a lot