Render Your Protein in Blender with Molecular Nodes© Karobben

Render Your Protein in Blender with Molecular Nodes

Who to Install Molecular Nodes for Blender

First, you should download Blender yourself. Instead of the latest version, opt for a stable version because the newest release may have bugs or be incompatible with Molecular Nodes. I tried version 4.40, but when I changed the style of the molecule to Ribbon or another style, Blender crashed and closed itself. Then, I switched to version 4.2.2, and it worked fine.

As following the figure “Install the Extension”, you can find this plugin and install it. Once you down installation, you can find there is some thing new pops up like its show in figure “Update in Scene”. In this new module, you could download the pdb online or when you have pdb in the “Cache Downloads” directory, you could also load it with “Molecular Nodes”. When you load the molecular, it looks terrible. You need to follow the figure “Render By Cycles” and “Start Render” to get a normal view of molecular(“Atoms View”).

Install the Extension

Update in Scene

Render By Cycles
Start Render
Atoms View

Add a Pure Perfect Background

Source: YouTube: EMPossible

Pure White Background

How to set:

Set pure background select
  • “Render” → “Film” → “Transparent”
  • “Render” → “Color Management” → “View Transform” → “Starndard”
  • Set Compositing Set the Compositing. And that’s it. Go to rendering and it woud add an Perfectwhite at the background
    # codes for set a pure white background
    # Those codes only working on the first few steps.
    # I didn't figure how to use script to make the Geometry Nodes
    # So, After you run those 3 commands, you still need to started from step 3 in the second pictures to manually finish the Geometry Nodes setting.
    bpy.context.scene.render.engine = 'CYCLES'
    bpy.context.scene.cycles.device = 'GPU'
    bpy.context.space_data.shading.type = 'RENDERED'

    bpy.context.object.scale[0] = 3.5
    bpy.context.object.scale[1] = 3.5
    bpy.context.object.scale[2] = 3.5


    bpy.context.scene.render.film_transparent = True
    bpy.context.scene.view_settings.view_transform = 'Standard'
    bpy.context.scene.use_nodes = True

    Different Colors in a Surface

    Settings in Geomitry The key idea for given different color is by rendern multiple layers of color on the surface. By reverse select residues , we could delete the colors from selected layer and expose the color from inner layer.
    Results Final resutls show

    Multiple Style in One Object

    Blender Join Geometry
    Like the example in the picture, it rendered both surface model and the stick model in one object. This is achieved by Join Geometry

    Customize the Color From The Surface

    For Customizing the surface color, there are 2 ways to do it.

    1. using pLDDT nodes from Color
    2. using the Color Attribute Map nodes from Color.

    In both case, they are actually using the same set of value stored in pdb or cif file.
    In the pdb format show below, the 11th column marked as white is the value for pLDDT. If you want to manage it with Color Attribute Map, the name of it is b_factor

    ATOM   4365  C   ASP C 150      17.854  27.766  83.090  1.00 99.42      C    C  
    ATOM   4366  O   ASP C 150      17.369  28.239  82.038  1.00 95.32      C    O  
    ATOM   4367  CB  ASP C 150      19.712  26.091  82.521  1.00 98.18      C    C  
    ATOM   4368  CG  ASP C 150      20.447  24.817  82.987  1.00 96.59      C    C  
    ATOM   4369  OD1 ASP C 150      20.121  24.255  84.056  1.00 96.78      C    O  
    ATOM   4370  OD2 ASP C 150      21.402  24.406  82.277  1.00 96.06      C    O1-
    ATOM   4371  OXT ASP C 150      18.041  28.393  84.184  1.00 95.18      C    O1-
    

    Watching List

    Trouble Shoot

    Dead Black in Transparent

    Dead Black Change Setting After Change
    Befor Change Change Setting After Correction

    Render Your Protein in Blender with Molecular Nodes

    https://karobben.github.io/2024/10/19/Bioinfor/blender-molecular-nodes/

    Author

    Karobben

    Posted on

    2024-10-19

    Updated on

    2024-11-02

    Licensed under

    Comments