DIYer22 / bpycv

Computer vision utils for Blender (generate instance annoatation, depth and 6D pose by one line code)
MIT License
470 stars 58 forks source link

How to extend to animation=True case? #21

Closed TheShadow29 closed 3 years ago

TheShadow29 commented 3 years ago

Thanks for the amazing repository. I was wondering how to use it for instance segmentation in videos?

DIYer22 commented 3 years ago

bpycv not support animation=True yet. We will consider support this feature later.

You could try this code temporarily.

for frame_idx in range(120):
    bpy.context.scene.frame_set(bpy.context.scene.frame_current + 1)
    bpycv.render_data()
TheShadow29 commented 3 years ago

@DIYer22 Thanks for your prompt reply!

I am getting this error

'bpy_prop_collection[key]: key "View Layer" not found'

Any clue why this could be happening?

Edit: This error seems to be happening on this line: https://github.com/DIYer22/bpycv/blob/master/bpycv/render_utils.py#L55

TheShadow29 commented 3 years ago

I can confirm replacing the line with scene.view_layers["View Layer"].cycles to scene.view_layers[0].cycles works out.