-
Notifications
You must be signed in to change notification settings - Fork 0
/
Caffeine Molecule Rendering in Blender.py
139 lines (135 loc) · 7.99 KB
/
Caffeine Molecule Rendering in Blender.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# %%
import bpy
bpy.data.worlds["World"].node_tree.nodes["Background"].inputs[0].default_value = (1, 1, 1, 1)
bpy.data.worlds["World"].node_tree.nodes["Background"].inputs[0].default_value = (1, 1, 1, 1)
bpy.context.space_data.context = 'OUTPUT'
bpy.context.space_data.context = 'RENDER'
bpy.context.space_data.context = 'VIEW_LAYER'
bpy.context.space_data.context = 'OUTPUT'
bpy.context.space_data.context = 'WORLD'
bpy.context.space_data.context = 'DATA'
bpy.context.space_data.system_bookmarks_active = 2
bpy.context.space_data.system_bookmarks_active = 3
bpy.context.space_data.params.filename = "Caffeine in 4K with white bkgnd.png"
bpy.ops.image.save_as(save_as_render=True, copy=True, filepath="C:\\Users\\ojbsn\\Downloads\\Caffeine in 4K with white bkgnd.png", relative_path=True, show_multiview=False, use_multiview=False)
bpy.ops.image.save_as(save_as_render=True, copy=True, filepath="C:\\Users\\ojbsn\\Downloads\\Caffeine in 4K with white bkgnd.png", show_multiview=False, use_multiview=False)
bpy.context.space_data.context = 'WORLD'
bpy.context.space_data.context = 'VIEW_LAYER'
bpy.context.space_data.context = 'RENDER'
bpy.context.space_data.context = 'DATA'
bpy.context.space_data.context = 'OBJECT'
bpy.context.space_data.context = 'SCENE'
bpy.context.space_data.context = 'VIEW_LAYER'
bpy.context.space_data.context = 'OUTPUT'
bpy.context.scene.render.resolution_x = 7860
bpy.context.scene.render.resolution_y = 4320
bpy.context.space_data.context = 'RENDER'
bpy.context.scene.render.engine = 'BLENDER_EEVEE'
bpy.context.scene.render.engine = 'CYCLES'
bpy.context.scene.cycles.device = 'GPU'
bpy.context.scene.cycles.feature_set = 'EXPERIMENTAL'
bpy.context.space_data.context = 'OUTPUT'
bpy.context.scene.render.use_border = True
bpy.context.scene.render.use_border = False
bpy.context.scene.render.use_border = True
bpy.context.scene.render.use_border = False
bpy.context.space_data.context = 'TOOL'
bpy.context.space_data.context = 'RENDER'
bpy.ops.outliner.item_activate(deselect_all=True)
bpy.context.space_data.context = 'MODIFIER'
bpy.context.space_data.context = 'TOOL'
bpy.context.space_data.context = 'RENDER'
bpy.context.space_data.context = 'OUTPUT'
bpy.context.space_data.context = 'VIEW_LAYER'
bpy.context.space_data.context = 'WORLD'
bpy.context.space_data.context = 'SCENE'
bpy.context.space_data.context = 'WORLD'
bpy.context.space_data.context = 'OBJECT'
bpy.context.space_data.context = 'PARTICLES'
bpy.context.space_data.context = 'PHYSICS'
bpy.context.space_data.context = 'CONSTRAINT'
bpy.context.space_data.context = 'DATA'
bpy.context.space_data.context = 'MODIFIER'
bpy.context.space_data.context = 'MATERIAL'
bpy.context.object.active_material_index = 2
bpy.data.materials["Hydrogen"].node_tree.nodes["Principled BSDF"].inputs[0].default_value = (0.7484, 0.7484, 0.7484, 1)
bpy.data.materials["Hydrogen"].node_tree.nodes["Principled BSDF"].inputs[0].default_value = (0.7484, 0.7484, 0.7484, 1)
bpy.context.space_data.context = 'OUTPUT'
bpy.context.space_data.params.filename = "Caffeine in 8K with white bkgnd.png"
bpy.context.space_data.system_bookmarks_active = 2
bpy.context.space_data.system_bookmarks_active = 3
bpy.context.space_data.system_bookmarks_active = 1
bpy.context.space_data.system_bookmarks_active = 0
bpy.context.space_data.system_bookmarks_active = 3
bpy.ops.image.save_as(save_as_render=True, copy=True, filepath="C:\\Users\\ojbsn\\Downloads\\Caffeine in 8K with white bkgnd.png", show_multiview=False, use_multiview=False)
bpy.context.space_data.show_region_toolbar = True
bpy.context.space_data.show_region_ui = True
bpy.context.space_data.show_region_ui = False
bpy.ops.outliner.item_activate(deselect_all=True)
bpy.context.space_data.context = 'OBJECT'
bpy.context.space_data.context = 'SCENE'
bpy.context.space_data.context = 'CONSTRAINT'
bpy.context.space_data.context = 'DATA'
bpy.context.space_data.context = 'PHYSICS'
bpy.context.space_data.context = 'PARTICLES'
bpy.context.space_data.context = 'MODIFIER'
bpy.context.space_data.context = 'OBJECT'
bpy.context.space_data.context = 'WORLD'
bpy.context.space_data.context = 'SCENE'
bpy.context.space_data.context = 'VIEW_LAYER'
bpy.context.space_data.context = 'OUTPUT'
bpy.context.space_data.context = 'RENDER'
bpy.context.space_data.context = 'TOOL'
bpy.ops.outliner.item_activate(deselect_all=True)
bpy.ops.outliner.item_rename()
bpy.ops.outliner.item_activate(deselect_all=True)
bpy.context.space_data.context = 'TEXTURE'
bpy.context.space_data.context = 'MATERIAL'
bpy.context.object.active_material_index = 2
bpy.data.materials["Hydrogen"].node_tree.nodes["Principled BSDF"].inputs[0].default_value = (0.507067, 0.507067, 0.507067, 1)
bpy.data.materials["Hydrogen"].node_tree.nodes["Principled BSDF"].inputs[0].default_value = (0.507067, 0.507067, 0.507067, 1)
bpy.context.object.active_material_index = 2
bpy.data.materials["Hydrogen"].node_tree.nodes["Principled BSDF"].inputs[0].default_value = (0.911392, 0.911392, 0.911392, 1)
bpy.data.materials["Hydrogen"].node_tree.nodes["Principled BSDF"].inputs[0].default_value = (0.527717, 0.527717, 0.527717, 1)
bpy.data.materials["Hydrogen"].node_tree.nodes["Principled BSDF"].inputs[0].default_value = (0.54885, 0.54885, 0.54885, 1)
bpy.data.materials["Hydrogen"].node_tree.nodes["Principled BSDF"].inputs[0].default_value = (0.184468, 0.184468, 0.184468, 1)
bpy.data.materials["Hydrogen"].node_tree.nodes["Principled BSDF"].inputs[0].default_value = (1, 1, 1, 1)
bpy.data.materials["Hydrogen"].node_tree.nodes["Principled BSDF"].inputs[0].default_value = (0.559599, 0.559599, 0.559599, 1)
bpy.data.materials["Hydrogen"].node_tree.nodes["Principled BSDF"].inputs[0].default_value = (0.559599, 0.559599, 0.559599, 1)
bpy.context.space_data.params.filename = "Adjusted Caffeine in 8K with white bkgnd.png"
bpy.ops.image.save_as(save_as_render=True, copy=True, filepath="C:\\Users\\ojbsn\\Downloads\\Adjusted Caffeine in 8K with white bkgnd.png", show_multiview=False, use_multiview=False)
bpy.context.space_data.context = 'OUTPUT'
bpy.context.scene.render.resolution_x = 7680
bpy.ops.object.select_all(action='SELECT')
bpy.ops.object.shade_smooth()
bpy.ops.object.shade_smooth(use_auto_smooth=True)
bpy.data.window_managers["WinMan"].(null) = True
bpy.ops.object.shade_smooth()
bpy.ops.object.shade_smooth(use_auto_smooth=True)
bpy.data.window_managers["WinMan"].(null) = True
bpy.context.space_data.context = 'MATERIAL'
bpy.data.materials["Hydrogen"].node_tree.nodes["Principled BSDF"].inputs[9].default_value = 0.1
bpy.context.object.active_material_index = 3
bpy.data.materials["Oxygen"].node_tree.nodes["Principled BSDF"].inputs[0].default_value = (0.401967, 0, 0.00315694, 1)
bpy.data.materials["Oxygen"].node_tree.nodes["Principled BSDF"].inputs[0].default_value = (0.409, 0, 0.00321228, 1)
bpy.context.space_data.context = 'TEXTURE'
bpy.context.space_data.context = 'MATERIAL'
bpy.context.space_data.params.filename = "Adjusted Caffeine in 8K with white bkgnd.png"
bpy.ops.image.save_as(save_as_render=True, copy=True, filepath="C:\\Users\\ojbsn\\Downloads\\Adjusted Caffeine in 8K with white bkgnd.png", show_multiview=False, use_multiview=False)
bpy.context.space_data.context = 'MATERIAL'
bpy.context.space_data.context = 'OUTPUT'
bpy.context.space_data.context = 'VIEW_LAYER'
bpy.context.space_data.context = 'RENDER'
bpy.context.scene.cycles.feature_set = 'SUPPORTED'
bpy.context.scene.cycles.samples = 1541
bpy.context.scene.cycles.samples = 1500
bpy.context.space_data.context = 'OUTPUT'
bpy.context.scene.render.resolution_y = 2160
bpy.context.scene.render.resolution_x = 3840
bpy.context.space_data.context = 'TOOL'
bpy.context.space_data.context = 'RENDER'
bpy.context.space_data.params.filename = "Adjusted Caffeine in 4K with white bkgnd.png"
bpy.ops.image.save_as(save_as_render=True, copy=True, filepath="C:\\Users\\ojbsn\\Downloads\\Adjusted Caffeine in 4K with white bkgnd.png", show_multiview=False, use_multiview=False)
bpy.ops.outliner.item_activate(deselect_all=True)
bpy.ops.object.editmode_toggle()
bpy.ops.object.editmode_toggle()