|
import bpy |
|
|
|
""" |
|
import mda_density_viz as d |
|
d.load_example() |
|
""" |
|
|
|
|
|
def load_example(datadir="/tmp/"): |
|
# datadir = bpy.app.tempdir |
|
dxfile = datadir + "water.dx" |
|
vdbfile = datadir + "water.vdb" |
|
_run_density_analysis(dxfile) |
|
dx2vdb(dxfile, vdbfile) |
|
load_vdb(vdbfile) |
|
|
|
|
|
def dx2vdb(infile, outfile): |
|
import pyopenvdb as vdb |
|
from gridData import Grid |
|
import numpy as np |
|
|
|
d = Grid(infile) |
|
vgrid = vdb.FloatGrid() |
|
vgrid.copyFromArray(d.grid) |
|
vgrid.gridClass = vdb.GridClass.FOG_VOLUME |
|
vgrid.name = "density" |
|
vgrid.transform.translate(np.array(d.origin) * 0.01) |
|
vgrid.transform.scale(np.array(d.delta) * 0.01) |
|
vdb.write(outfile, grids=[vgrid]) |
|
|
|
|
|
def load_vdb(filepath): |
|
bpy.ops.object.volume_import(filepath=filepath) |
|
_setup_geometry_nodes() |
|
|
|
|
|
# setup geometry node tree for active volume object |
|
def _setup_geometry_nodes(): |
|
p_material = _p_material_node_group() |
|
bpy.context.active_object.data.materials.append(p_material) |
|
n_material = _n_material_node_group() |
|
bpy.context.active_object.data.materials.append(n_material) |
|
bpy.ops.object.modifier_add(type="NODES") |
|
bpy.context.object.modifiers["GeometryNodes"].node_group = ( |
|
_mda_density_viz_node_group() |
|
) |
|
bpy.context.object.modifiers["GeometryNodes"].node_group.is_modifier = True |
|
|
|
|
|
def _run_density_analysis(dxfile): |
|
import MDAnalysis as mda |
|
from MDAnalysis.tests.datafiles import TPR, XTC |
|
from MDAnalysis.analysis import density |
|
from MDAnalysis import transformations as trans |
|
import molecularnodes as mn |
|
|
|
u = mda.Universe(TPR, XTC) |
|
protein = u.select_atoms("protein") |
|
water = u.select_atoms("resname SOL") |
|
workflow = [ |
|
trans.unwrap(u.atoms), # unwrap all fragments |
|
trans.center_in_box( |
|
protein, center="geometry" # move atoms so protein |
|
), # is centered |
|
trans.wrap( |
|
water, compound="residues" # wrap water back into box |
|
), # keep each water whole |
|
trans.fit_rot_trans( |
|
protein, protein, weights="mass" # align protein to first frame |
|
), |
|
] |
|
u.trajectory.add_transformations(*workflow) |
|
|
|
traj = mn.entities.trajectory.Trajectory(universe=u) |
|
traj.create_object(name="u", style="cartoon") |
|
|
|
ow = u.select_atoms("name OW") |
|
dens = density.DensityAnalysis(ow, delta=4.0, padding=2) |
|
dens.run() |
|
d = dens.results.density |
|
d.convert_density("TIP4P") |
|
d.export(dxfile) |
|
|
|
|
|
# auto-generated by 'Node To Python' extension |
|
# https://extensions.blender.org/add-ons/node-to-python/ |
|
# initialize p_material node group |
|
def _p_material_node_group(): |
|
mat = bpy.data.materials.new(name="p_material") |
|
mat.use_nodes = True |
|
|
|
p_material = mat.node_tree |
|
# start with a clean node tree |
|
for node in p_material.nodes: |
|
p_material.nodes.remove(node) |
|
p_material.color_tag = "NONE" |
|
p_material.description = "" |
|
p_material.default_group_node_width = 140 |
|
|
|
# p_material interface |
|
|
|
# initialize p_material nodes |
|
# node Material Output |
|
material_output = p_material.nodes.new("ShaderNodeOutputMaterial") |
|
material_output.name = "Material Output" |
|
material_output.is_active_output = True |
|
material_output.target = "ALL" |
|
# Displacement |
|
material_output.inputs[2].default_value = (0.0, 0.0, 0.0) |
|
# Thickness |
|
material_output.inputs[3].default_value = 0.0 |
|
|
|
# node Principled BSDF |
|
principled_bsdf = p_material.nodes.new("ShaderNodeBsdfPrincipled") |
|
principled_bsdf.name = "Principled BSDF" |
|
principled_bsdf.distribution = "MULTI_GGX" |
|
principled_bsdf.subsurface_method = "RANDOM_WALK" |
|
# Metallic |
|
principled_bsdf.inputs[1].default_value = 0.0 |
|
# Roughness |
|
principled_bsdf.inputs[2].default_value = 0.5 |
|
# IOR |
|
principled_bsdf.inputs[3].default_value = 1.5 |
|
# Normal |
|
principled_bsdf.inputs[5].default_value = (0.0, 0.0, 0.0) |
|
# Diffuse Roughness |
|
principled_bsdf.inputs[7].default_value = 0.0 |
|
# Subsurface Weight |
|
principled_bsdf.inputs[8].default_value = 0.0 |
|
# Subsurface Radius |
|
principled_bsdf.inputs[9].default_value = (1.0, 0.2, 0.1) |
|
# Subsurface Scale |
|
principled_bsdf.inputs[10].default_value = 0.05 |
|
# Subsurface Anisotropy |
|
principled_bsdf.inputs[12].default_value = 0.0 |
|
# Specular IOR Level |
|
principled_bsdf.inputs[13].default_value = 0.5 |
|
# Specular Tint |
|
principled_bsdf.inputs[14].default_value = (1.0, 1.0, 1.0, 1.0) |
|
# Anisotropic |
|
principled_bsdf.inputs[15].default_value = 0.0 |
|
# Anisotropic Rotation |
|
principled_bsdf.inputs[16].default_value = 0.0 |
|
# Tangent |
|
principled_bsdf.inputs[17].default_value = (0.0, 0.0, 0.0) |
|
# Transmission Weight |
|
principled_bsdf.inputs[18].default_value = 0.0 |
|
# Coat Weight |
|
principled_bsdf.inputs[19].default_value = 0.0 |
|
# Coat Roughness |
|
principled_bsdf.inputs[20].default_value = 0.03 |
|
# Coat IOR |
|
principled_bsdf.inputs[21].default_value = 1.5 |
|
# Coat Tint |
|
principled_bsdf.inputs[22].default_value = (1.0, 1.0, 1.0, 1.0) |
|
# Coat Normal |
|
principled_bsdf.inputs[23].default_value = (0.0, 0.0, 0.0) |
|
# Sheen Weight |
|
principled_bsdf.inputs[24].default_value = 0.0 |
|
# Sheen Roughness |
|
principled_bsdf.inputs[25].default_value = 0.5 |
|
# Sheen Tint |
|
principled_bsdf.inputs[26].default_value = (1.0, 1.0, 1.0, 1.0) |
|
# Emission Color |
|
principled_bsdf.inputs[27].default_value = (1.0, 1.0, 1.0, 1.0) |
|
# Emission Strength |
|
principled_bsdf.inputs[28].default_value = 0.0 |
|
# Thin Film Thickness |
|
principled_bsdf.inputs[29].default_value = 0.0 |
|
# Thin Film IOR |
|
principled_bsdf.inputs[30].default_value = 1.33 |
|
|
|
# node Attribute |
|
attribute = p_material.nodes.new("ShaderNodeAttribute") |
|
attribute.name = "Attribute" |
|
attribute.attribute_name = "iso_positive" |
|
attribute.attribute_type = "GEOMETRY" |
|
|
|
# Set locations |
|
material_output.location = (300.0, 300.0) |
|
principled_bsdf.location = (32.0, 305.0) |
|
attribute.location = (-150.0, 234.0) |
|
|
|
# Set dimensions |
|
material_output.width, material_output.height = 140.0, 100.0 |
|
principled_bsdf.width, principled_bsdf.height = 240.0, 100.0 |
|
attribute.width, attribute.height = 140.0, 100.0 |
|
|
|
# initialize p_material links |
|
# principled_bsdf.BSDF -> material_output.Surface |
|
p_material.links.new(principled_bsdf.outputs[0], material_output.inputs[0]) |
|
# attribute.Color -> principled_bsdf.Base Color |
|
p_material.links.new(attribute.outputs[0], principled_bsdf.inputs[0]) |
|
# attribute.Alpha -> principled_bsdf.Alpha |
|
p_material.links.new(attribute.outputs[3], principled_bsdf.inputs[4]) |
|
return mat |
|
|
|
|
|
# auto-generated by 'Node To Python' extension |
|
# https://extensions.blender.org/add-ons/node-to-python/ |
|
# initialize n_material node group |
|
def _n_material_node_group(): |
|
mat = bpy.data.materials.new(name="n_material") |
|
mat.use_nodes = True |
|
|
|
n_material = mat.node_tree |
|
# start with a clean node tree |
|
for node in n_material.nodes: |
|
n_material.nodes.remove(node) |
|
n_material.color_tag = "NONE" |
|
n_material.description = "" |
|
n_material.default_group_node_width = 140 |
|
|
|
# n_material interface |
|
|
|
# initialize n_material nodes |
|
# node Material Output |
|
material_output = n_material.nodes.new("ShaderNodeOutputMaterial") |
|
material_output.name = "Material Output" |
|
material_output.is_active_output = True |
|
material_output.target = "ALL" |
|
# Displacement |
|
material_output.inputs[2].default_value = (0.0, 0.0, 0.0) |
|
# Thickness |
|
material_output.inputs[3].default_value = 0.0 |
|
|
|
# node Principled BSDF |
|
principled_bsdf = n_material.nodes.new("ShaderNodeBsdfPrincipled") |
|
principled_bsdf.name = "Principled BSDF" |
|
principled_bsdf.distribution = "MULTI_GGX" |
|
principled_bsdf.subsurface_method = "RANDOM_WALK" |
|
# Metallic |
|
principled_bsdf.inputs[1].default_value = 0.0 |
|
# Roughness |
|
principled_bsdf.inputs[2].default_value = 0.5 |
|
# IOR |
|
principled_bsdf.inputs[3].default_value = 1.5 |
|
# Normal |
|
principled_bsdf.inputs[5].default_value = (0.0, 0.0, 0.0) |
|
# Diffuse Roughness |
|
principled_bsdf.inputs[7].default_value = 0.0 |
|
# Subsurface Weight |
|
principled_bsdf.inputs[8].default_value = 0.0 |
|
# Subsurface Radius |
|
principled_bsdf.inputs[9].default_value = (1.0, 0.2, 0.1) |
|
# Subsurface Scale |
|
principled_bsdf.inputs[10].default_value = 0.05 |
|
# Subsurface Anisotropy |
|
principled_bsdf.inputs[12].default_value = 0.0 |
|
# Specular IOR Level |
|
principled_bsdf.inputs[13].default_value = 0.5 |
|
# Specular Tint |
|
principled_bsdf.inputs[14].default_value = (1.0, 1.0, 1.0, 1.0) |
|
# Anisotropic |
|
principled_bsdf.inputs[15].default_value = 0.0 |
|
# Anisotropic Rotation |
|
principled_bsdf.inputs[16].default_value = 0.0 |
|
# Tangent |
|
principled_bsdf.inputs[17].default_value = (0.0, 0.0, 0.0) |
|
# Transmission Weight |
|
principled_bsdf.inputs[18].default_value = 0.0 |
|
# Coat Weight |
|
principled_bsdf.inputs[19].default_value = 0.0 |
|
# Coat Roughness |
|
principled_bsdf.inputs[20].default_value = 0.03 |
|
# Coat IOR |
|
principled_bsdf.inputs[21].default_value = 1.5 |
|
# Coat Tint |
|
principled_bsdf.inputs[22].default_value = (1.0, 1.0, 1.0, 1.0) |
|
# Coat Normal |
|
principled_bsdf.inputs[23].default_value = (0.0, 0.0, 0.0) |
|
# Sheen Weight |
|
principled_bsdf.inputs[24].default_value = 0.0 |
|
# Sheen Roughness |
|
principled_bsdf.inputs[25].default_value = 0.5 |
|
# Sheen Tint |
|
principled_bsdf.inputs[26].default_value = (1.0, 1.0, 1.0, 1.0) |
|
# Emission Color |
|
principled_bsdf.inputs[27].default_value = (1.0, 1.0, 1.0, 1.0) |
|
# Emission Strength |
|
principled_bsdf.inputs[28].default_value = 0.0 |
|
# Thin Film Thickness |
|
principled_bsdf.inputs[29].default_value = 0.0 |
|
# Thin Film IOR |
|
principled_bsdf.inputs[30].default_value = 1.33 |
|
|
|
# node Attribute |
|
attribute = n_material.nodes.new("ShaderNodeAttribute") |
|
attribute.name = "Attribute" |
|
attribute.attribute_name = "iso_negative" |
|
attribute.attribute_type = "GEOMETRY" |
|
|
|
# Set locations |
|
material_output.location = (300.0, 300.0) |
|
principled_bsdf.location = (32.0, 305.0) |
|
attribute.location = (-150.0, 234.0) |
|
|
|
# Set dimensions |
|
material_output.width, material_output.height = 140.0, 100.0 |
|
principled_bsdf.width, principled_bsdf.height = 240.0, 100.0 |
|
attribute.width, attribute.height = 140.0, 100.0 |
|
|
|
# initialize n_material links |
|
# principled_bsdf.BSDF -> material_output.Surface |
|
n_material.links.new(principled_bsdf.outputs[0], material_output.inputs[0]) |
|
# attribute.Color -> principled_bsdf.Base Color |
|
n_material.links.new(attribute.outputs[0], principled_bsdf.inputs[0]) |
|
# attribute.Alpha -> principled_bsdf.Alpha |
|
n_material.links.new(attribute.outputs[3], principled_bsdf.inputs[4]) |
|
return mat |
|
|
|
|
|
# auto-generated by 'Node To Python' extension |
|
# https://extensions.blender.org/add-ons/node-to-python/ |
|
# initialize mda_density_viz node group |
|
def _mda_density_viz_node_group(): |
|
mda_density_viz = bpy.data.node_groups.new( |
|
type="GeometryNodeTree", name="mda_density_viz" |
|
) |
|
|
|
mda_density_viz.color_tag = "NONE" |
|
mda_density_viz.description = "" |
|
mda_density_viz.default_group_node_width = 140 |
|
|
|
# mda_density_viz interface |
|
# Socket Geometry |
|
geometry_socket = mda_density_viz.interface.new_socket( |
|
name="Geometry", in_out="OUTPUT", socket_type="NodeSocketGeometry" |
|
) |
|
geometry_socket.attribute_domain = "POINT" |
|
|
|
# Socket iso positive output |
|
iso_positive_output_socket = mda_density_viz.interface.new_socket( |
|
name="iso positive output", in_out="OUTPUT", socket_type="NodeSocketColor" |
|
) |
|
iso_positive_output_socket.default_value = (0.0, 0.0, 0.0, 1.0) |
|
iso_positive_output_socket.default_attribute_name = "iso_positive" |
|
iso_positive_output_socket.attribute_domain = "POINT" |
|
|
|
# Socket iso negative output |
|
iso_negative_output_socket = mda_density_viz.interface.new_socket( |
|
name="iso negative output", in_out="OUTPUT", socket_type="NodeSocketColor" |
|
) |
|
iso_negative_output_socket.default_value = (0.0, 0.0, 0.0, 1.0) |
|
iso_negative_output_socket.default_attribute_name = "iso_negative" |
|
iso_negative_output_socket.attribute_domain = "POINT" |
|
|
|
# Socket Geometry |
|
geometry_socket_1 = mda_density_viz.interface.new_socket( |
|
name="Geometry", in_out="INPUT", socket_type="NodeSocketGeometry" |
|
) |
|
geometry_socket_1.attribute_domain = "POINT" |
|
|
|
# Socket isolevel |
|
isolevel_socket = mda_density_viz.interface.new_socket( |
|
name="isolevel", in_out="INPUT", socket_type="NodeSocketFloat" |
|
) |
|
isolevel_socket.default_value = 0.5 |
|
isolevel_socket.min_value = -1.5 |
|
isolevel_socket.max_value = 1.5 |
|
isolevel_socket.subtype = "NONE" |
|
isolevel_socket.attribute_domain = "POINT" |
|
isolevel_socket.force_non_field = True |
|
|
|
# Socket iso positive |
|
iso_positive_socket = mda_density_viz.interface.new_socket( |
|
name="iso positive", in_out="INPUT", socket_type="NodeSocketColor" |
|
) |
|
iso_positive_socket.default_value = (0.0, 0.0, 1.0, 0.5) |
|
iso_positive_socket.attribute_domain = "POINT" |
|
iso_positive_socket.force_non_field = True |
|
|
|
# Socket iso negative |
|
iso_negative_socket = mda_density_viz.interface.new_socket( |
|
name="iso negative", in_out="INPUT", socket_type="NodeSocketColor" |
|
) |
|
iso_negative_socket.default_value = (1.0, 0.0, 0.0, 0.5) |
|
iso_negative_socket.attribute_domain = "POINT" |
|
iso_negative_socket.force_non_field = True |
|
|
|
# Socket slice X |
|
slice_x_socket = mda_density_viz.interface.new_socket( |
|
name="slice X", in_out="INPUT", socket_type="NodeSocketFloat" |
|
) |
|
slice_x_socket.default_value = 0.0 |
|
slice_x_socket.min_value = 0.0 |
|
slice_x_socket.max_value = 2.0 |
|
slice_x_socket.subtype = "NONE" |
|
slice_x_socket.attribute_domain = "POINT" |
|
slice_x_socket.force_non_field = True |
|
|
|
# Socket contour |
|
contour_socket = mda_density_viz.interface.new_socket( |
|
name="contour", in_out="INPUT", socket_type="NodeSocketBool" |
|
) |
|
contour_socket.default_value = False |
|
contour_socket.attribute_domain = "POINT" |
|
contour_socket.force_non_field = True |
|
|
|
# initialize mda_density_viz nodes |
|
# node Volume to Mesh.001 |
|
volume_to_mesh_001 = mda_density_viz.nodes.new("GeometryNodeVolumeToMesh") |
|
volume_to_mesh_001.name = "Volume to Mesh.001" |
|
volume_to_mesh_001.resolution_mode = "GRID" |
|
# Adaptivity |
|
volume_to_mesh_001.inputs[4].default_value = 0.0 |
|
|
|
# node Join Geometry |
|
join_geometry = mda_density_viz.nodes.new("GeometryNodeJoinGeometry") |
|
join_geometry.name = "Join Geometry" |
|
|
|
# node Group Output |
|
group_output = mda_density_viz.nodes.new("NodeGroupOutput") |
|
group_output.name = "Group Output" |
|
group_output.is_active_output = True |
|
|
|
# node Delete Geometry |
|
delete_geometry = mda_density_viz.nodes.new("GeometryNodeDeleteGeometry") |
|
delete_geometry.name = "Delete Geometry" |
|
delete_geometry.domain = "POINT" |
|
delete_geometry.mode = "ALL" |
|
|
|
# node Compare |
|
compare = mda_density_viz.nodes.new("FunctionNodeCompare") |
|
compare.name = "Compare" |
|
compare.data_type = "FLOAT" |
|
compare.mode = "ELEMENT" |
|
compare.operation = "LESS_EQUAL" |
|
|
|
# node Position |
|
position = mda_density_viz.nodes.new("GeometryNodeInputPosition") |
|
position.name = "Position" |
|
|
|
# node Separate XYZ |
|
separate_xyz = mda_density_viz.nodes.new("ShaderNodeSeparateXYZ") |
|
separate_xyz.name = "Separate XYZ" |
|
|
|
# node Group Input |
|
group_input = mda_density_viz.nodes.new("NodeGroupInput") |
|
group_input.name = "Group Input" |
|
|
|
# node Set Material |
|
set_material = mda_density_viz.nodes.new("GeometryNodeSetMaterial") |
|
set_material.name = "Set Material" |
|
# Selection |
|
set_material.inputs[1].default_value = True |
|
set_material.inputs[2].default_value = bpy.data.materials["p_material"] |
|
|
|
# node Set Material.001 |
|
set_material_001 = mda_density_viz.nodes.new("GeometryNodeSetMaterial") |
|
set_material_001.name = "Set Material.001" |
|
# Selection |
|
set_material_001.inputs[1].default_value = True |
|
set_material_001.inputs[2].default_value = bpy.data.materials["n_material"] |
|
|
|
# node Volume to Mesh |
|
volume_to_mesh = mda_density_viz.nodes.new("GeometryNodeVolumeToMesh") |
|
volume_to_mesh.name = "Volume to Mesh" |
|
volume_to_mesh.resolution_mode = "GRID" |
|
# Adaptivity |
|
volume_to_mesh.inputs[4].default_value = 0.0 |
|
|
|
# node Math |
|
math = mda_density_viz.nodes.new("ShaderNodeMath") |
|
math.name = "Math" |
|
math.operation = "MULTIPLY" |
|
math.use_clamp = False |
|
# Value_001 |
|
math.inputs[1].default_value = -1.0 |
|
|
|
# node Set Shade Smooth |
|
set_shade_smooth = mda_density_viz.nodes.new("GeometryNodeSetShadeSmooth") |
|
set_shade_smooth.name = "Set Shade Smooth" |
|
set_shade_smooth.domain = "FACE" |
|
# Selection |
|
set_shade_smooth.inputs[1].default_value = True |
|
# Shade Smooth |
|
set_shade_smooth.inputs[2].default_value = True |
|
|
|
# node Mesh to Curve |
|
mesh_to_curve = mda_density_viz.nodes.new("GeometryNodeMeshToCurve") |
|
mesh_to_curve.name = "Mesh to Curve" |
|
|
|
# node Join Geometry.001 |
|
join_geometry_001 = mda_density_viz.nodes.new("GeometryNodeJoinGeometry") |
|
join_geometry_001.name = "Join Geometry.001" |
|
|
|
# Set locations |
|
volume_to_mesh_001.location = (29.0, -19.0) |
|
join_geometry.location = (617.0, 98.0) |
|
group_output.location = (1536.0, -106.0) |
|
delete_geometry.location = (977.0, 132.0) |
|
compare.location = (564.0, -209.0) |
|
position.location = (229.0, -217.0) |
|
separate_xyz.location = (390.0, -192.0) |
|
group_input.location = (-484.0, -77.0) |
|
set_material.location = (394.0, 154.0) |
|
set_material_001.location = (394.0, 13.0) |
|
volume_to_mesh.location = (29.0, 151.0) |
|
math.location = (-141.0, -19.0) |
|
set_shade_smooth.location = (795.0, 152.0) |
|
mesh_to_curve.location = (1160.0, -144.0) |
|
join_geometry_001.location = (1348.0, -6.0) |
|
|
|
# Set dimensions |
|
volume_to_mesh_001.width, volume_to_mesh_001.height = 170.0, 100.0 |
|
join_geometry.width, join_geometry.height = 140.0, 100.0 |
|
group_output.width, group_output.height = 140.0, 100.0 |
|
delete_geometry.width, delete_geometry.height = 140.0, 100.0 |
|
compare.width, compare.height = 140.0, 100.0 |
|
position.width, position.height = 140.0, 100.0 |
|
separate_xyz.width, separate_xyz.height = 140.0, 100.0 |
|
group_input.width, group_input.height = 140.0, 100.0 |
|
set_material.width, set_material.height = 140.0, 100.0 |
|
set_material_001.width, set_material_001.height = 140.0, 100.0 |
|
volume_to_mesh.width, volume_to_mesh.height = 170.0, 100.0 |
|
math.width, math.height = 140.0, 100.0 |
|
set_shade_smooth.width, set_shade_smooth.height = 140.0, 100.0 |
|
mesh_to_curve.width, mesh_to_curve.height = 140.0, 100.0 |
|
join_geometry_001.width, join_geometry_001.height = 140.0, 100.0 |
|
|
|
# initialize mda_density_viz links |
|
# group_input.Geometry -> volume_to_mesh.Volume |
|
mda_density_viz.links.new(group_input.outputs[0], volume_to_mesh.inputs[0]) |
|
# group_input.isolevel -> math.Value |
|
mda_density_viz.links.new(group_input.outputs[1], math.inputs[0]) |
|
# group_input.isolevel -> volume_to_mesh.Threshold |
|
mda_density_viz.links.new(group_input.outputs[1], volume_to_mesh.inputs[3]) |
|
# math.Value -> volume_to_mesh_001.Threshold |
|
mda_density_viz.links.new(math.outputs[0], volume_to_mesh_001.inputs[3]) |
|
# group_input.Geometry -> volume_to_mesh_001.Volume |
|
mda_density_viz.links.new(group_input.outputs[0], volume_to_mesh_001.inputs[0]) |
|
# volume_to_mesh.Mesh -> set_material.Geometry |
|
mda_density_viz.links.new(volume_to_mesh.outputs[0], set_material.inputs[0]) |
|
# set_material.Geometry -> join_geometry.Geometry |
|
mda_density_viz.links.new(set_material.outputs[0], join_geometry.inputs[0]) |
|
# volume_to_mesh_001.Mesh -> set_material_001.Geometry |
|
mda_density_viz.links.new(volume_to_mesh_001.outputs[0], set_material_001.inputs[0]) |
|
# separate_xyz.X -> compare.A |
|
mda_density_viz.links.new(separate_xyz.outputs[0], compare.inputs[0]) |
|
# position.Position -> separate_xyz.Vector |
|
mda_density_viz.links.new(position.outputs[0], separate_xyz.inputs[0]) |
|
# compare.Result -> delete_geometry.Selection |
|
mda_density_viz.links.new(compare.outputs[0], delete_geometry.inputs[1]) |
|
# group_input.slice X -> compare.B |
|
mda_density_viz.links.new(group_input.outputs[4], compare.inputs[1]) |
|
# group_input.iso negative -> group_output.iso negative output |
|
mda_density_viz.links.new(group_input.outputs[3], group_output.inputs[2]) |
|
# group_input.iso positive -> group_output.iso positive output |
|
mda_density_viz.links.new(group_input.outputs[2], group_output.inputs[1]) |
|
# join_geometry_001.Geometry -> group_output.Geometry |
|
mda_density_viz.links.new(join_geometry_001.outputs[0], group_output.inputs[0]) |
|
# set_shade_smooth.Geometry -> delete_geometry.Geometry |
|
mda_density_viz.links.new(set_shade_smooth.outputs[0], delete_geometry.inputs[0]) |
|
# join_geometry.Geometry -> set_shade_smooth.Geometry |
|
mda_density_viz.links.new(join_geometry.outputs[0], set_shade_smooth.inputs[0]) |
|
# delete_geometry.Geometry -> mesh_to_curve.Mesh |
|
mda_density_viz.links.new(delete_geometry.outputs[0], mesh_to_curve.inputs[0]) |
|
# delete_geometry.Geometry -> join_geometry_001.Geometry |
|
mda_density_viz.links.new(delete_geometry.outputs[0], join_geometry_001.inputs[0]) |
|
# group_input.contour -> mesh_to_curve.Selection |
|
mda_density_viz.links.new(group_input.outputs[5], mesh_to_curve.inputs[1]) |
|
# set_material_001.Geometry -> join_geometry.Geometry |
|
mda_density_viz.links.new(set_material_001.outputs[0], join_geometry.inputs[0]) |
|
# mesh_to_curve.Curve -> join_geometry_001.Geometry |
|
mda_density_viz.links.new(mesh_to_curve.outputs[0], join_geometry_001.inputs[0]) |
|
return mda_density_viz |