0
$\begingroup$

Given many .obj files that represent the 3D pose estimation for each frame of a clip, how to combine the .obj files to form an animation?

After performing 3D Pose Estimation on a single human's dance movements, I exported every frame as a .obj file. How can I combine these single .obj files back to a clip in .fbx format for example? So all that I need to do is put them sequentially one after the other, just as you do to image frames to form a video, and then I want to save the resulting animation as a .fbx file.

Thinking this should be easy with blender, I wrote a script to import all the frames inside the blender editor but once I have them inside the editor, I have no idea how to form a sequence of these frames.

I guess this should be very simple question for blender but I never used the software and it would spare time to just know what to do.

$\endgroup$
3
  • $\begingroup$ Not sure whether you have the first part figured out, importing the obj sequence to Blender. For that I found this question: blender.stackexchange.com/questions/26460/… and more specifically used this: github.com/neverhood311/Stop-motion-OBJ. The issue with this is that each frame is a separate object and I think it's a dead end if you want to create an .fbx animation. $\endgroup$
    – reden
    Dec 8, 2021 at 11:30
  • $\begingroup$ yeah exactly, I wrote a python script that imports all the .obj files that I need but each frame is a separate object. My hope was that blender had the functionality to sequentially merge these frames just like with videos. But it doesn't have this functionality, right? $\endgroup$
    – Bendemann
    Dec 8, 2021 at 14:34
  • $\begingroup$ My intuition says 'no'. But if you find out otherwise I'd be happy to hear about it. I'm actually working on a separate tool to go from json (mediapipe in my case) to animated gltf object which is then imported to Blender. But I also saw this in the 'related' section to this question: github.com/electronicarts/dem-bones which might be interesting to look into. $\endgroup$
    – reden
    Dec 9, 2021 at 7:05

1 Answer 1

0
+50
$\begingroup$

it seams a strange data source, however if you got it like that then so it is. Most easy would be to load all in blender, as you did, then put each in a collection and per frame enable a specific collection.

something along this :

import bpy
coll = bpy.data.collections

for c in coll:
 c.hide_render=True   #// firs hide all from render
 b = c
for c in coll:
 c.hide_render=False
 b.hide_render=True   #// HIDE PREVIOUS   

 #// render
 bpy.context.scene.render.filepath = 'pathToOutputImage'
 bpy.context.scene.render.resolution_x = w
 bpy.context.scene.render.resolution_y = h
 bpy.ops.render.render()

 b = c  #// to hide last on next itteration

to add an object into a collection. you might read this (small read) https://blenderartists.org/t/create-new-objects-directly-in-custom-collection/1289477/2

I think since you already wrote an importer hiding might even be easer and do it per object (but maybe you have more other stuff as well). Here is some more if you like to go in that direction https://b3d.interplanety.org/en/changing-objects-visibility-in-the-viewport-and-while-rendering/

in general first you hide all. if you need to loop through a collection unhide one copy the variable for the next loop to hide it on the next iteration

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.