Skip to content

For performing data-driven 3D modeling and rendering. Useful Python scripts that can be copied into Blender under its scripting tab.

License

Notifications You must be signed in to change notification settings

OJB-Quantum/BlenderPy-Scripts

Repository files navigation

BlenderPy-Scripts-for-Science

For atomic or molecular modeling, you can use a free program like Avogadro2 or MolView for the initial computation/ extraction/ export to a .mol file that can be converted into .pdb file format by other free programs like OpenBabel.

Example of the workflow goes like this: calculate model >> export .mol file >> import .mol into converter (Open Babel) >> export .pdb >> import .pdb into Blender (Atomic Blender) >> adjust model geometry attributes as needed >> configure render settings >> render >> export as video or image file. (Make sure that the Atomic Blender add-on is enabled under EDIT tab >> PREFERENCES so that you can import a .pdb file. Additionally, the xyz file format may be substituted in place of the pdb since Blender can accept both).

The SCRIPTING tab in Blender can be found on the upper-right-hand side of the interface. Once the tab is opened, you can load a copy of Python scripts in directly through copy-paste. It is also possible to copy the code on the left-side of the scripting interface by selecting the INFO button, pressing SELECT ALL, Ctrl + C, then Ctrl + V on the main scripting panel found directly under the SCRIPTING tab. Before running the script, be sure to check that the command "import bpy" is inserted at the top of the script. If it's not there, type it in.

Blender keeps track of all your actions in the program, so you should be able to automate any set of steps or make them repeatable and exportable by experimenting with the directions above.

Enjoy.


Also, I have a free Flickr album of some rendered objects available: https://www.flickr.com/photos/194516106@N05/albums/72177720307046594


Links to programs used in the workflow example:
Avogadro2
MolView
Open Babel
Atomic Blender

Screenshot 2023-03-27 073147

Screenshot 2023-03-27 091611

Screenshot 2023-03-27 091657

Caffeine in 4K with white bkgnd (2)

If you need more learning resources on using Blender for scientific purposes, this is a great channel to start with: https://youtu.be/gAQxwNUH3JA

About

For performing data-driven 3D modeling and rendering. Useful Python scripts that can be copied into Blender under its scripting tab.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published