MAXScript Interface

The BonesPro modifier can be accessed through MAXScript to aid users in the automation of repetitive tasks and to improve integration into production pipelines.

The other modifiers and objects belonging to BonesPro also have corresponding MAXScript interfaces:

Properties

BonePro.use_inertia : boolean

Toggles the use of the BoneJiggler modifier’s inertia settings.

BonesPro.use_oscillation : boolean

Toggles the use of the BoneJiggler modifier’s oscillation settings.

BonesPro.use_stack : boolean

Toggles the use of BonesPro’s ‘Use stack’ option.

BonesPro.use_parabones : boolean

Toggles the use of the ParaBone and MetaBone modifiers.

BonesPro.use_linked : boolean

Toggles the use of all linked ParaBones and MetaBones for deformations.

BonesPro.bone_sync : boolean

Accesses the bone sync option to adjust bone weights for multiple BonesPro modifiers at once.

BonesPro.mirror_plane : integer

Specifies the plane that’s used for mirroring. Accepted values are: 1 (mirror along x axis: yz plane), 2 (mirror along y axis: xz plane), 3 (mirror along z axis: xy plane).

BonesPro.mirror_offset : float

Specifies the offset of the mirror plane from the center of the object’s bounding box.

BonesPro.mirror_threshold : float

Specifies tolerance for finding counterparts of selected bones.

BonesPro.mirror_flip : boolean

By default mirroring follows the normal direction (negative to positive axis side) for mirroring. If this option is enabled the direction is flipped and data from the positive axis side gets mirrored to the negative.

BonesPro.soft_selection : boolean

Toggles the use of soft selection for vertices.

BonesPro.soft_radius : float

Accesses the radius for the vertex soft selection.

BonesPro.use_edge_distance : boolean

Toggles the edge distance based soft selection alternative.

BonesPro.edge_distance : integer

Accesses the distance (number of edges from the selected vertices) for the vertex soft selection.

BonesPro.use_dual_quaternion : boolean

Enables or disables dual quaternion support for the mesh.

Methods

<int> BonesPro.num_bones()

Returns the number of bones that are currently assigned to the modifier.

<float> BonesPro.get_bone_strength <bone>

Returns the strength of the bone with the given index.

<void> BonesPro.set_bone_strength <bone> <strength>

Sets the strength of the bone with the given index to the given value.

<float> BonesPro.get_bone_falloff <bone>

Returns the falloff of the bone with the given index.

<void> BonesPro.set_bone_falloff <bone> <falloff>

Sets the falloff of the gbone with the given index to the given value.

<bool> BonesPro.get_bone_selected <bone>

Returns true if the bone with the given index is currently selected for modification, otherwise it returns false.

<void> BonesPro.set_bone_selected <bone> <selected>

Changes the selection state of the bone with the given index.

<string> BonesPro.get_bone_name <bone>

Returns the name of the bone with the given index.

<int> BonesPro.find_bone <name>

Returns the index of the bone with the given name, if it exists. Returns -1 if no bone with the given name is found.

<bool> BonesPro.get_vert_selected <vert>

Returns true if the vertex with the given index is currently selected for modification, otherwise it returns false.

<void> BonesPro.set_vert_selected <vert> <selected>

Changes the selection state of the vertex with the given index.

<bool> BonesPro.is_forced <bone> <vert>

Returns true if the given bone/vertex pair has a forced weight applied to it. Returns false if the weight is based on the bone’s strength and falloff settings.

<float> BonesPro.get_force <bone> <vert>

Returns the force adjustment for the given bone/vertex pair. Keep in mind that this does not reflect the actual weight. The weight still factors in additional modifications. Use get_weight instead if you want to export the resulting deformation data.

<void> BonesPro.set_force <bone> <vert> <force>

Sets the force adjustment for the given bone/vertex pair to the given value.

<float> BonesPro.get_weight <bone> <vert>

Returns the final weight for the given bone/vertex pair.

