ScriptSpot

Forum topic · Scripts Wanted

Log duplicate bone names

By Dekrayzis · 2014-03-01

Description

Hello,
I have an issue with bone names. Maybe I'm going blind with old age or something but I keep receiving an error regarding two bones that have the same name.
Having checked the bone hierarchy, I can't seem to find the issue.

I have searched for a Maxscript for Max 2013 to log any duplicate bone name entries and not been successful.

I would be very much grateful if someone could assist me with my current issue.

Thank you in advance.

Comments (2)

Dekrayzis · 2014-03-01

Thank you for the assistance.

barigazy · 2014-03-01

With this fn you can select all scene bone objects that have duplicated name.
Also this fn returns array of these bones

fn selectDuplicateBones =
(
local allBones = for bone in geometry where isKindOf bone BoneGeometry collect bone.name
if allBones.count == 0 then format "No Bones In This Body!\n" else
(
local duplicates = #()
for i = 1 to allBones.count-1 while i < allBones.count do
(
for j = (i+1) to allBones.count where stricmp allBones[i] allBones[j] == 0 do
(
append duplicates (getNodeByName allBones[i])
)
)
if duplicates.count > 0 do (select duplicates ; duplicates)
)
)
selectDuplicateBones()