nukescripts.geosnap3d

Functions

average_normal

Return a _nukemath.Vector3 which is the average of the normals of all selected points

calc_average_position

Calculate the average position of all points.

calc_bounds

Get the size of the bounding box of all the selected points Avoid zero size to allow inverse scaling (1/scale)

calc_rotation_vector

Get the rotation vector

check_all_point_collinear

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

copy_stage

Returns a copy of the given stage.

degrees

Return a list of all radians values in argument converted to degrees

ensure_frame_range

If frames is not iterable (i.e it's a single number) we create an array with the single frame

fuzzy_is_zero

Returns true if a value is very close to zero.

fuzzy_vector3_add

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

geo_to_selection

Translate/rotate/scale the specified node to the average position of the current vertex selection on the stage.

get_axis_pivot_rotate_knob

Get the axis pivot_rotate knob

get_axis_pivot_translate_knob

Get the axis pivot_translate knob

get_axis_rotate_knob

Get the axis rotate knob

get_axis_scaling_knob

Get the axis scaling knob

get_axis_translate_knob

Get the axis translate knob

get_axis_uniform_scaling_knob

Get the axis uniform_scale knob

get_node_transform_matrix

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

get_prim_world_rotation_zxy

Get xyz rotation angles in radians for the prim in world space assuming zxy rotation order

get_rotate_enabled

Get whether rotation is enabled by the snap knob with the given prefix

get_scale_enabled

Get whether scale is enabled by the snap knob with the given prefix

get_selected_prim_path

Get the currently selected prim

get_stage_from_active_viewer

Gets the stage from the active viewer with the specified frame range.

get_translate_enabled

Get whether translation is enabled by the snap knob with the given prefix

get_vertex_selection

Build a GeoVertexSelection from GeoVertexInfos

get_world_point_on_bbox

Return points inside or on the bounding box of a prim in world space

least_significant_axis

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

need_stage_copy

This method will either return true if a copy of the stage is needed, false otherwise.

on_snap_knob

Called by the snap knobs to perform a pivot_to_selection/pivot_to_bbox/geo_to_selection operation.

pivot_to_bbox

Translate and optionally rotate the specified node's Pivot Point to a chosen point on the currently selected prim's bounding box.

pivot_to_selection

Translate and/or rotate the specified node's Pivot Point to the average position/rotation of the current vertex selection on the stage.

plane_rotation

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

radians

Return a list of all degree values in argument converted to radians

rotate_geo_to_points_verified

Rotate the geometry to the vertex selection (does not check for required conditions)

rotate_matrix_xyz

Generates a rotation XYZ matrix from the input vector.

rotate_matrix_zxy

Generates a rotation ZXY matrix from the input vector.

rotate_pivot_to_angles_verified

Rotate the pivot to rotation angles without affecting the geometry's position

rotate_pivot_to_points_verified

Rotate the pivot to the vertex selection without affecting the geometry's position

scale_geo_to_points_verified

Scale the geometry to the vertex selection (does not check for required conditions)

scaling_matrix

Generates a scaling matrix from the input vector.

selected_vertex_infos

selectedVertexInfos(selectionThreshold) -> iterator

should_animate

Returns whether we need to animate the knob by checking how many frames we are going to affect and whether we want to animate even if only a single frame will be affected.

translate_geo_to_points_verified

Translate the geometry to the vertex selection (does not check for required conditions)

translate_matrix

Generates a translation matrix from the input vector.

translate_pivot_to_points_verified

Translate the pivot to the vertex selection without affecting the geometry's position

translate_pivot_to_world_pos_verified

Translate the pivot to world position without affecting the geometry's position

translate_rotate_pivot

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.

transpose_matrix3

Transpose Matrix3 in place

verify_node_order

Verify the transform/rotation order

verify_node_to_snap

Check knobs exist and current transform/rotation order is supported

verify_vertex_selection_for_rotation

GeoSelection should have at least 3 selected vertices for rotation

verify_vertex_selection_not_empty

GeoSelection should have at least 1 selected vertex.

Classes

GeoVertexInfo

Information on a single vertex in the selection

GeoVertexSelection

Selection container

Iterable