<bool> BonesPro.get_excluded <bone> <vert>

Returns true if the given bone is currently excluded from the given vertex. Returns false if the vertex is affected by the bone.

<void> BonesPro.set_excluded <bone> <vert> <excluded>

Sets the exclusion state for the given bone/vertex pair.

<void> BonesPro.exclude_selected()

Excludes all currently selected vertices from all currently selected bones. This corresponds to pushing the exclude button in the BonesPro user interface.

<void> BonesPro.include_selected()

Includes all currently selected vertices to all currently selected bones. This corresponds to pushing the include button in the BonesPro user interface.

<void> BonesPro.mirror_selected()

Mirrors the currently selected bones with the current mirror settings. This corresponds to pushing the mirror bone settings button in the BonesPro user interface.

<void> BonesPro.show_all_bones()

Reveals all bones that are hidden. This only reveals objects that are hidden individually. Objects on invisible layers will stay invisible. This corresponds to pushing the show all bones button in the BonesPro user interface.

<void> BonesPro.hide_all_bones()

Sets the visibility state of all assigned bones to hidden. This corresponds to pushing the hide all bones button in the BonesPro user interface.

<void> BonesPro.show_all_para()

Reveals all metabones and parabones that are hidden. This only reveals objects that are hidden individually. Objects on invisible layers will stay invisible. This corresponds to pushing the show meta/parabones button in the BonesPro user interface.

<void> BonesPro.hide_all_para()

Sets the visibility state of all assigned metabones and parabones to hidden. This corresponds to pushing the hide meta/parabones button in the BonesPro user interface.

<void> BonesPro.show_mesh()

Shows the mesh to which the BonesPro instance is assigned. This corresponds to toggling the hide mesh button in the BonesPro user interface.

<void> BonesPro.hide_mesh()

Hides the mesh to which the BonesPro instance is assigned. Changing the selection state of the object will reveal it again. This corresponds to toggling the hide mesh button in the BonesPro user interface.

<void> BonesPro.bone_select_name <name> <select>

Sets the selection state of the bone with the given name. The call has no effect if no bone with the name can be found. If multiple bones with the given name exist, only the first found will be selected.

<void> BonesPro.bone_select_index <index> <select>

Sets the selection state of the bone with the given index.

<void> BonesPro.bone_select_all()

Marks all assigned bones as selected. This corresponds to pushing the select all bones button in the BonesPro user interface.

<void> BonesPro.bone_select_none()

Marks all assigned bones as not selected. This corresponds to pushing the deselect all bones button in the BonesPro user interface.

<void> BonesPro.bone_select_invert()

Inverts the selection state of all assigned bones. This corresponds to pushing the invert bone selection button in the BonesPro user interface.

<void> BonesPro.bone_select_parent()

Selects the parent bone of each currently selected bone (the originally selected bones are deselected in the process). This corresponds to pushing the select parent bone button in the BonesPro user interface.

<void> BonesPro.bone_select_parent_all()

Recursively selects all parent bones of each currently selected bone. This corresponds to pushing the select parent bone hierarchy button in the BonesPro user interface.

<void> BonesPro.bone_select_children()

Selects the child bones of each currently selected bone (the originally selected bones are deselected in the process). This corresponds to pushing the select child bones button in the BonesPro user interface.

<void> BonesPro.bone_select_children_all()

Recursively selects all child bones of each currently selected bone. This corresponds to pushing the select child bone hierarchy button in the BonesPro user interface.

<void> BonesPro.vert_select_index <index> <select>

Sets the selection state of the vertex with the given index.

<void> BonesPro.vert_select_all()

Marks all the mesh’s vertices as selected.

<void> BonesPro.vert_select_none()

Marks all the mesh’s vertices as not selected.

<void> BonesPro.vert_select_invert()

Inverts the selection state of all the mesh’s vertices. This corresponds to pushing the invert vertex selection button in the BonesPro user interface.

