import molecularnodes as mn
mn.register()
mn.assets.install()= mn.Canvas(engine="EEVEE")
can
can.scene_reset()= (860, 540) can.resolution
Materials
We can progrommatically access the properties of the materials like this:
= mn.Molecule.fetch("8H1B").add_style("surface", material = mn.material.AmbientOcclusion())
mol
can.frame_object(mol) can.snapshot()
Fra:1 Mem:102.29M (Peak 119.06M) | Time:00:00.45 | Rendering 1 / 64 samples
Fra:1 Mem:102.29M (Peak 119.06M) | Time:00:00.51 | Rendering 25 / 64 samples
Fra:1 Mem:102.29M (Peak 119.06M) | Time:00:00.56 | Rendering 50 / 64 samples
Fra:1 Mem:102.29M (Peak 119.06M) | Time:00:00.59 | Rendering 64 / 64 samples
Saved: '/tmp/tmptit2vcsw/snapshot.png'
Time: 00:00.71 (Saving: 00:00.10)
0].material.ambient_occlusion_distance = 0.1
mol.styles[ can.snapshot()
Fra:1 Mem:102.29M (Peak 119.14M) | Time:00:00.10 | Rendering 1 / 64 samples
Fra:1 Mem:102.29M (Peak 119.14M) | Time:00:00.16 | Rendering 25 / 64 samples
Fra:1 Mem:102.29M (Peak 119.14M) | Time:00:00.21 | Rendering 50 / 64 samples
Fra:1 Mem:102.29M (Peak 119.14M) | Time:00:00.24 | Rendering 64 / 64 samples
Saved: '/tmp/tmp45mjrbjj/snapshot.png'
Time: 00:00.28 (Saving: 00:00.03)
for x in dir(mn.material.AmbientOcclusion()) if not x.startswith("_")] [x
['ambient_occlusion_color',
'ambient_occlusion_distance',
'ambient_occlusion_normal',
'emission_color',
'emission_strength',
'material',
'math_value',
'mix_a',
'mix_b',
'mix_factor',
'tree']