nukescripts.snap3d

Functions

addSnapFunc

addSnapFunc(label, func) -> None Add a new snapping function to the list.

allNodes

allNodes() -> iterator Return an iterator which yields all nodes in the current script.

allNodesWithGeoSelectKnob

anySelectedPoint

anySelectedPoint(selectionThreshold) -> _nukemath.Vector3 Return a selected point from the active viewer or the first viewer with a selection.

anySelectedVertexInfo

anySelectedVertexInfo(selectionThreshold) -> VertexInfo

averageNormal

averageNormal(selectionThreshold -> _nukemath.Vector3 Return a _nukemath.Vector3 which is the average of the normals of all selected points

calcAveragePosition

Calculate the average position of all points.

calcBounds

calcRotationVector

callSnapFunc

callSnapFunc(nodeToSnap) -> None Call the snapping function on a node.

cameraProjectionMatrix

Calculate the projection matrix for the camera based on its knob values.

checkAllPointCollinear

Iterates through the points the point and checks if all of them are collinear.

degrees

fuzzyIsZero

Returns true if a value is very close to zero.

fuzzyVector3Add

Adds two vectors ensuring the coordinates are actually 0.0 if they are 0.0001 of zero.

getAxisKnobPrefix

Determine the correct knob name prefix for the Axis knob names by checking the originating knob that triggered the snap menu action.

getSelection

leastSignificantAxis

Given a Vector3, returns the least significant axis position, being x, y and z 0, 1 and 2 respectively.

planeRotation

Calculate the rotations around the X, Y and Z axes that will align a plane perpendicular to the Z axis with the given triangle.

projectPoint

projectPoint(camera, point) -> nuke.math.Vector2

projectPoints

projectPoint(camera, points) -> list of nuke.math.Vector2

projectSelectedPoints

projectSelectedPoints(cameraName='Camera1') -> iterator yielding nuke.math.Vector2

radians

rotateMatrixXYZ

Generates a rotation XYZ matrix from the input vector.

rotateMatrixZXY

Generates a rotation ZXY matrix from the input vector.

rotatePivotSelectionToPoints

rotatePivotToPoints

Rotate the specified node's Pivot Point to the average of the current vertex selection normals in the active viewer.

rotatePivotToPointsVerified

rotateToPointsVerified

scaleToPointsVerified

scalingMatrix

Generates a scaling matrix from the input vector.

selectedPoints

selectedPoints(selectionThreshold) -> iterator

selectedVertexInfos

selectedVertexInfos(selectionThreshold) -> iterator

transformMatrix

Generates the transformation matrix for a given node based on its knob values.

translateMatrix

Generates a translation matrix from the input vector.

translatePivotSelectionToPoints

translatePivotToPoints

Translate the specified node's Pivot Point to the average position of the current vertex selection in the active viewer.

translatePivotToPointsVerified

translateRotatePivot

Pivot translation and rotation must keep the object stationary and in order to do that compensation values must be placed in the geometry translate and rotate.

translateRotatePivotSelectionToPoints

translateRotatePivotToPoints

Translate the specified node's Pivot Point to the average position of the current vertex selection and rotate the pivot to align Z to match the average normals in the active viewer.

translateRotatePivotToPointsVerified

translateRotateScaleSelectionToPoints

translateRotateScaleThisNodeToPoints

translateRotateScaleToPoints

Translate the specified node to the average position of the current vertex selection in the active viewer, rotate to the orientation of the (mean squares) best fit plane for the selection and scale to the extents of the selection.

translateRotateScaleToPointsVerified

translateRotateSelectionToPoints

translateRotateThisNodeToPoints

translateRotateToPoints

Translate the specified node to the average position of the current vertex selection in the active viewer and rotate to the orientation of the (mean squares) best fit plane for the selection.

translateRotateToPointsVerified

translateSelectionToPoints

translateThisNodeToPoints

translateToPoints

Translate the specified node to the average position of the current vertex selection in the active viewer.

translateToPointsVerified

transpose

verifyNodeOrder

verifyNodeToSnap

verifyVertexSelection

Classes

VertexInfo

VertexSelection