Skip to content

Instantly share code, notes, and snippets.

@journeytosilius
Created July 13, 2020 23:22
Show Gist options
  • Save journeytosilius/1ffd99ad23666f2b94aba7d016210276 to your computer and use it in GitHub Desktop.
Save journeytosilius/1ffd99ad23666f2b94aba7d016210276 to your computer and use it in GitHub Desktop.
def run_bpy(self):
print(self.list_render_devices())
rgb_shade_list, processed_image = self.color_steal.color_processing_runner()
album_period = self.check_album_date()
loaded_scene_file,loaded_font = self.select_scene(album_period, rgb_shade_list)
self.change_rgb_gradient_color(rgb_shade_list)
image_to_load = self.load_album_image(processed_image)
self.apply_cover_image_to_material(image_to_load)
self.modify_light_color(rgb_shade_list)
def save_first_render(scene):
img_path = "mediafunnel/blender/video_render.png"
rendered_image = bpy.data.images["Render Result"]
rendered_image.save_render(filepath=img_path)
def thumbnail_render(scene):
print('RENDER FINISHED')
print('something else')
if '50' in loaded_scene_file:
thumb_scene_file = '/home/xavier/blender/jazz_scene_50_thumb.blend'
scene_thumbnail_50 = bpy.ops.wm.open_mainfile(
filepath=thumb_scene_file)
load_thumbnail_template = SceneTemplates(
self.meta).fifties_thumbnail(thumb_scene_file, loaded_font,rgb_shade_list)
self.apply_global_scene_changes(
rgb_shade_list, processed_image)
self.render_thumbnail()
elif '60' in loaded_scene_file:
thumb_scene_file = '/home/xavier/blender/jazz_scene_60_thumb.blend'
scene_thumbnail_60 = bpy.ops.wm.open_mainfile(
filepath=thumb_scene_file)
load_thumbnail_template = SceneTemplates(
self.meta).sixties_thumbnail(thumb_scene_file, loaded_font,rgb_shade_list)
self.apply_global_scene_changes(
rgb_shade_list, processed_image)
self.render_thumbnail()
elif '70' in loaded_scene_file:
thumb_scene_file = '/home/xavier/blender/jazz_scene_70_thumb.blend'
scene_thumbnail_70 = bpy.ops.wm.open_mainfile(
filepath=thumb_scene_file)
load_thumbnail_template = SceneTemplates(
self.meta).seventies_thumbnail(thumb_scene_file, loaded_font,rgb_shade_list)
self.apply_global_scene_changes(
rgb_shade_list, processed_image)
self.render_thumbnail()
elif '90' in loaded_scene_file:
thumb_scene_file = '/home/xavier/blender/jazz_scene_90_thumb.blend'
scene_thumbnail_90 = bpy.ops.wm.open_mainfile(
filepath=thumb_scene_file)
load_thumbnail_template = SceneTemplates(
self.meta).nineties_thumbnail(thumb_scene_file, loaded_font,rgb_shade_list)
self.apply_global_scene_changes(
rgb_shade_list, processed_image)
self.render_thumbnail()
elif '2000' in loaded_scene_file:
thumb_scene_file = '/home/xavier/blender/jazz_scene_2000_thumb.blend'
scene_thumbnail_2000 = bpy.ops.wm.open_mainfile(filepath=thumb_scene_file)
load_thumbnail_template = SceneTemplates(self.meta).nmilenium_thumbnail(thumb_scene_file, loaded_font,rgb_shade_list)
self.apply_global_scene_changes(rgb_shade_list,processed_image)
self.render_thumbnail()
#raise Exception('Render is finished and I am fucking raisin a exception!!!')
else:
pass
bpy.app.handlers.render_complete.append(save_first_render)
bpy.app.handlers.render_complete.append(thumbnail_render)
#bpy.app.handlers.render_complete.append(exit_blender)
self.render_scene()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment