Guest User

Untitled

a guest
Nov 21st, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.72 KB | None | 0 0
  1. import bpy;
  2.  
  3. #I'm trying to render out each mesh in the project separately. The for loop on Scn.meshes doesen't work
  4.  
  5. scene_number = len(bpy.data.scenes)
  6.      
  7. for count, Scn in enumerate(bpy.data.scenes):
  8.  
  9.     print('Starting scene '+str(count+1)+' of '+str(scene_number)+': ' + Scn.name)
  10.     for Mesh in enumerate(Scn.meshes):
  11. #AttributeError: 'Scene' object has no attribute 'meshes'
  12.         for Msh in enumerate(Scn.meshes):
  13.             msh.hide_render = True
  14.         mesh.hide_render = False  
  15.        
  16.         Scn.render.filepath = "c:/renders/"+mesh.name
  17.         data_context = {"blend_data": bpy.context.blend_data, "scene": Scn}
  18.         Scn.frame_end = 153
  19.         bpy.ops.render.render(data_context, write_still = True, animation = True)
  20.        
  21. print('Job finished')
Add Comment
Please, Sign In to add comment