<void> BonesPro.vert_select_grow()

Selects the neighbors of selected vertices. This corresponds to pushing the grow vertex selection button in the BonesPro user interface.

<void> BonesPro.vert_select_shrink()

Deselects selected vertices that have unselected vertices as neighbors. This corresponds to pushing the shrink vertex selection button in the BonesPro user interface.

<void> BonesPro.vert_select_ring()

Creates a ring selection based on the currently selected vertices. This corresponds to pushing the select vertex ring button in the BonesPro user interface.

<void> BonesPro.vert_select_loop()

Creates a loop selection based on the currently selected vertices. This corresponds to pushing the select vertex loop button in the BonesPro user interface.

<void> BonesPro.assign_bones <bones>

Assigns the given objects as bones to the modifier.

<void> BonesPro.bone_remove_selected()

Removes the currently selected objects as bones from the modifier.

<void> BonesPro.skin_export()

Adds a new Skin modifier to the stack and exports the current BonesPro weight settings to it. This corresponds to pushing the skin export button in the BonesPro user interface.

<void> BonesPro.skin_import()

Imports the weight settings from a Skin modifier on the stack. This corresponds to pushing the skin import button in the BonesPro user interface.

<bool> BonesPro.bpm_export <path>

Exports the BonesPro data into a file.

<bool> BonesPro.bpm_import <path>

Reads the given file and imports its data to the BonesPro modifier.

<void> BonesPro.reset_exclusions()

Resets all exclusion settings for the selected bones and vertices back to default. This corresponds to using the reset button in the BonesPro user interface.

<void> BonesPro.reset_weights <all>

Resets forced weight settings back to default. If the given parameter is true, all bone/vertex pairs are reset. If it is false, only the selected bones and vertices are affected. This corresponds to using the reset button in the BonesPro user interface.

<void> BonesPro.limit <num_bones> <all>

Limits the influence on vertices to the given number of bones. If the given parameter is true, all vertices are limited. If it is false, only the selected vertices are affected. This corresponds to using the effects button in the BonesPro user interface.

<void> BonesPro.equalize()

Adjusts the weighings of the selected bones so that they equally (and exclusively) affect the selected vertices. This corresponds to using the effects button in the BonesPro user interface.

<void> BonesPro.set_dq_weight <vert> <weight>

Sets the dual quaternion blend influence percentage of the given vertex to the given value. Acceptable values are in the range from 0.0 (full linear blending) to 100.0 (full dual quaternion blending).

<float> BonesPro.get_dq_weight <vert>

Returns the current dual quaternion blend influence percentage for the given vertex. Values are in the range from 0.0 (full linear blending) to 100.0 (full dual quaternion blending).

<void> BonesPro.enable_move_bone <bool>

Toggles the bone move mode of the modifier to the given state. While move bone is enabled the modifier will not deform the mesh and bones can be repositioned or modified.

<bool> BonesPro.is_move_bone_enabled()

Returns the current state of the modifier’s Move Bone mode.

<bool> BonesPro.add_para_meta <node>

Adds the given object to BonesPro’s list of ParaBones and MetaBones that are considered for deformations. Returns true if the object was added successfully, false if it couldn’t be added. BonesPro will not add any scene objects that are no MetaBones and have no ParaBone modifier.

<bool> BonesPro.remove_para_meta <node>

Removes the given object from BonesPro’s list of ParaBones and MetaBones that are considered for deformations. Returns true if the object was removed successfully, false if it couldn’t be removed.

<array> BonesPro.list_para_meta()

Returns all ParaBone and MetaBone objects that are currently considered for deformations.

<bool> BonesPro.replace_bone <node> <node>

Replaces the bone identified by the first given object with the second given object. The new bone uses all settings from the old bone. Returns true if the bone was replaced successfully. Returns false if the replacement couldn’t be performed (for example because the first object is not a bone associated with this BonesPro instance),