Utilities
Small helper node groups used throughout Molecular Nodes
Accumulate Axis Rotation
nodes.geometry.AccumulateAxisRotation(
position= None ,
selection= True ,
pivot= False ,
angle= 0.0 ,
group_id= 0 ,
transform_index= 0 ,
)
GUI reference: Accumulate Axis Rotation .
Parameters
position
InputVector
Position vector to transform
None
selection
InputBoolean
Selection
True
pivot
InputBoolean
The points at which points where Accumulate is true will look to for their axis of transformation.
False
angle
InputFloat
Amount to rotate around the axis
0.0
group_id
InputInteger
Transform field is accumulated individually for each Group ID
0
transform_index
InputInteger
Index at which to evaluate the final transform for the positon. For most cases this will be Index, but it might be that some points need to use the accumulated transform from another point instead
0
Outputs
o.position
VectorSocket
Transformed vector
o.trasnform
MatrixSocket
The accumlated transform, not yet applied to the Position vector
Angstrom to World
nodes.geometry.AngstromToWorld(angstrom= 3.0 )
GUI reference: Angstrom to World .
Parameters
angstrom
InputFloat
Angstrom
3.0
Outputs
o.world
FloatSocket
World
Between Float
nodes.geometry.BetweenFloat(value= 0.0 , lower= 0.0 , upper= 0.0 )
GUI reference: Between Float .
Parameters
value
InputFloat
The value to test if it is between the lower and upper bounds
0.0
lower
InputFloat
Test if the Value is greater than or equal to this
0.0
upper
InputFloat
Test if the Value is less than or equal to this
0.0
Outputs
o.boolean
BooleanSocket
Whether the input Value is between (and including) the lower and upper bounds
Between Integer
nodes.geometry.BetweenInteger(value= 0 , lower= 0 , upper= 19 )
GUI reference: Between Integer .
Parameters
value
InputInteger
The value to test if it exists within the bounds
0
lower
InputInteger
The lower bounds for the test
0
upper
InputInteger
The upper bounds for the test
19
Outputs
o.boolean
BooleanSocket
Whether the input Value is between (and including) the lower and upper bounds
Between Vector
nodes.geometry.BetweenVector(value= None , lower= None , upper= None )
GUI reference: Between Vector .
Parameters
value
InputVector
The value to test element-wise
None
lower
InputVector
The lower bounds (including) for the comparison
None
upper
InputVector
The upper bounds (including) for the comparison
None
Outputs
o.boolean
BooleanSocket
If the value is between (and including) the lower the upper bounds
Centroid
nodes.geometry.Centroid(position= None , selection= True , group_id= 0 )
GUI reference: Centroid .
Parameters
position
InputVector
The Position vector to use for the centroid calculation
None
selection
InputBoolean
Selected points contribute to the computation of the centroid, unselected points do not contribute but still return the centroid for their Group ID
True
group_id
InputInteger
Compute the centroid on for each unique Group ID
0
Outputs
o.centroid
VectorSocket
The computed average vector for each Group ID
Dihedral Angle
nodes.geometry.DihedralAngle(a= None , b= None , c= None , d= None )
GUI reference: Dihedral Angle .
Parameters
a
InputVector
First vector for the calculation, which draws a line to B
None
b
InputVector
Second vector for the calculation, which receives a line from A and draws a line to C
None
c
InputVector
Third vector for the calculation, which receives a line from B and draws a line to D
None
d
InputVector
Last vector for the calculation, which is the end point of the line from D
None
Outputs
o.angle
FloatSocket
The angle between the vectors AB and CD, when made perpendicular to BC.
o.ba_bc
VectorSocket
The vector BA when made perpendicular to the axis BC
o.cd_bc
VectorSocket
The Vector CD when makde perpendicular to the axis BC
o.bc
VectorSocket
The axis vector BC
Evaluate on Atoms
nodes.geometry.EvaluateOnAtoms(
geometry= None ,
selection= True ,
closure= None ,
result= 'Geometry' ,
)
GUI reference: Evaluate on Atoms .
Parameters
geometry
InputGeometry
Geometry to get the bundle of
None
selection
InputBoolean
The parts of the geometry that go into the first output
True
closure
InputClosure
Closure
None
result
| Literal ['Geometry', 'Bundle']
Where to store the result of the closure. Bundle overwrite the existing MN/Atoms bundle. Geometry passes along the bundle and joins the resulting geometry into the output.
'Geometry'
Outputs
o.geometry
GeometrySocket
Geometry
Evaluate Per Group
nodes.geometry.EvaluatePerGroup(
geometry= None ,
closure= None ,
group= 'chain_id' ,
group_id= 0 ,
)
GUI reference: Evaluate Per Group .
Parameters
geometry
InputGeometry
Geometry to split into two parts
None
closure
InputClosure
Closure
None
group
| Literal ['chain_id', 'Group ID']
Group
'chain_id'
group_id
InputInteger
Group ID
0
Outputs
o.geometry
GeometrySocket
Geometry
o.instances
GeometrySocket
Instances
Fallback Boolean
nodes.geometry.FallbackBoolean(name= '' , fallback= False )
Computes the boolean field if the given attribute doesn’t exist. If it doesn’t exist it just uses the attribute instead
GUI reference: Fallback Boolean .
Parameters
name
InputString
Name of the attribute to attempt to read from the geometry
''
fallback
InputBoolean
Value to use instead if the named attribute doesn’t exist on the geometry
False
Outputs
o.boolean
BooleanSocket
The named attribute read from the geometry if it exists, or the fallback value if it doesn’t
Fallback Float
nodes.geometry.FallbackFloat(name= '' , fallback= 0.0 )
GUI reference: Fallback Float .
Parameters
name
InputString
Name of the attribute to attempt to read from the geometry
''
fallback
InputFloat
Value to use instead if the named attribute doesn’t exist on the geometry
0.0
Outputs
o.value
FloatSocket
The named attribute read from the geometry if it exists, or the fallback value if it doesn’t
Fallback Integer
nodes.geometry.FallbackInteger(name= '' , fallback= 0 )
GUI reference: Fallback Integer .
Parameters
name
InputString
Name of the attribute to attempt to read from the geometry
''
fallback
InputInteger
Value to use instead if the named attribute doesn’t exist on the geometry
0
Outputs
o.integer
IntegerSocket
The named attribute read from the geometry if it exists, or the fallback value if it doesn’t
Fallback Matrix
nodes.geometry.FallbackMatrix(name= '' , fallback= None )
GUI reference: Fallback Matrix .
Parameters
name
InputString
Name of the attribute to attempt to read from the geometry
''
fallback
InputMatrix
Value to use instead if the named attribute doesn’t exist on the geometry
None
Outputs
o.matrix
MatrixSocket
The named attribute read from the geometry if it exists, or the fallback value if it doesn’t
Fallback Rotation
nodes.geometry.FallbackRotation(name= '' , fallback= None )
GUI reference: Fallback Rotation .
Parameters
name
InputString
Name of the attribute to attempt to read from the geometry
''
fallback
InputRotation
Value to use instead if the named attribute doesn’t exist on the geometry
None
Outputs
o.rotation
RotationSocket
The named attribute read from the geometry if it exists, or the fallback value if it doesn’t
Fallback Vector
nodes.geometry.FallbackVector(name= '' , fallback= None )
GUI reference: Fallback Vector .
Parameters
name
InputString
Name of the attribute to attempt to read from the geometry
''
fallback
InputVector
Value to use instead if the named attribute doesn’t exist on the geometry
None
Outputs
o.output
VectorSocket
The named attribute read from the geometry if it exists, or the fallback value if it doesn’t
Fractionate Float
nodes.geometry.FractionateFloat(menu= 'Linear' , value= 0.0 )
GUI reference: Fractionate Float .
Parameters
menu
| Literal ['Linear', 'Smoother']
Menu
'Linear'
value
InputFloat
The value to fractionate
0.0
Outputs
o.fraction
FloatSocket
Fractional component of the value, between 0 and 1
o.floor
IntegerSocket
The floor of the value; the integer rounded down
o.ceiling
IntegerSocket
The ceiling of the value, the integer rounded up
Get Geometry Atoms
nodes.geometry.GetGeometryAtoms(geometry= None )
GUI reference: Get Geometry Atoms .
Parameters
geometry
InputGeometry
Geometry to get the bundle of
None
Outputs
o.geometry
GeometrySocket
Geometry
o.bundle
BundleSocket
Bundle
o.atoms
GeometrySocket
Atoms
Index Distance
nodes.geometry.IndexDistance(index= 0 , target_index= 100 , position= None )
GUI reference: Index Distance .
Parameters
index
InputInteger
Index
0
target_index
InputInteger
Index for the selected point to measure to
100
position
InputVector
Position
None
Outputs
o.vector
VectorSocket
Vector from the current point to the indexed point
o.direction
VectorSocket
Normalized vector from the current point to the indexed point
o.distance
FloatSocket
Distance from the current point to the indexed point
o.rotation
RotationSocket
Rotation
Index Mix Float
nodes.geometry.IndexMixFloat(value= 0.0 , index= 0.0 )
GUI reference: Index Mix Float .
Parameters
value
InputFloat
The field to interpolate based on the input Index
0.0
index
InputFloat
The floor and ceiling of this Index value is taken and used for sampling, the fraction of this value is then used to mix between the sampled values
0.0
Outputs
o.value
FloatSocket
The mixed value of the field, first evaluating the field at the From and To Indices then mixing between them based on the fraction of the input Index
o.from_
IntegerSocket
The mixed value of the field, first evaluating the field at the From and To Indices then mixing between them based on the fraction of the input Index
o.to
IntegerSocket
The mixed value of the field, first evaluating the field at the From and To Indices then mixing between them based on the fraction of the input Index
Index Mix Rotation
nodes.geometry.IndexMixRotation(rotation= None , index= 0.0 )
GUI reference: Index Mix Rotation .
Parameters
rotation
InputRotation
The field to interpolate based on the input Index
None
index
InputFloat
The floor and ceiling of this Index value is taken and used for sampling, the fraction of this value is then used to mix between the sampled values
0.0
Outputs
o.rotation
RotationSocket
The mixed value of the field, first evaluating the field at the From and To Indices then mixing between them based on the fraction of the input Index
o.from_
IntegerSocket
The mixed value of the field, first evaluating the field at the From and To Indices then mixing between them based on the fraction of the input Index
o.to
IntegerSocket
The mixed value of the field, first evaluating the field at the From and To Indices then mixing between them based on the fraction of the input Index
Index Mix Vector
nodes.geometry.IndexMixVector(value= None , index= 0.0 )
GUI reference: Index Mix Vector .
Parameters
value
InputVector
The field to interpolate based on the input Index
None
index
InputFloat
The floor and ceiling of this Index value is taken and used for sampling, the fraction of this value is then used to mix between the sampled values
0.0
Outputs
o.value
VectorSocket
The mixed value of the field, first evaluating the field at the From and To Indices then mixing between them based on the fraction of the input Index
o.from_
IntegerSocket
The mixed value of the field, first evaluating the field at the From and To Indices then mixing between them based on the fraction of the input Index
o.to
IntegerSocket
The mixed value of the field, first evaluating the field at the From and To Indices then mixing between them based on the fraction of the input Index
Integer Distance
nodes.geometry.IntegerDistance(a= 0 , b= 0 , distance= 2 )
GUI reference: Integer Distance .
Parameters
a
InputInteger
A
0
b
InputInteger
B
0
distance
InputInteger
Distance
2
Outputs
o.cutoff
BooleanSocket
Cutoff
o.distance
IntegerSocket
Distance
Is Even
nodes.geometry.IsEven(value= 0 )
GUI reference: Is Even .
Parameters
value
InputInteger
Value
0
Outputs
o.even
BooleanSocket
Even
o.odd
BooleanSocket
Odd
MN Typed Bundles
nodes.geometry.MNTypedBundles(
type = 'MN.MeshProcess' ,
closure= None ,
step= 1 ,
path= '' ,
)
GUI reference: MN Typed Bundles .
Parameters
type
| Literal ['MN.MeshProcess']
Type
'MN.MeshProcess'
closure
InputClosure
Closure
None
step
InputInteger
step
1
path
InputString
Path
''
Outputs
o.bundle
BundleSocket
Bundle
Rotation from ZYZ
nodes.geometry.RotationFromZYZ(phi= 0.0 , theta= 0.0 , psi= 0.0 )
Combine a rotation defined as ZYZ common in electron tomography
GUI reference: Rotation from ZYZ .
Parameters
phi
InputFloat
First rotation around the Z axis
0.0
theta
InputFloat
Second rotation around the Y axis
0.0
psi
InputFloat
Third rotation around the Z axis
0.0
Outputs
o.rotation
RotationSocket
The combined Rotation
Vector Angle
nodes.geometry.VectorAngle(a= None , b= None )
The angle between two vectors, in radians
GUI reference: Vector Angle .
Parameters
a
InputVector
The first vector for angle calculation
None
b
InputVector
The second vector for the angle calculation
None
Outputs
o.angle
FloatSocket
The angle between the two vectors in radians
o.a_b
VectorSocket
Axis around which the angle rotates (cross product of A and B)
Vector Direction
nodes.geometry.VectorDirection(normalize= True , to= None , from_= None )
GUI reference: Vector Direction .
Parameters
normalize
InputBoolean
Normalize
True
to
InputVector
To
None
from_
InputVector
From
None
Outputs
o.direction
VectorSocket
Vector between the points, potentially normalized
o.distance
FloatSocket
Distance between the points before normalization
Vector from Point
nodes.geometry.VectorFromPoint(target= None , position= None )
GUI reference: Vector from Point .
Parameters
target
InputVector
Vector that is the target
None
position
InputVector
Position of the current point
None
Outputs
o.vector
VectorSocket
Vector from the current point’s position to the given vector
o.direction
VectorSocket
Normalized output vector
o.length
FloatSocket
Length of the output vector
o.rotation
RotationSocket
Rotation
Velocity
nodes.geometry.Velocity()
GUI reference: Velocity .
Outputs
o.velocity
VectorSocket
velocity
World to Angstrom
nodes.geometry.WorldToAngstrom(world= 0.5 )
GUI reference: World to Angstrom .
Parameters
world
InputFloat
World
0.5
Outputs
o.angstrom
FloatSocket
Angstrom
2 Index Angle
nodes.geometry._2IndexAngle(position= None , index_a= 0 , index_b= 0 , index_c= 2 )
GUI reference: 2 Index Angle .
Parameters
position
InputVector
The Position vectors to use for the angle calculation
None
index_a
InputInteger
First end point for the angle calculation around the current point
0
index_b
InputInteger
The Index for the middle point in the angle calculation, defaulting to the current point
0
index_c
InputInteger
Last end point for the angle calculation around the current point
2
Outputs
o.angle
FloatSocket
Angle of the line A -> Self -> C in radians
3 Index Angle
nodes.geometry._3IndexAngle(index_a= 0 , index_b= 1 , index_c= 2 )
GUI reference: 3 Index Angle .
Parameters
index_a
InputInteger
First of the points for the angle calculation
0
index_b
InputInteger
The middle point for the angle calculation
1
index_c
InputInteger
Last of the points for the angle calculation
2
Outputs
o.angle
FloatSocket
Angle between the points around Index B in radians